summaryrefslogtreecommitdiff
path: root/redfish-core/lib/sensors.hpp
diff options
context:
space:
mode:
authorEd Tanous <edtanous@google.com>2022-01-06 23:44:41 +0300
committerEd Tanous <ed@tanous.net>2022-01-12 21:32:14 +0300
commitf94c4ecf9cf61b91b552731e4e03cd84c1070972 (patch)
tree445183e7954963ab13afc255845237d5567aab53 /redfish-core/lib/sensors.hpp
parentcd5e430908916fad4cb9dcabf577cace2dca1cc5 (diff)
downloadbmcweb-f94c4ecf9cf61b91b552731e4e03cd84c1070972.tar.xz
Enable clang-tidy forward reference checks
Clang-13 adds new checks we can turn on, which find quite a few errors. Tested: Code compiles Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I74b780760014c898cc440b37aea640b33e91c439
Diffstat (limited to 'redfish-core/lib/sensors.hpp')
-rw-r--r--redfish-core/lib/sensors.hpp37
1 files changed, 23 insertions, 14 deletions
diff --git a/redfish-core/lib/sensors.hpp b/redfish-core/lib/sensors.hpp
index de0a82843f..6d10bb728a 100644
--- a/redfish-core/lib/sensors.hpp
+++ b/redfish-core/lib/sensors.hpp
@@ -327,7 +327,8 @@ void getObjectsWithConnection(
"xyz.openbmc_project.Sensor.Value"};
// Response handler for parsing objects subtree
- auto respHandler = [callback{std::move(callback)}, sensorsAsyncResp,
+ auto respHandler = [callback{std::forward<Callback>(callback)},
+ sensorsAsyncResp,
sensorNames](const boost::system::error_code ec,
const GetSubTreeType& subtree) {
BMCWEB_LOG_DEBUG << "getObjectsWithConnection resp_handler enter";
@@ -466,7 +467,7 @@ void getValidChassisPath(const std::shared_ptr<SensorsAsyncResp>& asyncResp,
"xyz.openbmc_project.Inventory.Item.Chassis"};
auto respHandler =
- [callback{std::move(callback)},
+ [callback{std::forward<Callback>(callback)},
asyncResp](const boost::system::error_code ec,
const std::vector<std::string>& chassisPaths) mutable {
BMCWEB_LOG_DEBUG << "getValidChassisPath respHandler enter";
@@ -520,7 +521,8 @@ void getChassis(const std::shared_ptr<SensorsAsyncResp>& sensorsAsyncResp,
const std::array<const char*, 2> interfaces = {
"xyz.openbmc_project.Inventory.Item.Board",
"xyz.openbmc_project.Inventory.Item.Chassis"};
- auto respHandler = [callback{std::move(callback)}, sensorsAsyncResp](
+ auto respHandler = [callback{std::forward<Callback>(callback)},
+ sensorsAsyncResp](
const boost::system::error_code ec,
const std::vector<std::string>& chassisPaths) {
BMCWEB_LOG_DEBUG << "getChassis respHandler enter";
@@ -596,7 +598,8 @@ void getChassis(const std::shared_ptr<SensorsAsyncResp>& sensorsAsyncResp,
sdbusplus::asio::getProperty<std::vector<std::string>>(
*crow::connections::systemBus, "xyz.openbmc_project.ObjectMapper",
sensorPath, "xyz.openbmc_project.Association", "endpoints",
- [sensorsAsyncResp, callback{std::move(callback)}](
+ [sensorsAsyncResp,
+ callback{std::forward<const Callback>(callback)}](
const boost::system::error_code& e,
const std::vector<std::string>& nodeSensorList) {
if (e)
@@ -653,7 +656,7 @@ void getObjectManagerPaths(
"org.freedesktop.DBus.ObjectManager"};
// Response handler for GetSubTree DBus method
- auto respHandler = [callback{std::move(callback)},
+ auto respHandler = [callback{std::forward<Callback>(callback)},
sensorsAsyncResp](const boost::system::error_code ec,
const GetSubTreeType& subtree) {
BMCWEB_LOG_DEBUG << "getObjectManagerPaths respHandler enter";
@@ -1602,7 +1605,8 @@ static void getInventoryItemsData(
// Response handler for GetManagedObjects
auto respHandler = [sensorsAsyncResp, inventoryItems, invConnections,
- objectMgrPaths, callback{std::move(callback)},
+ objectMgrPaths,
+ callback{std::forward<Callback>(callback)},
invConnectionsIndex](
const boost::system::error_code ec,
dbus::utility::ManagedObjectType& resp) {
@@ -1691,7 +1695,8 @@ static void getInventoryItemsConnections(
"xyz.openbmc_project.State.Decorator.OperationalStatus"};
// Response handler for parsing output from GetSubTree
- auto respHandler = [callback{std::move(callback)}, sensorsAsyncResp,
+ auto respHandler = [callback{std::forward<Callback>(callback)},
+ sensorsAsyncResp,
inventoryItems](const boost::system::error_code ec,
const GetSubTreeType& subtree) {
BMCWEB_LOG_DEBUG << "getInventoryItemsConnections respHandler enter";
@@ -1773,7 +1778,8 @@ static void getInventoryItemAssociations(
BMCWEB_LOG_DEBUG << "getInventoryItemAssociations enter";
// Response handler for GetManagedObjects
- auto respHandler = [callback{std::move(callback)}, sensorsAsyncResp,
+ auto respHandler = [callback{std::forward<Callback>(callback)},
+ sensorsAsyncResp,
sensorNames](const boost::system::error_code ec,
dbus::utility::ManagedObjectType& resp) {
BMCWEB_LOG_DEBUG << "getInventoryItemAssociations respHandler enter";
@@ -1955,7 +1961,7 @@ void getInventoryLedData(
// Response handler for Get State property
auto respHandler =
[sensorsAsyncResp, inventoryItems, ledConnections, ledPath,
- callback{std::move(callback)}, ledConnectionsIndex](
+ callback{std::forward<Callback>(callback)}, ledConnectionsIndex](
const boost::system::error_code ec, const std::string& state) {
BMCWEB_LOG_DEBUG << "getInventoryLedData respHandler enter";
if (ec)
@@ -2044,7 +2050,8 @@ void getInventoryLeds(
"xyz.openbmc_project.Led.Physical"};
// Response handler for parsing output from GetSubTree
- auto respHandler = [callback{std::move(callback)}, sensorsAsyncResp,
+ auto respHandler = [callback{std::forward<Callback>(callback)},
+ sensorsAsyncResp,
inventoryItems](const boost::system::error_code ec,
const GetSubTreeType& subtree) {
BMCWEB_LOG_DEBUG << "getInventoryLeds respHandler enter";
@@ -2141,7 +2148,7 @@ void getPowerSupplyAttributesData(
// Response handler for Get DeratingFactor property
auto respHandler = [sensorsAsyncResp, inventoryItems,
- callback{std::move(callback)}](
+ callback{std::forward<Callback>(callback)}](
const boost::system::error_code ec,
const uint32_t value) {
BMCWEB_LOG_DEBUG << "getPowerSupplyAttributesData respHandler enter";
@@ -2221,7 +2228,8 @@ void getPowerSupplyAttributes(
"xyz.openbmc_project.Control.PowerSupplyAttributes"};
// Response handler for parsing output from GetSubTree
- auto respHandler = [callback{std::move(callback)}, sensorsAsyncResp,
+ auto respHandler = [callback{std::forward<Callback>(callback)},
+ sensorsAsyncResp,
inventoryItems](const boost::system::error_code ec,
const GetSubTreeType& subtree) {
BMCWEB_LOG_DEBUG << "getPowerSupplyAttributes respHandler enter";
@@ -2313,12 +2321,13 @@ static void getInventoryItems(
{
BMCWEB_LOG_DEBUG << "getInventoryItems enter";
auto getInventoryItemAssociationsCb =
- [sensorsAsyncResp, objectMgrPaths, callback{std::move(callback)}](
+ [sensorsAsyncResp, objectMgrPaths,
+ callback{std::forward<Callback>(callback)}](
std::shared_ptr<std::vector<InventoryItem>> inventoryItems) {
BMCWEB_LOG_DEBUG << "getInventoryItemAssociationsCb enter";
auto getInventoryItemsConnectionsCb =
[sensorsAsyncResp, inventoryItems, objectMgrPaths,
- callback{std::move(callback)}](
+ callback{std::forward<const Callback>(callback)}](
std::shared_ptr<boost::container::flat_set<std::string>>
invConnections) {
BMCWEB_LOG_DEBUG << "getInventoryItemsConnectionsCb enter";