control: Clang format updates
Used `format-code.sh` build script to make changes to conform to clang
format.
Tested: Compiled
Change-Id: Ic9d621d7c5647bde0a92c5f17938c99deeca0512
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
diff --git a/control/preconditions.cpp b/control/preconditions.cpp
index cd404d1..09284a8 100644
--- a/control/preconditions.cpp
+++ b/control/preconditions.cpp
@@ -1,8 +1,11 @@
-#include <algorithm>
-#include <phosphor-logging/log.hpp>
#include "preconditions.hpp"
+
#include "zone.hpp"
+#include <phosphor-logging/log.hpp>
+
+#include <algorithm>
+
namespace phosphor
{
namespace fan
@@ -13,26 +16,22 @@
{
using namespace phosphor::fan;
+using namespace phosphor::logging;
Action property_states_match(std::vector<PrecondGroup>&& pg,
std::vector<SetSpeedEvent>&& sse)
{
- return [pg = std::move(pg),
- sse = std::move(sse)](auto& zone, auto& group)
- {
+ return [pg = std::move(pg), sse = std::move(sse)](auto& zone, auto& group) {
// Compare given precondition entries
- auto precondState = std::all_of(
- pg.begin(),
- pg.end(),
- [&zone](auto const& entry)
- {
+ auto precondState =
+ std::all_of(pg.begin(), pg.end(), [&zone](auto const& entry) {
try
{
return zone.getPropValueVariant(
- std::get<pcPathPos>(entry),
- std::get<pcIntfPos>(entry),
- std::get<pcPropPos>(entry)) ==
- std::get<pcValuePos>(entry);
+ std::get<pcPathPos>(entry),
+ std::get<pcIntfPos>(entry),
+ std::get<pcPropPos>(entry)) ==
+ std::get<pcValuePos>(entry);
}
catch (const std::out_of_range& oore)
{
@@ -47,13 +46,9 @@
"Preconditions passed, init the associated events",
entry("EVENT_COUNT=%u", sse.size()));
// Init the events when all the precondition(s) are true
- std::for_each(
- sse.begin(),
- sse.end(),
- [&zone](auto const& entry)
- {
- zone.initEvent(entry);
- });
+ std::for_each(sse.begin(), sse.end(), [&zone](auto const& entry) {
+ zone.initEvent(entry);
+ });
}
else
{
@@ -61,13 +56,9 @@
"Preconditions not met for events, events removed if present",
entry("EVENT_COUNT=%u", sse.size()));
// Unsubscribe the events' signals when any precondition is false
- std::for_each(
- sse.begin(),
- sse.end(),
- [&zone](auto const& entry)
- {
- zone.removeEvent(entry);
- });
+ std::for_each(sse.begin(), sse.end(), [&zone](auto const& entry) {
+ zone.removeEvent(entry);
+ });
zone.setFullSpeed();
}
// Update group's fan control active allowed
@@ -77,40 +68,28 @@
Action services_missing_owner(std::vector<SetSpeedEvent>&& sse)
{
- return [sse = std::move(sse)](auto& zone, auto& group)
- {
+ return [sse = std::move(sse)](auto& zone, auto& group) {
// Set/update the services of the group
zone.setServices(&group);
const auto& services = zone.getGroupServices(&group);
- auto precondState = std::any_of(
- services.begin(),
- services.end(),
- [](const auto& s)
- {
+ auto precondState =
+ std::any_of(services.begin(), services.end(), [](const auto& s) {
return !std::get<hasOwnerPos>(s);
});
if (precondState)
{
// Init the events when all the precondition(s) are true
- std::for_each(
- sse.begin(),
- sse.end(),
- [&zone](auto const& entry)
- {
- zone.initEvent(entry);
- });
+ std::for_each(sse.begin(), sse.end(), [&zone](auto const& entry) {
+ zone.initEvent(entry);
+ });
}
else
{
// Unsubscribe the events' signals when any precondition is false
- std::for_each(
- sse.begin(),
- sse.end(),
- [&zone](auto const& entry)
- {
- zone.removeEvent(entry);
- });
+ std::for_each(sse.begin(), sse.end(), [&zone](auto const& entry) {
+ zone.removeEvent(entry);
+ });
}
};
}