<feed xmlns='http://www.w3.org/2005/Atom'>
<title>BMC/OpenBmc/bmcweb.git/redfish-core/include/utils/location_utils.hpp, branch master</title>
<subtitle>A do everything Redfish, KVM, GUI, and DBus webserver for OpenBMC (mirror)</subtitle>
<id>https://git.radix-linux.su/BMC/OpenBmc/bmcweb.git/atom?h=master</id>
<link rel='self' href='https://git.radix-linux.su/BMC/OpenBmc/bmcweb.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/OpenBmc/bmcweb.git/'/>
<updated>2026-08-27T21:05:30+00:00</updated>
<entry>
<title>Refactor location_utils getLocationCode lambda</title>
<updated>2026-08-27T21:05:30+00:00</updated>
<author>
<name>Yuvakumar Selvamani</name>
<email>yuvakumars@ami.com</email>
</author>
<published>2026-08-17T11:26:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/OpenBmc/bmcweb.git/commit/?id=099c9faee0a1e195868de69eb306778ec6d5a788'/>
<id>urn:sha1:099c9faee0a1e195868de69eb306778ec6d5a788</id>
<content type='text'>
getLocationCode() used an inline lambda for the D-Bus async response
callback. The lambda body was long enough to trigger the long-lambda
ast-grep rule, which required an inline suppression comment
(// ast-grep-ignore: long-lambda).

Extract the lambda into a named afterGetLocationCode() function and
bind it with std::bind_front() instead. This matches the existing
bmcweb pattern for D-Bus response callbacks, improves readability,
and removes the need for the ast-grep suppression.

Also change the EBADR log message from BMCWEB_LOG_ERROR to
BMCWEB_LOG_WARNING.

Tested:
- Tested on an AST2600 SoC platform.
- Redfish Service Validator passed with no new errors or warnings.

Change-Id: I3ffa51b1f6bb4bc7bd31e0b2f361294c8aa36978
Signed-off-by: Yuvakumar Selvamani &lt;yuvakumars@ami.com&gt;
</content>
</entry>
<entry>
<title>Flag long lambdas</title>
<updated>2026-07-01T17:10:08+00:00</updated>
<author>
<name>Ed Tanous</name>
<email>etanous@nvidia.com</email>
</author>
<published>2026-06-22T16:53:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/OpenBmc/bmcweb.git/commit/?id=8176ae6778015743b77e8744c046bc50edf13cc4'/>
<id>urn:sha1:8176ae6778015743b77e8744c046bc50edf13cc4</id>
<content type='text'>
Long lambdas have been documented as an anti-pattern for some time.[1]
Despite this being generally understood, bmcweb has a long ways to go
cleaning these up, and routinely code is submitted in violation of this
anti-pattern.

Invent an ast-grep rule that can identify when new examples of this
anti-pattern are added, and ignore the existing 200+ examples that are
in the codebase already using ast-grep ignore.  These flags will give us
something to search for as we clean this up, and will help to prevent
new instances from being added unintentionally.

[1] https://github.com/openbmc/docs/blob/master/anti-patterns.md#very-long-lambda-callbacks

Tested: Comment only change.  ast-grep passes.  Manually removing an
ast-grep ignore flag shows as a failure in ast-grep scan

Change-Id: I77d634a393884969f184d2c39c02cc08288d5a29
Signed-off-by: Ed Tanous &lt;etanous@nvidia.com&gt;
</content>
</entry>
<entry>
<title>Add helper function for Location and `LocationType`</title>
<updated>2026-04-21T17:59:46+00:00</updated>
<author>
<name>Ed Tanous</name>
<email>etanous@nvidia.com</email>
</author>
<published>2021-12-29T05:12:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/OpenBmc/bmcweb.git/commit/?id=54406f74d01d5045345e3c6cbe5fb9cae1518a53'/>
<id>urn:sha1:54406f74d01d5045345e3c6cbe5fb9cae1518a53</id>
<content type='text'>
The location_util::getLocation is used to find the `LocationCode`
interface used for `ServiceLabel`. Also added logic to look for the
Inventory.Connector.X interfaces to populate `LocationType`.

The helper function is added to serve as the common location helper
and remove the same method call in each individual resource files.

For example, `Inventory.Connector.Embedded` means LocationType of
Embedded type.

Currently only support LocationType of
- Slot
- Embedded

Tested: No changes to redfish tree yet
Added unit tests

Change-Id: I7f2a8d6172e37dd72881fbfb5a9dfeaf83b2db09
Signed-off-by: Zhenwei Chen &lt;zhenweichen0207@gmail.com&gt;
Signed-off-by: Willy Tu &lt;wltu@google.com&gt;
Signed-off-by: Ed Tanous &lt;etanous@nvidia.com&gt;
</content>
</entry>
</feed>
