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/manager.cpp b/control/manager.cpp
index 360239c..543d42f 100644
--- a/control/manager.cpp
+++ b/control/manager.cpp
@@ -13,18 +13,23 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+#include "config.h"
+
+#include "manager.hpp"
+
+#include "sdbusplus.hpp"
+#include "utility.hpp"
+
+#include <unistd.h>
+
+#include <phosphor-logging/elog-errors.hpp>
+#include <phosphor-logging/elog.hpp>
+#include <phosphor-logging/log.hpp>
+#include <sdbusplus/bus.hpp>
+#include <xyz/openbmc_project/Common/error.hpp>
+
#include <algorithm>
#include <experimental/filesystem>
-#include <sdbusplus/bus.hpp>
-#include <phosphor-logging/log.hpp>
-#include <phosphor-logging/elog.hpp>
-#include <phosphor-logging/elog-errors.hpp>
-#include <xyz/openbmc_project/Common/error.hpp>
-#include <unistd.h>
-#include "config.h"
-#include "manager.hpp"
-#include "utility.hpp"
-#include "sdbusplus.hpp"
namespace phosphor
{
@@ -36,8 +41,8 @@
using namespace phosphor::logging;
namespace fs = std::experimental::filesystem;
-constexpr auto SYSTEMD_SERVICE = "org.freedesktop.systemd1";
-constexpr auto SYSTEMD_OBJ_PATH = "/org/freedesktop/systemd1";
+constexpr auto SYSTEMD_SERVICE = "org.freedesktop.systemd1";
+constexpr auto SYSTEMD_OBJ_PATH = "/org/freedesktop/systemd1";
constexpr auto SYSTEMD_INTERFACE = "org.freedesktop.systemd1.Manager";
constexpr auto FAN_CONTROL_READY_TARGET = "obmc-fan-control-ready@0.target";
@@ -62,10 +67,9 @@
if (type.compare("getProperty") == 0)
{
auto propertyValue = util::SDBusPlus::getProperty<decltype(value)>(
- bus,
- std::get<propertyPathPos>(p),
- std::get<propertyInterfacePos>(p),
- std::get<propertyNamePos>(p));
+ bus, std::get<propertyPathPos>(p),
+ std::get<propertyInterfacePos>(p),
+ std::get<propertyNamePos>(p));
if (value != propertyValue)
{
@@ -76,29 +80,26 @@
return true;
}
-
-//Note: Future code will check 'mode' before starting control algorithm
-Manager::Manager(sdbusplus::bus::bus& bus,
- const sdeventplus::Event& event,
+// Note: Future code will check 'mode' before starting control algorithm
+Manager::Manager(sdbusplus::bus::bus& bus, const sdeventplus::Event& event,
Mode mode) :
_bus(bus),
_objMgr(bus, CONTROL_OBJPATH)
{
- //Create the appropriate Zone objects based on the
- //actual system configuration.
+ // Create the appropriate Zone objects based on the
+ // actual system configuration.
- //Find the 1 ZoneGroup that meets all of its conditions
+ // Find the 1 ZoneGroup that meets all of its conditions
for (auto& group : _zoneLayouts)
{
auto& conditions = std::get<conditionListPos>(group);
if (std::all_of(conditions.begin(), conditions.end(),
- [&bus](const auto& condition)
+ [&bus](const auto& condition) {
+ return checkCondition(bus, condition);
+ }))
{
- return checkCondition(bus, condition);
- }))
- {
- //Create a Zone object for each zone in this group
+ // Create a Zone object for each zone in this group
auto& zones = std::get<zoneListPos>(group);
for (auto& z : zones)
@@ -106,11 +107,8 @@
fs::path path{CONTROL_OBJPATH};
path /= std::to_string(std::get<zoneNumPos>(z));
_zones.emplace(std::get<zoneNumPos>(z),
- std::make_unique<Zone>(mode,
- _bus,
- path.string(),
- event,
- z));
+ std::make_unique<Zone>(mode, _bus, path.string(),
+ event, z));
}
break;
@@ -123,7 +121,6 @@
}
}
-
void Manager::doInit()
{
for (auto& z : _zones)
@@ -137,14 +134,9 @@
delay = sleep(delay);
}
- util::SDBusPlus::callMethod(
- _bus,
- SYSTEMD_SERVICE,
- SYSTEMD_OBJ_PATH,
- SYSTEMD_INTERFACE,
- "StartUnit",
- FAN_CONTROL_READY_TARGET,
- "replace");
+ util::SDBusPlus::callMethod(_bus, SYSTEMD_SERVICE, SYSTEMD_OBJ_PATH,
+ SYSTEMD_INTERFACE, "StartUnit",
+ FAN_CONTROL_READY_TARGET, "replace");
}
} // namespace control