psusensor: Formatting cleanup Formatting issues are causing errors in the CI. Cleaning them up here. Change-Id: I7ae134a14f783629aead1c6b5b0d76c539539aa9 Signed-off-by: Matt Simmering <matthew.simmering@intel.com>
diff --git a/src/PSUSensorMain.cpp b/src/PSUSensorMain.cpp index ad01a3e..b5af176 100644 --- a/src/PSUSensorMain.cpp +++ b/src/PSUSensorMain.cpp
@@ -400,8 +400,10 @@ continue; } - const uint64_t* confBus = std::get_if<uint64_t>(&(configBus->second)); - const uint64_t* confAddr = std::get_if<uint64_t>(&(configAddress->second)); + const uint64_t* confBus = + std::get_if<uint64_t>(&(configBus->second)); + const uint64_t* confAddr = + std::get_if<uint64_t>(&(configAddress->second)); if (confBus == nullptr || confAddr == nullptr) { std::cerr @@ -442,7 +444,8 @@ << deviceName << "\n"; continue; } - const std::string* psuName = std::get_if<std::string>(&(findPSUName->second)); + const std::string* psuName = + std::get_if<std::string>(&(findPSUName->second)); if (psuName == nullptr) { std::cerr << "Cannot find psu name, invalid configuration\n"; @@ -456,8 +459,8 @@ auto it = std::find_if(sensorsChanged->begin(), sensorsChanged->end(), [psuNameStr](std::string& s) { - return s.ends_with(psuNameStr); - }); + return s.ends_with(psuNameStr); + }); if (it == sensorsChanged->end()) { @@ -906,7 +909,7 @@ { std::cerr << "Created total of " << numCreated << " sensors\n"; } - } +} void createSensors( boost::asio::io_service& io, sdbusplus::asio::object_server& objectServer, @@ -1021,8 +1024,10 @@ {"fan3", PSUProperty("Fan Speed 3", 30000, 0, 0, 0)}, {"fan4", PSUProperty("Fan Speed 4", 30000, 0, 0, 0)}}; - pwmTable = {{"fan1", "Fan_1"}, {"fan2", "Fan_2"}, - {"fan3", "Fan_3"}, {"fan4", "Fan_4"}}; + pwmTable = {{"fan1", "Fan_1"}, + {"fan2", "Fan_2"}, + {"fan3", "Fan_3"}, + {"fan4", "Fan_4"}}; limitEventMatch = {{"PredictiveFailure", {"max_alarm", "min_alarm"}}, {"Failure", {"crit_alarm", "lcrit_alarm"}}}; @@ -1057,25 +1062,25 @@ boost::asio::steady_timer filterTimer(io); std::function<void(sdbusplus::message_t&)> eventHandler = [&](sdbusplus::message_t& message) { - if (message.is_method_error()) + if (message.is_method_error()) + { + std::cerr << "callback method error\n"; + return; + } + sensorsChanged->insert(message.get_path()); + filterTimer.expires_from_now(std::chrono::seconds(3)); + filterTimer.async_wait([&](const boost::system::error_code& ec) { + if (ec == boost::asio::error::operation_aborted) { - std::cerr << "callback method error\n"; return; } - sensorsChanged->insert(message.get_path()); - filterTimer.expires_from_now(std::chrono::seconds(3)); - filterTimer.async_wait([&](const boost::system::error_code& ec) { - if (ec == boost::asio::error::operation_aborted) - { - return; - } - if (ec) - { - std::cerr << "timer error\n"; - } - createSensors(io, objectServer, systemBus, sensorsChanged); - }); - }; + if (ec) + { + std::cerr << "timer error\n"; + } + createSensors(io, objectServer, systemBus, sensorsChanged); + }); + }; std::vector<std::unique_ptr<sdbusplus::bus::match_t>> matches = setupPropertiesChangedMatches(*systemBus, sensorTypes, eventHandler);