Fix clang-tidy
Change-Id: Iefe1b695b86a640d8dfaafd1f77f374fa34246de
Signed-off-by: Ed Tanous <etanous@nvidia.com>
diff --git a/redfish-core/lib/redfish_util.hpp b/redfish-core/lib/redfish_util.hpp
index 117f972..966dde2 100644
--- a/redfish-core/lib/redfish_util.hpp
+++ b/redfish-core/lib/redfish_util.hpp
@@ -59,7 +59,7 @@
std::string, sdbusplus::message::object_path>;
template <typename CallbackFunc>
-void getMainChassisId(std::shared_ptr<bmcweb::AsyncResp> asyncResp,
+void getMainChassisId(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
CallbackFunc&& callback)
{
// Find managed chassis
diff --git a/redfish-core/lib/sensors.hpp b/redfish-core/lib/sensors.hpp
index 3ee36af..d8aa559 100644
--- a/redfish-core/lib/sensors.hpp
+++ b/redfish-core/lib/sensors.hpp
@@ -303,8 +303,8 @@
* @param callback Callback for processing gathered connections
*/
template <typename Callback>
-void getConnections(std::shared_ptr<SensorsAsyncResp> sensorsAsyncResp,
- const std::shared_ptr<std::set<std::string>> sensorNames,
+void getConnections(const std::shared_ptr<SensorsAsyncResp>& sensorsAsyncResp,
+ const std::shared_ptr<std::set<std::string>>& sensorNames,
Callback&& callback)
{
auto objectsWithConnectionCb =
@@ -970,10 +970,10 @@
*/
template <typename Callback>
void getInventoryItemsData(
- std::shared_ptr<SensorsAsyncResp> sensorsAsyncResp,
- std::shared_ptr<std::vector<InventoryItem>> inventoryItems,
- std::shared_ptr<std::set<std::string>> invConnections, Callback&& callback,
- size_t invConnectionsIndex = 0)
+ const std::shared_ptr<SensorsAsyncResp>& sensorsAsyncResp,
+ const std::shared_ptr<std::vector<InventoryItem>>& inventoryItems,
+ const std::shared_ptr<std::set<std::string>>& invConnections,
+ Callback&& callback, size_t invConnectionsIndex = 0)
{
BMCWEB_LOG_DEBUG("getInventoryItemsData enter");
@@ -1303,9 +1303,9 @@
*/
template <typename Callback>
void getInventoryLedData(
- std::shared_ptr<SensorsAsyncResp> sensorsAsyncResp,
- std::shared_ptr<std::vector<InventoryItem>> inventoryItems,
- std::shared_ptr<std::map<std::string, std::string>> ledConnections,
+ const std::shared_ptr<SensorsAsyncResp>& sensorsAsyncResp,
+ const std::shared_ptr<std::vector<InventoryItem>>& inventoryItems,
+ const std::shared_ptr<std::map<std::string, std::string>>& ledConnections,
Callback&& callback, size_t ledConnectionsIndex = 0)
{
BMCWEB_LOG_DEBUG("getInventoryLedData enter");
@@ -1407,8 +1407,8 @@
*/
template <typename Callback>
void getInventoryLeds(
- std::shared_ptr<SensorsAsyncResp> sensorsAsyncResp,
- std::shared_ptr<std::vector<InventoryItem>> inventoryItems,
+ const std::shared_ptr<SensorsAsyncResp>& sensorsAsyncResp,
+ const std::shared_ptr<std::vector<InventoryItem>>& inventoryItems,
Callback&& callback)
{
BMCWEB_LOG_DEBUG("getInventoryLeds enter");
@@ -1493,7 +1493,7 @@
template <typename Callback>
void getPowerSupplyAttributesData(
const std::shared_ptr<SensorsAsyncResp>& sensorsAsyncResp,
- std::shared_ptr<std::vector<InventoryItem>> inventoryItems,
+ const std::shared_ptr<std::vector<InventoryItem>>& inventoryItems,
const std::map<std::string, std::string>& psAttributesConnections,
Callback&& callback)
{
@@ -1576,8 +1576,8 @@
*/
template <typename Callback>
void getPowerSupplyAttributes(
- std::shared_ptr<SensorsAsyncResp> sensorsAsyncResp,
- std::shared_ptr<std::vector<InventoryItem>> inventoryItems,
+ const std::shared_ptr<SensorsAsyncResp>& sensorsAsyncResp,
+ const std::shared_ptr<std::vector<InventoryItem>>& inventoryItems,
Callback&& callback)
{
BMCWEB_LOG_DEBUG("getPowerSupplyAttributes enter");
@@ -1674,20 +1674,20 @@
*/
template <typename Callback>
inline void
- getInventoryItems(std::shared_ptr<SensorsAsyncResp> sensorsAsyncResp,
- const std::shared_ptr<std::set<std::string>> sensorNames,
+ getInventoryItems(const std::shared_ptr<SensorsAsyncResp>& sensorsAsyncResp,
+ const std::shared_ptr<std::set<std::string>>& sensorNames,
Callback&& callback)
{
BMCWEB_LOG_DEBUG("getInventoryItems enter");
auto getInventoryItemAssociationsCb =
[sensorsAsyncResp, callback = std::forward<Callback>(callback)](
- std::shared_ptr<std::vector<InventoryItem>>
+ const std::shared_ptr<std::vector<InventoryItem>>&
inventoryItems) mutable {
BMCWEB_LOG_DEBUG("getInventoryItemAssociationsCb enter");
auto getInventoryItemsConnectionsCb =
[sensorsAsyncResp, inventoryItems,
callback = std::forward<Callback>(callback)](
- std::shared_ptr<std::set<std::string>>
+ const std::shared_ptr<std::set<std::string>>&
invConnections) mutable {
BMCWEB_LOG_DEBUG("getInventoryItemsConnectionsCb enter");
auto getInventoryItemsDataCb =
diff --git a/redfish-core/lib/task.hpp b/redfish-core/lib/task.hpp
index 5f67cf0..80db518 100644
--- a/redfish-core/lib/task.hpp
+++ b/redfish-core/lib/task.hpp
@@ -197,7 +197,7 @@
self->messages.emplace_back(
messages::taskAborted(std::to_string(self->index)));
// Send event :TaskAborted
- self->sendTaskEvent(self->state, self->index);
+ sendTaskEvent(self->state, self->index);
self->callback(ec, msg, self);
});
}
@@ -281,7 +281,7 @@
self->finishTask();
// Send event
- self->sendTaskEvent(self->state, self->index);
+ sendTaskEvent(self->state, self->index);
// reset the match after the callback was successful
boost::asio::post(