diff options
author | Ed Tanous <edtanous@google.com> | 2022-01-25 21:28:56 +0300 |
---|---|---|
committer | Ed Tanous <ed@tanous.net> | 2022-02-11 23:30:05 +0300 |
commit | e05aec50f10116e6dda7e377bc61799aa5b7c166 (patch) | |
tree | 964aedffefcc787029c571a83889247caa0d3968 /redfish-core/lib/sensors.hpp | |
parent | 213ffc701d838bece5893cda23475e7518bd6955 (diff) | |
download | bmcweb-e05aec50f10116e6dda7e377bc61799aa5b7c166.tar.xz |
Add readability-redundant-* checks
There's a number of redundancies in our code that clang can sanitize
out. Fix the existing problems, and enable the checks.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Ie63d7b7f0777b702fbf1b23a24e1bed7b4f5183b
Diffstat (limited to 'redfish-core/lib/sensors.hpp')
-rw-r--r-- | redfish-core/lib/sensors.hpp | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/redfish-core/lib/sensors.hpp b/redfish-core/lib/sensors.hpp index f3fa52c6fe..4d4b4cce27 100644 --- a/redfish-core/lib/sensors.hpp +++ b/redfish-core/lib/sensors.hpp @@ -284,11 +284,7 @@ enum class LedState class InventoryItem { public: - InventoryItem(const std::string& objPath) : - objectPath(objPath), name(), isPresent(true), isFunctional(true), - isPowerSupply(false), powerSupplyEfficiencyPercent(-1), manufacturer(), - model(), partNumber(), serialNumber(), sensors(), ledObjectPath(""), - ledState(LedState::UNKNOWN) + InventoryItem(const std::string& objPath) : objectPath(objPath) { // Set inventory item name to last node of object path sdbusplus::message::object_path path(objectPath); @@ -301,17 +297,17 @@ class InventoryItem std::string objectPath; std::string name; - bool isPresent; - bool isFunctional; - bool isPowerSupply; - int powerSupplyEfficiencyPercent; + bool isPresent = true; + bool isFunctional = true; + bool isPowerSupply = false; + int powerSupplyEfficiencyPercent = -1; std::string manufacturer; std::string model; std::string partNumber; std::string serialNumber; std::set<std::string> sensors; std::string ledObjectPath; - LedState ledState; + LedState ledState = LedState::UNKNOWN; }; /** |