clang-format: re-format for clang-18
clang-format-18 isn't compatible with the clang-format-17 output, so we
need to reformat the code with the latest version. The way clang-18
handles lambda formatting also changed, so we have made changes to the
organization default style format to better handle lambda formatting.
See I5e08687e696dd240402a2780158664b7113def0e for updated style.
See Iea0776aaa7edd483fa395e23de25ebf5a6288f71 for clang-18 enablement.
Change-Id: I7b90380845efee6bf6a1fe342a793d71aa9ff181
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/.clang-format b/.clang-format
index d43e884..28e3328 100644
--- a/.clang-format
+++ b/.clang-format
@@ -87,7 +87,7 @@
IndentWrappedFunctionNames: true
InsertNewlineAtEOF: true
KeepEmptyLinesAtTheStartOfBlocks: false
-LambdaBodyIndentation: OuterScope
+LambdaBodyIndentation: Signature
LineEnding: LF
MacroBlockBegin: ''
MacroBlockEnd: ''
@@ -98,13 +98,14 @@
ObjCSpaceBeforeProtocolList: true
PackConstructorInitializers: BinPack
PenaltyBreakAssignment: 25
-PenaltyBreakBeforeFirstCallParameter: 19
+PenaltyBreakBeforeFirstCallParameter: 50
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
+PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
-PenaltyIndentedWhitespace: 0
+PenaltyIndentedWhitespace: 1
PointerAlignment: Left
QualifierAlignment: Left
ReferenceAlignment: Left
diff --git a/cold-redundancy/cold_redundancy.cpp b/cold-redundancy/cold_redundancy.cpp
index d13b330..c1ebc44 100644
--- a/cold-redundancy/cold_redundancy.cpp
+++ b/cold-redundancy/cold_redundancy.cpp
@@ -44,93 +44,92 @@
ColdRedundancy::ColdRedundancy(
boost::asio::io_service& io, sdbusplus::asio::object_server& objectServer,
std::shared_ptr<sdbusplus::asio::connection>& systemBus) :
- filterTimer(io),
- systemBus(systemBus)
+ filterTimer(io), systemBus(systemBus)
{
post(io,
[this, &io, &objectServer, &systemBus]() { createPSU(systemBus); });
std::function<void(sdbusplus::message_t&)> eventHandler =
[this, &io, &objectServer, &systemBus](sdbusplus::message_t& message) {
- if (message.is_method_error())
- {
- std::cerr << "callback method error\n";
- return;
- }
- filterTimer.expires_after(std::chrono::seconds(1));
- filterTimer.async_wait([this, &io, &objectServer, &systemBus](
- const boost::system::error_code& ec) {
- if (ec == boost::asio::error::operation_aborted)
+ if (message.is_method_error())
{
+ std::cerr << "callback method error\n";
return;
}
- else if (ec)
- {
- std::cerr << "timer error\n";
- }
- createPSU(systemBus);
- });
- };
+ filterTimer.expires_after(std::chrono::seconds(1));
+ filterTimer.async_wait([this, &io, &objectServer, &systemBus](
+ const boost::system::error_code& ec) {
+ if (ec == boost::asio::error::operation_aborted)
+ {
+ return;
+ }
+ else if (ec)
+ {
+ std::cerr << "timer error\n";
+ }
+ createPSU(systemBus);
+ });
+ };
std::function<void(sdbusplus::message_t&)> eventCollect =
[&](sdbusplus::message_t& message) {
- std::string objectName;
- boost::container::flat_map<std::string, std::variant<bool>> values;
- std::string path = message.get_path();
- std::size_t slantingPos = path.find_last_of("/\\");
- if ((slantingPos == std::string::npos) ||
- ((slantingPos + 1) >= path.size()))
- {
- std::cerr << "Unable to get PSU state name from path\n";
- return;
- }
- std::string statePSUName = path.substr(slantingPos + 1);
-
- std::size_t hypenPos = statePSUName.find("_");
- if (hypenPos == std::string::npos)
- {
- std::cerr << "Unable to get PSU name from PSU path\n";
- return;
- }
- std::string psuName = statePSUName.substr(0, hypenPos);
-
- try
- {
- message.read(objectName, values);
- }
- catch (const sdbusplus::exception_t& e)
- {
- std::cerr << "Failed to read message from PSU Event\n";
- return;
- }
-
- for (auto& psu : powerSupplies)
- {
- if (psu->name != psuName)
+ std::string objectName;
+ boost::container::flat_map<std::string, std::variant<bool>> values;
+ std::string path = message.get_path();
+ std::size_t slantingPos = path.find_last_of("/\\");
+ if ((slantingPos == std::string::npos) ||
+ ((slantingPos + 1) >= path.size()))
{
- continue;
+ std::cerr << "Unable to get PSU state name from path\n";
+ return;
+ }
+ std::string statePSUName = path.substr(slantingPos + 1);
+
+ std::size_t hypenPos = statePSUName.find("_");
+ if (hypenPos == std::string::npos)
+ {
+ std::cerr << "Unable to get PSU name from PSU path\n";
+ return;
+ }
+ std::string psuName = statePSUName.substr(0, hypenPos);
+
+ try
+ {
+ message.read(objectName, values);
+ }
+ catch (const sdbusplus::exception_t& e)
+ {
+ std::cerr << "Failed to read message from PSU Event\n";
+ return;
}
- std::string psuEventName = "functional";
- auto findEvent = values.find(psuEventName);
- if (findEvent != values.end())
+ for (auto& psu : powerSupplies)
{
- bool* functional = std::get_if<bool>(&(findEvent->second));
- if (functional == nullptr)
+ if (psu->name != psuName)
{
- std::cerr << "Unable to get valid functional status\n";
continue;
}
- if (*functional)
+
+ std::string psuEventName = "functional";
+ auto findEvent = values.find(psuEventName);
+ if (findEvent != values.end())
{
- psu->state = CR::PSUState::normal;
- }
- else
- {
- psu->state = CR::PSUState::acLost;
+ bool* functional = std::get_if<bool>(&(findEvent->second));
+ if (functional == nullptr)
+ {
+ std::cerr << "Unable to get valid functional status\n";
+ continue;
+ }
+ if (*functional)
+ {
+ psu->state = CR::PSUState::normal;
+ }
+ else
+ {
+ psu->state = CR::PSUState::acLost;
+ }
}
}
- }
- };
+ };
using namespace sdbusplus::bus::match::rules;
for (const char* type : psuInterfaceTypes)
@@ -167,95 +166,100 @@
conn->async_method_call(
[this, &conn](const boost::system::error_code ec,
CR::GetSubTreeType subtree) {
- if (ec)
- {
- std::cerr << "Exception happened when communicating to "
- "ObjectMapper\n";
- return;
- }
- for (const auto& object : subtree)
- {
- std::string pathName = object.first;
- for (const auto& serviceIface : object.second)
+ if (ec)
{
- std::string serviceName = serviceIface.first;
- for (const auto& interface : serviceIface.second)
+ std::cerr << "Exception happened when communicating to "
+ "ObjectMapper\n";
+ return;
+ }
+ for (const auto& object : subtree)
+ {
+ std::string pathName = object.first;
+ for (const auto& serviceIface : object.second)
{
- // only get property of matched interface
- bool isIfaceMatched = false;
- for (const auto& type : psuInterfaceTypes)
+ std::string serviceName = serviceIface.first;
+ for (const auto& interface : serviceIface.second)
{
- if (type == interface)
+ // only get property of matched interface
+ bool isIfaceMatched = false;
+ for (const auto& type : psuInterfaceTypes)
{
- isIfaceMatched = true;
- break;
- }
- }
- if (!isIfaceMatched)
- continue;
-
- conn->async_method_call(
- [this, &conn,
- interface](const boost::system::error_code ec,
- CR::PropertyMapType propMap) {
- if (ec)
- {
- std::cerr << "Exception happened when get all "
- "properties\n";
- return;
- }
-
- auto configName =
- std::get_if<std::string>(&propMap["Name"]);
- if (configName == nullptr)
- {
- std::cerr << "error finding necessary "
- "entry in configuration\n";
- return;
- }
-
- auto configBus = std::get_if<uint64_t>(&propMap["Bus"]);
- auto configAddress =
- std::get_if<uint64_t>(&propMap["Address"]);
-
- if (configBus == nullptr || configAddress == nullptr)
- {
- std::cerr << "error finding necessary "
- "entry in configuration\n";
- return;
- }
- for (auto& psu : powerSupplies)
- {
- if ((static_cast<uint8_t>(*configBus) ==
- psu->bus) &&
- (static_cast<uint8_t>(*configAddress) ==
- psu->address))
+ if (type == interface)
{
- return;
+ isIfaceMatched = true;
+ break;
}
}
+ if (!isIfaceMatched)
+ continue;
- uint8_t order = 0;
+ conn->async_method_call(
+ [this, &conn,
+ interface](const boost::system::error_code ec,
+ CR::PropertyMapType propMap) {
+ if (ec)
+ {
+ std::cerr
+ << "Exception happened when get all "
+ "properties\n";
+ return;
+ }
- powerSupplies.emplace_back(
- std::make_unique<PowerSupply>(
- *configName, static_cast<uint8_t>(*configBus),
- static_cast<uint8_t>(*configAddress), order,
- conn));
+ auto configName =
+ std::get_if<std::string>(&propMap["Name"]);
+ if (configName == nullptr)
+ {
+ std::cerr << "error finding necessary "
+ "entry in configuration\n";
+ return;
+ }
- numberOfPSU++;
- std::vector<uint8_t> orders = {};
- for (auto& psu : powerSupplies)
- {
- orders.push_back(psu->order);
- }
- },
- serviceName.c_str(), pathName.c_str(),
- "org.freedesktop.DBus.Properties", "GetAll", interface);
+ auto configBus =
+ std::get_if<uint64_t>(&propMap["Bus"]);
+ auto configAddress =
+ std::get_if<uint64_t>(&propMap["Address"]);
+
+ if (configBus == nullptr ||
+ configAddress == nullptr)
+ {
+ std::cerr << "error finding necessary "
+ "entry in configuration\n";
+ return;
+ }
+ for (auto& psu : powerSupplies)
+ {
+ if ((static_cast<uint8_t>(*configBus) ==
+ psu->bus) &&
+ (static_cast<uint8_t>(*configAddress) ==
+ psu->address))
+ {
+ return;
+ }
+ }
+
+ uint8_t order = 0;
+
+ powerSupplies.emplace_back(
+ std::make_unique<PowerSupply>(
+ *configName,
+ static_cast<uint8_t>(*configBus),
+ static_cast<uint8_t>(*configAddress),
+ order, conn));
+
+ numberOfPSU++;
+ std::vector<uint8_t> orders = {};
+ for (auto& psu : powerSupplies)
+ {
+ orders.push_back(psu->order);
+ }
+ },
+ serviceName.c_str(), pathName.c_str(),
+ "org.freedesktop.DBus.Properties", "GetAll",
+ interface);
+ }
}
}
- }
- },
+ },
"xyz.openbmc_project.ObjectMapper",
"/xyz/openbmc_project/object_mapper",
"xyz.openbmc_project.ObjectMapper", "GetSubTree",
@@ -265,8 +269,7 @@
PowerSupply::PowerSupply(
std::string& name, uint8_t bus, uint8_t address, uint8_t order,
const std::shared_ptr<sdbusplus::asio::connection>& dbusConnection) :
- name(name),
- bus(bus), address(address), order(order)
+ name(name), bus(bus), address(address), order(order)
{
CR::getPSUEvent(dbusConnection, name, state);
}
diff --git a/compatible_system_types_finder.cpp b/compatible_system_types_finder.cpp
index 98db28b..d102eda 100644
--- a/compatible_system_types_finder.cpp
+++ b/compatible_system_types_finder.cpp
@@ -69,8 +69,8 @@
// If all the compatible names are system or chassis types
std::regex pattern{"\\.(system|chassis)\\.", std::regex::icase};
if (std::ranges::all_of(names, [&pattern](auto&& name) {
- return std::regex_search(name, pattern);
- }))
+ return std::regex_search(name, pattern);
+ }))
{
// Call callback with compatible system type names
callback(names);
diff --git a/dbus_interfaces_finder.cpp b/dbus_interfaces_finder.cpp
index 31e5023..1e9cb77 100644
--- a/dbus_interfaces_finder.cpp
+++ b/dbus_interfaces_finder.cpp
@@ -27,8 +27,8 @@
DBusInterfacesFinder::DBusInterfacesFinder(
sdbusplus::bus_t& bus, const std::string& service,
const std::vector<std::string>& interfaces, Callback callback) :
- bus{bus},
- service{service}, interfaces{interfaces}, callback{std::move(callback)},
+ bus{bus}, service{service}, interfaces{interfaces},
+ callback{std::move(callback)},
match{bus,
sdbusplus::bus::match::rules::interfacesAdded() +
sdbusplus::bus::match::rules::sender(service),
diff --git a/dbus_interfaces_finder.hpp b/dbus_interfaces_finder.hpp
index b74e88d..8e99ee8 100644
--- a/dbus_interfaces_finder.hpp
+++ b/dbus_interfaces_finder.hpp
@@ -86,10 +86,9 @@
* @param callback Callback function that is called each time an interface
* instance is found
*/
- explicit DBusInterfacesFinder(sdbusplus::bus_t& bus,
- const std::string& service,
- const std::vector<std::string>& interfaces,
- Callback callback);
+ explicit DBusInterfacesFinder(
+ sdbusplus::bus_t& bus, const std::string& service,
+ const std::vector<std::string>& interfaces, Callback callback);
/**
* Refind all instances of the interfaces specified in the constructor.
diff --git a/elog-errors.hpp b/elog-errors.hpp
index 269587e..6632a27 100644
--- a/elog-errors.hpp
+++ b/elog-errors.hpp
@@ -1460,7 +1460,7 @@
*/
static constexpr auto str_short = "RAIL";
using type = std::tuple<std::decay_t<decltype("RAIL=%d")>, uint16_t>;
- explicit constexpr RAIL(uint16_t a) : _entry(entry("RAIL=%d", a)){};
+ explicit constexpr RAIL(uint16_t a) : _entry(entry("RAIL=%d", a)) {};
type _entry;
};
struct RAIL_NAME
@@ -1474,7 +1474,7 @@
using type =
std::tuple<std::decay_t<decltype("RAIL_NAME=%s")>, const char*>;
explicit constexpr RAIL_NAME(const char* a) :
- _entry(entry("RAIL_NAME=%s", a)){};
+ _entry(entry("RAIL_NAME=%s", a)) {};
type _entry;
};
struct RAW_STATUS
@@ -1488,7 +1488,7 @@
using type =
std::tuple<std::decay_t<decltype("RAW_STATUS=%s")>, const char*>;
explicit constexpr RAW_STATUS(const char* a) :
- _entry(entry("RAW_STATUS=%s", a)){};
+ _entry(entry("RAW_STATUS=%s", a)) {};
type _entry;
};
} // namespace _PowerSequencerVoltageFault
@@ -1538,7 +1538,7 @@
static constexpr auto str_short = "INPUT_NUM";
using type = std::tuple<std::decay_t<decltype("INPUT_NUM=%d")>, uint16_t>;
explicit constexpr INPUT_NUM(uint16_t a) :
- _entry(entry("INPUT_NUM=%d", a)){};
+ _entry(entry("INPUT_NUM=%d", a)) {};
type _entry;
};
struct INPUT_NAME
@@ -1552,7 +1552,7 @@
using type =
std::tuple<std::decay_t<decltype("INPUT_NAME=%s")>, const char*>;
explicit constexpr INPUT_NAME(const char* a) :
- _entry(entry("INPUT_NAME=%s", a)){};
+ _entry(entry("INPUT_NAME=%s", a)) {};
type _entry;
};
struct RAW_STATUS
@@ -1566,7 +1566,7 @@
using type =
std::tuple<std::decay_t<decltype("RAW_STATUS=%s")>, const char*>;
explicit constexpr RAW_STATUS(const char* a) :
- _entry(entry("RAW_STATUS=%s", a)){};
+ _entry(entry("RAW_STATUS=%s", a)) {};
type _entry;
};
} // namespace _PowerSequencerPGOODFault
@@ -1617,7 +1617,7 @@
using type =
std::tuple<std::decay_t<decltype("RAW_STATUS=%s")>, const char*>;
explicit constexpr RAW_STATUS(const char* a) :
- _entry(entry("RAW_STATUS=%s", a)){};
+ _entry(entry("RAW_STATUS=%s", a)) {};
type _entry;
};
} // namespace _PowerSequencerFault
@@ -1666,7 +1666,7 @@
using type =
std::tuple<std::decay_t<decltype("CALLOUT_ERRNO=%d")>, int32_t>;
explicit constexpr CALLOUT_ERRNO(int32_t a) :
- _entry(entry("CALLOUT_ERRNO=%d", a)){};
+ _entry(entry("CALLOUT_ERRNO=%d", a)) {};
type _entry;
};
struct CALLOUT_DEVICE_PATH
@@ -1680,7 +1680,7 @@
using type = std::tuple<std::decay_t<decltype("CALLOUT_DEVICE_PATH=%s")>,
const char*>;
explicit constexpr CALLOUT_DEVICE_PATH(const char* a) :
- _entry(entry("CALLOUT_DEVICE_PATH=%s", a)){};
+ _entry(entry("CALLOUT_DEVICE_PATH=%s", a)) {};
type _entry;
};
} // namespace _Device
@@ -1729,7 +1729,7 @@
using type =
std::tuple<std::decay_t<decltype("CALLOUT_GPIO_NUM=%u")>, uint32_t>;
explicit constexpr CALLOUT_GPIO_NUM(uint32_t a) :
- _entry(entry("CALLOUT_GPIO_NUM=%u", a)){};
+ _entry(entry("CALLOUT_GPIO_NUM=%u", a)) {};
type _entry;
};
} // namespace _GPIO
@@ -1781,7 +1781,7 @@
using type =
std::tuple<std::decay_t<decltype("CALLOUT_IIC_BUS=%s")>, const char*>;
explicit constexpr CALLOUT_IIC_BUS(const char* a) :
- _entry(entry("CALLOUT_IIC_BUS=%s", a)){};
+ _entry(entry("CALLOUT_IIC_BUS=%s", a)) {};
type _entry;
};
struct CALLOUT_IIC_ADDR
@@ -1795,7 +1795,7 @@
using type =
std::tuple<std::decay_t<decltype("CALLOUT_IIC_ADDR=0x%hx")>, uint16_t>;
explicit constexpr CALLOUT_IIC_ADDR(uint16_t a) :
- _entry(entry("CALLOUT_IIC_ADDR=0x%hx", a)){};
+ _entry(entry("CALLOUT_IIC_ADDR=0x%hx", a)) {};
type _entry;
};
} // namespace _IIC
@@ -1848,7 +1848,7 @@
using type = std::tuple<std::decay_t<decltype("CALLOUT_INVENTORY_PATH=%s")>,
const char*>;
explicit constexpr CALLOUT_INVENTORY_PATH(const char* a) :
- _entry(entry("CALLOUT_INVENTORY_PATH=%s", a)){};
+ _entry(entry("CALLOUT_INVENTORY_PATH=%s", a)) {};
type _entry;
};
} // namespace _Inventory
@@ -1898,7 +1898,7 @@
std::tuple<std::decay_t<decltype("CALLOUT_IPMI_SENSOR_NUM=%u")>,
uint32_t>;
explicit constexpr CALLOUT_IPMI_SENSOR_NUM(uint32_t a) :
- _entry(entry("CALLOUT_IPMI_SENSOR_NUM=%u", a)){};
+ _entry(entry("CALLOUT_IPMI_SENSOR_NUM=%u", a)) {};
type _entry;
};
} // namespace _IPMISensor
@@ -1947,7 +1947,7 @@
using type =
std::tuple<std::decay_t<decltype("RAW_STATUS=%s")>, const char*>;
explicit constexpr RAW_STATUS(const char* a) :
- _entry(entry("RAW_STATUS=%s", a)){};
+ _entry(entry("RAW_STATUS=%s", a)) {};
type _entry;
};
} // namespace _PowerSupplyInputFault
@@ -1998,7 +1998,7 @@
using type =
std::tuple<std::decay_t<decltype("RAW_STATUS=%s")>, const char*>;
explicit constexpr RAW_STATUS(const char* a) :
- _entry(entry("RAW_STATUS=%s", a)){};
+ _entry(entry("RAW_STATUS=%s", a)) {};
type _entry;
};
} // namespace _PowerSupplyShouldBeOn
@@ -2049,7 +2049,7 @@
using type =
std::tuple<std::decay_t<decltype("RAW_STATUS=%s")>, const char*>;
explicit constexpr RAW_STATUS(const char* a) :
- _entry(entry("RAW_STATUS=%s", a)){};
+ _entry(entry("RAW_STATUS=%s", a)) {};
type _entry;
};
} // namespace _PowerSupplyOutputOvercurrent
@@ -2100,7 +2100,7 @@
using type =
std::tuple<std::decay_t<decltype("RAW_STATUS=%s")>, const char*>;
explicit constexpr RAW_STATUS(const char* a) :
- _entry(entry("RAW_STATUS=%s", a)){};
+ _entry(entry("RAW_STATUS=%s", a)) {};
type _entry;
};
} // namespace _PowerSupplyOutputOvervoltage
@@ -2151,7 +2151,7 @@
using type =
std::tuple<std::decay_t<decltype("RAW_STATUS=%s")>, const char*>;
explicit constexpr RAW_STATUS(const char* a) :
- _entry(entry("RAW_STATUS=%s", a)){};
+ _entry(entry("RAW_STATUS=%s", a)) {};
type _entry;
};
} // namespace _PowerSupplyFanFault
@@ -2202,7 +2202,7 @@
using type =
std::tuple<std::decay_t<decltype("RAW_STATUS=%s")>, const char*>;
explicit constexpr RAW_STATUS(const char* a) :
- _entry(entry("RAW_STATUS=%s", a)){};
+ _entry(entry("RAW_STATUS=%s", a)) {};
type _entry;
};
} // namespace _PowerSupplyTemperatureFault
@@ -2253,7 +2253,7 @@
using type =
std::tuple<std::decay_t<decltype("RAW_STATUS=%s")>, const char*>;
explicit constexpr RAW_STATUS(const char* a) :
- _entry(entry("RAW_STATUS=%s", a)){};
+ _entry(entry("RAW_STATUS=%s", a)) {};
type _entry;
};
} // namespace _GPUPowerFault
@@ -2304,7 +2304,7 @@
using type =
std::tuple<std::decay_t<decltype("RAW_STATUS=%s")>, const char*>;
explicit constexpr RAW_STATUS(const char* a) :
- _entry(entry("RAW_STATUS=%s", a)){};
+ _entry(entry("RAW_STATUS=%s", a)) {};
type _entry;
};
} // namespace _GPUOverTemp
@@ -2355,7 +2355,7 @@
using type =
std::tuple<std::decay_t<decltype("RAW_STATUS=%s")>, const char*>;
explicit constexpr RAW_STATUS(const char* a) :
- _entry(entry("RAW_STATUS=%s", a)){};
+ _entry(entry("RAW_STATUS=%s", a)) {};
type _entry;
};
} // namespace _MemoryPowerFault
diff --git a/phosphor-power-sequencer/src/device_finder.cpp b/phosphor-power-sequencer/src/device_finder.cpp
index 343b5e5..f01bc8e 100644
--- a/phosphor-power-sequencer/src/device_finder.cpp
+++ b/phosphor-power-sequencer/src/device_finder.cpp
@@ -77,9 +77,8 @@
}
}
-const DbusVariant&
- DeviceFinder::getPropertyValue(const DbusPropertyMap& properties,
- const std::string& propertyName)
+const DbusVariant& DeviceFinder::getPropertyValue(
+ const DbusPropertyMap& properties, const std::string& propertyName)
{
auto it = properties.find(propertyName);
if (it == properties.end())
diff --git a/phosphor-power-sequencer/src/pmbus_driver_device.cpp b/phosphor-power-sequencer/src/pmbus_driver_device.cpp
index e8c0e04..cb08476 100644
--- a/phosphor-power-sequencer/src/pmbus_driver_device.cpp
+++ b/phosphor-power-sequencer/src/pmbus_driver_device.cpp
@@ -93,8 +93,8 @@
{
unsigned int fileNumber = getFileNumber(page);
std::string fileName = std::format("in{}_input", fileNumber);
- std::string millivoltsStr = pmbusInterface->readString(fileName,
- Type::Hwmon);
+ std::string millivoltsStr =
+ pmbusInterface->readString(fileName, Type::Hwmon);
unsigned long millivolts = std::stoul(millivoltsStr);
volts = millivolts / 1000.0;
}
@@ -114,8 +114,8 @@
{
unsigned int fileNumber = getFileNumber(page);
std::string fileName = std::format("in{}_lcrit", fileNumber);
- std::string millivoltsStr = pmbusInterface->readString(fileName,
- Type::Hwmon);
+ std::string millivoltsStr =
+ pmbusInterface->readString(fileName, Type::Hwmon);
unsigned long millivolts = std::stoul(millivoltsStr);
volts = millivolts / 1000.0;
}
@@ -224,8 +224,8 @@
try
{
// Read voltage label file contents
- std::string contents = pmbusInterface->readString(fileName,
- Type::Hwmon);
+ std::string contents =
+ pmbusInterface->readString(fileName, Type::Hwmon);
// Check if file contents match the expected pattern
std::regex regex{"vout(\\d+)"};
diff --git a/phosphor-power-sequencer/src/pmbus_driver_device.hpp b/phosphor-power-sequencer/src/pmbus_driver_device.hpp
index e7e85ac..c8754db 100644
--- a/phosphor-power-sequencer/src/pmbus_driver_device.hpp
+++ b/phosphor-power-sequencer/src/pmbus_driver_device.hpp
@@ -61,17 +61,15 @@
* @param driverName Device driver name
* @param instance Chip instance number
*/
- explicit PMBusDriverDevice(const std::string& name,
- std::vector<std::unique_ptr<Rail>> rails,
- Services& services, uint8_t bus,
- uint16_t address,
- const std::string& driverName = "",
- size_t instance = 0) :
- StandardDevice(name, std::move(rails)),
- bus{bus}, address{address}, driverName{driverName}, instance{instance}
+ explicit PMBusDriverDevice(
+ const std::string& name, std::vector<std::unique_ptr<Rail>> rails,
+ Services& services, uint8_t bus, uint16_t address,
+ const std::string& driverName = "", size_t instance = 0) :
+ StandardDevice(name, std::move(rails)), bus{bus}, address{address},
+ driverName{driverName}, instance{instance}
{
- pmbusInterface = services.createPMBus(bus, address, driverName,
- instance);
+ pmbusInterface =
+ services.createPMBus(bus, address, driverName, instance);
}
/**
diff --git a/phosphor-power-sequencer/src/power_control.cpp b/phosphor-power-sequencer/src/power_control.cpp
index cc92ff4..c1d0079 100644
--- a/phosphor-power-sequencer/src/power_control.cpp
+++ b/phosphor-power-sequencer/src/power_control.cpp
@@ -45,8 +45,8 @@
PowerControl::PowerControl(sdbusplus::bus_t& bus,
const sdeventplus::Event& event) :
- PowerObject{bus, POWER_OBJ_PATH, PowerObject::action::defer_emit},
- bus{bus}, services{bus},
+ PowerObject{bus, POWER_OBJ_PATH, PowerObject::action::defer_emit}, bus{bus},
+ services{bus},
pgoodWaitTimer{event, std::bind(&PowerControl::onFailureCallback, this)},
powerOnAllowedTime{std::chrono::steady_clock::now() + minimumColdStartTime},
timer{event, std::bind(&PowerControl::pollPgood, this), pollInterval}
@@ -251,8 +251,8 @@
if (s == 0)
{
// Set a minimum amount of time to wait before next power on
- powerOnAllowedTime = std::chrono::steady_clock::now() +
- minimumPowerOffTime;
+ powerOnAllowedTime =
+ std::chrono::steady_clock::now() + minimumPowerOffTime;
}
pgoodTimeoutTime = std::chrono::steady_clock::now() + timeout;
@@ -312,8 +312,8 @@
powerControlLine = gpiod::find_line(powerControlLineName);
if (!powerControlLine)
{
- std::string errorString{"GPIO line name not found: " +
- powerControlLineName};
+ std::string errorString{
+ "GPIO line name not found: " + powerControlLineName};
services.logErrorMsg(errorString);
throw std::runtime_error(errorString);
}
diff --git a/phosphor-power-sequencer/src/power_interface.cpp b/phosphor-power-sequencer/src/power_interface.cpp
index 0838d8f..67a8498 100644
--- a/phosphor-power-sequencer/src/power_interface.cpp
+++ b/phosphor-power-sequencer/src/power_interface.cpp
@@ -36,11 +36,10 @@
serverInterface(bus, path, POWER_IFACE, vtable, this)
{}
-int PowerInterface::callbackGetPgood(sd_bus* /*bus*/, const char* /*path*/,
- const char* /*interface*/,
- const char* /*property*/,
- sd_bus_message* msg, void* context,
- sd_bus_error* error)
+int PowerInterface::callbackGetPgood(
+ sd_bus* /*bus*/, const char* /*path*/, const char* /*interface*/,
+ const char* /*property*/, sd_bus_message* msg, void* context,
+ sd_bus_error* error)
{
if (msg != nullptr && context != nullptr)
{
@@ -68,12 +67,10 @@
return 1;
}
-int PowerInterface::callbackGetPgoodTimeout(sd_bus* /*bus*/,
- const char* /*path*/,
- const char* /*interface*/,
- const char* /*property*/,
- sd_bus_message* msg, void* context,
- sd_bus_error* error)
+int PowerInterface::callbackGetPgoodTimeout(
+ sd_bus* /*bus*/, const char* /*path*/, const char* /*interface*/,
+ const char* /*property*/, sd_bus_message* msg, void* context,
+ sd_bus_error* error)
{
if (msg != nullptr && context != nullptr)
{
@@ -135,12 +132,10 @@
return 1;
}
-int PowerInterface::callbackSetPgoodTimeout(sd_bus* /*bus*/,
- const char* /*path*/,
- const char* /*interface*/,
- const char* /*property*/,
- sd_bus_message* msg, void* context,
- sd_bus_error* error)
+int PowerInterface::callbackSetPgoodTimeout(
+ sd_bus* /*bus*/, const char* /*path*/, const char* /*interface*/,
+ const char* /*property*/, sd_bus_message* msg, void* context,
+ sd_bus_error* error)
{
if (msg != nullptr && context != nullptr)
{
@@ -172,11 +167,10 @@
return 1;
}
-int PowerInterface::callbackGetState(sd_bus* /*bus*/, const char* /*path*/,
- const char* /*interface*/,
- const char* /*property*/,
- sd_bus_message* msg, void* context,
- sd_bus_error* error)
+int PowerInterface::callbackGetState(
+ sd_bus* /*bus*/, const char* /*path*/, const char* /*interface*/,
+ const char* /*property*/, sd_bus_message* msg, void* context,
+ sd_bus_error* error)
{
if (msg != nullptr && context != nullptr)
{
@@ -245,9 +239,8 @@
return 1;
}
-int PowerInterface::callbackSetPowerSupplyError(sd_bus_message* msg,
- void* context,
- sd_bus_error* error)
+int PowerInterface::callbackSetPowerSupplyError(
+ sd_bus_message* msg, void* context, sd_bus_error* error)
{
if (msg != nullptr && context != nullptr)
{
diff --git a/phosphor-power-sequencer/src/power_interface.hpp b/phosphor-power-sequencer/src/power_interface.hpp
index 6b07d41..e52ff28 100644
--- a/phosphor-power-sequencer/src/power_interface.hpp
+++ b/phosphor-power-sequencer/src/power_interface.hpp
@@ -111,11 +111,10 @@
/**
* Systemd bus callback for getting the pgood_timeout property
*/
- static int callbackGetPgoodTimeout(sd_bus* bus, const char* path,
- const char* interface,
- const char* property,
- sd_bus_message* msg, void* context,
- sd_bus_error* error);
+ static int callbackGetPgoodTimeout(
+ sd_bus* bus, const char* path, const char* interface,
+ const char* property, sd_bus_message* msg, void* context,
+ sd_bus_error* error);
/**
* Systemd bus callback for the getPowerState method
@@ -134,11 +133,10 @@
/**
* Systemd bus callback for setting the pgood_timeout property
*/
- static int callbackSetPgoodTimeout(sd_bus* bus, const char* path,
- const char* interface,
- const char* property,
- sd_bus_message* msg, void* context,
- sd_bus_error* error);
+ static int callbackSetPgoodTimeout(
+ sd_bus* bus, const char* path, const char* interface,
+ const char* property, sd_bus_message* msg, void* context,
+ sd_bus_error* error);
/**
* Systemd bus callback for the setPowerSupplyError method
diff --git a/phosphor-power-sequencer/src/rail.hpp b/phosphor-power-sequencer/src/rail.hpp
index ee331ca..040eb81 100644
--- a/phosphor-power-sequencer/src/rail.hpp
+++ b/phosphor-power-sequencer/src/rail.hpp
@@ -94,9 +94,8 @@
const std::optional<uint8_t>& page, bool isPowerSupplyRail,
bool checkStatusVout, bool compareVoltageToLimit,
const std::optional<GPIO>& gpio) :
- name{name},
- presence{presence}, page{page}, isPsuRail{isPowerSupplyRail},
- checkStatusVout{checkStatusVout},
+ name{name}, presence{presence}, page{page},
+ isPsuRail{isPowerSupplyRail}, checkStatusVout{checkStatusVout},
compareVoltageToLimit{compareVoltageToLimit}, gpio{gpio}
{
// If checking STATUS_VOUT or output voltage, verify PAGE was specified
diff --git a/phosphor-power-sequencer/src/services.hpp b/phosphor-power-sequencer/src/services.hpp
index 3fa0f6f..d573743 100644
--- a/phosphor-power-sequencer/src/services.hpp
+++ b/phosphor-power-sequencer/src/services.hpp
@@ -122,10 +122,9 @@
* @param instance Chip instance number
* @return object for communicating with PMBus device
*/
- virtual std::unique_ptr<PMBusBase>
- createPMBus(uint8_t bus, uint16_t address,
- const std::string& driverName = "",
- size_t instance = 0) = 0;
+ virtual std::unique_ptr<PMBusBase> createPMBus(
+ uint8_t bus, uint16_t address, const std::string& driverName = "",
+ size_t instance = 0) = 0;
/**
* Creates a BMC dump.
@@ -196,13 +195,12 @@
getGPIOValues(const std::string& chipLabel) override;
/** @copydoc Services::createPMBus() */
- virtual std::unique_ptr<PMBusBase>
- createPMBus(uint8_t bus, uint16_t address,
- const std::string& driverName = "",
- size_t instance = 0) override
+ virtual std::unique_ptr<PMBusBase> createPMBus(
+ uint8_t bus, uint16_t address, const std::string& driverName = "",
+ size_t instance = 0) override
{
- std::string path = std::format("/sys/bus/i2c/devices/{}-{:04x}", bus,
- address);
+ std::string path =
+ std::format("/sys/bus/i2c/devices/{}-{:04x}", bus, address);
return std::make_unique<PMBus>(path, driverName, instance);
}
diff --git a/phosphor-power-sequencer/src/standard_device.cpp b/phosphor-power-sequencer/src/standard_device.cpp
index 5bfbfb3..d3c4915 100644
--- a/phosphor-power-sequencer/src/standard_device.cpp
+++ b/phosphor-power-sequencer/src/standard_device.cpp
@@ -40,8 +40,8 @@
std::vector<int> gpioValues = getGPIOValuesIfPossible(services);
// Try to find a voltage rail where a pgood fault occurred
- Rail* rail = findRailWithPgoodFault(services, gpioValues,
- additionalData);
+ Rail* rail =
+ findRailWithPgoodFault(services, gpioValues, additionalData);
if (rail != nullptr)
{
services.logErrorMsg(std::format(
diff --git a/phosphor-power-sequencer/src/standard_device.hpp b/phosphor-power-sequencer/src/standard_device.hpp
index 2c1cf3b..245af38 100644
--- a/phosphor-power-sequencer/src/standard_device.hpp
+++ b/phosphor-power-sequencer/src/standard_device.hpp
@@ -57,8 +57,7 @@
*/
explicit StandardDevice(const std::string& name,
std::vector<std::unique_ptr<Rail>> rails) :
- name{name},
- rails{std::move(rails)}
+ name{name}, rails{std::move(rails)}
{}
/** @copydoc PowerSequencerDevice::getName() */
diff --git a/phosphor-power-sequencer/src/ucd90320_device.cpp b/phosphor-power-sequencer/src/ucd90320_device.cpp
index 2d91797..40516d5 100644
--- a/phosphor-power-sequencer/src/ucd90320_device.cpp
+++ b/phosphor-power-sequencer/src/ucd90320_device.cpp
@@ -56,8 +56,8 @@
std::map<std::string, std::string>& additionalData)
{
// Verify the expected number of GPIO values were passed in
- unsigned int expectedCount = gpioGroups.back().offset +
- gpioGroups.back().count;
+ unsigned int expectedCount =
+ gpioGroups.back().offset + gpioGroups.back().count;
if (values.size() != expectedCount)
{
// Unexpected number of values; store as a plain list of integers
diff --git a/phosphor-power-sequencer/test/pmbus_driver_device_tests.cpp b/phosphor-power-sequencer/test/pmbus_driver_device_tests.cpp
index 1fedb36..7cbb15d 100644
--- a/phosphor-power-sequencer/test/pmbus_driver_device_tests.cpp
+++ b/phosphor-power-sequencer/test/pmbus_driver_device_tests.cpp
@@ -808,8 +808,8 @@
// rebuilds the map.
std::string powerSupplyError{};
std::map<std::string, std::string> additionalData{};
- std::string error = device.findPgoodFault(services, powerSupplyError,
- additionalData);
+ std::string error =
+ device.findPgoodFault(services, powerSupplyError, additionalData);
EXPECT_TRUE(error.empty());
EXPECT_EQ(additionalData.size(), 0);
diff --git a/phosphor-power-sequencer/test/standard_device_tests.cpp b/phosphor-power-sequencer/test/standard_device_tests.cpp
index 1afb3bd..266b7b3 100644
--- a/phosphor-power-sequencer/test/standard_device_tests.cpp
+++ b/phosphor-power-sequencer/test/standard_device_tests.cpp
@@ -87,9 +87,8 @@
* @param pageNum PMBus PAGE number of the rail
* @return Rail object
*/
-std::unique_ptr<Rail> createRailStatusVout(const std::string& name,
- bool isPowerSupplyRail,
- uint8_t pageNum)
+std::unique_ptr<Rail> createRailStatusVout(
+ const std::string& name, bool isPowerSupplyRail, uint8_t pageNum)
{
std::optional<std::string> presence{};
std::optional<uint8_t> page{pageNum};
@@ -109,9 +108,8 @@
* @param gpio GPIO line to read to determine the pgood status of the rail
* @return Rail object
*/
-std::unique_ptr<Rail> createRailGPIO(const std::string& name,
- bool isPowerSupplyRail,
- unsigned int gpioLine)
+std::unique_ptr<Rail> createRailGPIO(
+ const std::string& name, bool isPowerSupplyRail, unsigned int gpioLine)
{
std::optional<std::string> presence{};
std::optional<uint8_t> page{};
@@ -132,9 +130,8 @@
* @param pageNum PMBus PAGE number of the rail
* @return Rail object
*/
-std::unique_ptr<Rail> createRailOutputVoltage(const std::string& name,
- bool isPowerSupplyRail,
- uint8_t pageNum)
+std::unique_ptr<Rail> createRailOutputVoltage(
+ const std::string& name, bool isPowerSupplyRail, uint8_t pageNum)
{
std::optional<std::string> presence{};
std::optional<uint8_t> page{pageNum};
@@ -230,8 +227,8 @@
std::string powerSupplyError{};
std::map<std::string, std::string> additionalData{};
- std::string error = device.findPgoodFault(services, powerSupplyError,
- additionalData);
+ std::string error =
+ device.findPgoodFault(services, powerSupplyError, additionalData);
EXPECT_TRUE(error.empty());
EXPECT_EQ(additionalData.size(), 0);
}
@@ -273,8 +270,8 @@
std::string powerSupplyError{};
std::map<std::string, std::string> additionalData{};
- std::string error = device.findPgoodFault(services, powerSupplyError,
- additionalData);
+ std::string error =
+ device.findPgoodFault(services, powerSupplyError, additionalData);
EXPECT_EQ(error,
"xyz.openbmc_project.Power.Error.PowerSequencerVoltageFault");
EXPECT_EQ(additionalData.size(), 5);
@@ -322,8 +319,8 @@
std::string powerSupplyError{"Undervoltage fault: PSU1"};
std::map<std::string, std::string> additionalData{};
- std::string error = device.findPgoodFault(services, powerSupplyError,
- additionalData);
+ std::string error =
+ device.findPgoodFault(services, powerSupplyError, additionalData);
EXPECT_EQ(error, powerSupplyError);
EXPECT_EQ(additionalData.size(), 5);
EXPECT_EQ(additionalData["DEVICE_NAME"], "abc_pseq");
@@ -375,8 +372,8 @@
std::string powerSupplyError{"Undervoltage fault: PSU1"};
std::map<std::string, std::string> additionalData{};
- std::string error = device.findPgoodFault(services, powerSupplyError,
- additionalData);
+ std::string error =
+ device.findPgoodFault(services, powerSupplyError, additionalData);
EXPECT_EQ(error,
"xyz.openbmc_project.Power.Error.PowerSequencerVoltageFault");
EXPECT_EQ(additionalData.size(), 6);
@@ -426,8 +423,8 @@
std::string powerSupplyError{};
std::map<std::string, std::string> additionalData{};
- std::string error = device.findPgoodFault(services, powerSupplyError,
- additionalData);
+ std::string error =
+ device.findPgoodFault(services, powerSupplyError, additionalData);
EXPECT_EQ(error,
"xyz.openbmc_project.Power.Error.PowerSequencerVoltageFault");
EXPECT_EQ(additionalData.size(), 4);
@@ -474,8 +471,8 @@
std::string powerSupplyError{};
std::map<std::string, std::string> additionalData{};
- std::string error = device.findPgoodFault(services, powerSupplyError,
- additionalData);
+ std::string error =
+ device.findPgoodFault(services, powerSupplyError, additionalData);
EXPECT_EQ(error,
"xyz.openbmc_project.Power.Error.PowerSequencerVoltageFault");
EXPECT_EQ(additionalData.size(), 4);
@@ -523,8 +520,8 @@
std::string powerSupplyError{};
std::map<std::string, std::string> additionalData{};
- std::string error = device.findPgoodFault(services, powerSupplyError,
- additionalData);
+ std::string error =
+ device.findPgoodFault(services, powerSupplyError, additionalData);
EXPECT_EQ(error,
"xyz.openbmc_project.Power.Error.PowerSequencerVoltageFault");
EXPECT_EQ(additionalData.size(), 5);
@@ -578,8 +575,8 @@
std::string powerSupplyError{};
std::map<std::string, std::string> additionalData{};
- std::string error = device.findPgoodFault(services, powerSupplyError,
- additionalData);
+ std::string error =
+ device.findPgoodFault(services, powerSupplyError, additionalData);
EXPECT_EQ(error,
"xyz.openbmc_project.Power.Error.PowerSequencerVoltageFault");
EXPECT_EQ(additionalData.size(), 6);
diff --git a/phosphor-power-sequencer/test/ucd90160_device_tests.cpp b/phosphor-power-sequencer/test/ucd90160_device_tests.cpp
index 7718c3b..d7c1885 100644
--- a/phosphor-power-sequencer/test/ucd90160_device_tests.cpp
+++ b/phosphor-power-sequencer/test/ucd90160_device_tests.cpp
@@ -103,10 +103,10 @@
.WillOnce(Return(gpioValues));
EXPECT_CALL(services, logInfoMsg("Device UCD90160 GPIO values:"))
.Times(1);
- EXPECT_CALL(
- services,
- logInfoMsg("[FPWM1_GPIO5, FPWM2_GPIO6, FPWM3_GPIO7, FPWM4_GPIO8]: "
- "[1, 0, 0, 1]"))
+ EXPECT_CALL(services,
+ logInfoMsg(
+ "[FPWM1_GPIO5, FPWM2_GPIO6, FPWM3_GPIO7, FPWM4_GPIO8]: "
+ "[1, 0, 0, 1]"))
.Times(1);
EXPECT_CALL(
services,
@@ -165,8 +165,8 @@
// Call findPgoodFault() which calls storeGPIOValues()
std::string powerSupplyError{};
std::map<std::string, std::string> additionalData{};
- std::string error = device.findPgoodFault(services, powerSupplyError,
- additionalData);
+ std::string error =
+ device.findPgoodFault(services, powerSupplyError, additionalData);
EXPECT_EQ(error,
"xyz.openbmc_project.Power.Error.PowerSequencerVoltageFault");
EXPECT_EQ(additionalData.size(), 31);
@@ -219,14 +219,15 @@
EXPECT_CALL(services, getGPIOValues("ucd90160"))
.Times(1)
.WillOnce(Return(gpioValues));
- EXPECT_CALL(services, logInfoMsg("Device UCD90160 GPIO values: ["
- "1, 0, 0, 1, "
- "1, 1, 0, 0, "
- "1, 0, 1, 1, "
- "0, 0, 1, 1, "
- "1, 0, 0, 0, "
- "1, 0, 0, 1, "
- "1, 1, 0]"))
+ EXPECT_CALL(services,
+ logInfoMsg("Device UCD90160 GPIO values: ["
+ "1, 0, 0, 1, "
+ "1, 1, 0, 0, "
+ "1, 0, 1, 1, "
+ "0, 0, 1, 1, "
+ "1, 0, 0, 0, "
+ "1, 0, 0, 1, "
+ "1, 1, 0]"))
.Times(1);
EXPECT_CALL(services,
logInfoMsg("Device UCD90160 MFR_STATUS: 0x123456789abc"))
@@ -261,20 +262,21 @@
// Call findPgoodFault() which calls storeGPIOValues()
std::string powerSupplyError{};
std::map<std::string, std::string> additionalData{};
- std::string error = device.findPgoodFault(services, powerSupplyError,
- additionalData);
+ std::string error =
+ device.findPgoodFault(services, powerSupplyError, additionalData);
EXPECT_EQ(error,
"xyz.openbmc_project.Power.Error.PowerSequencerVoltageFault");
EXPECT_EQ(additionalData.size(), 6);
EXPECT_EQ(additionalData["MFR_STATUS"], "0x123456789abc");
EXPECT_EQ(additionalData["DEVICE_NAME"], "UCD90160");
- EXPECT_EQ(additionalData["GPIO_VALUES"], "[1, 0, 0, 1, "
- "1, 1, 0, 0, "
- "1, 0, 1, 1, "
- "0, 0, 1, 1, "
- "1, 0, 0, 0, "
- "1, 0, 0, 1, "
- "1, 1, 0]");
+ EXPECT_EQ(additionalData["GPIO_VALUES"],
+ "[1, 0, 0, 1, "
+ "1, 1, 0, 0, "
+ "1, 0, 1, 1, "
+ "0, 0, 1, 1, "
+ "1, 0, 0, 0, "
+ "1, 0, 0, 1, "
+ "1, 1, 0]");
EXPECT_EQ(additionalData["RAIL_NAME"], "VDD");
EXPECT_EQ(additionalData["GPIO_LINE"], "2");
EXPECT_EQ(additionalData["GPIO_VALUE"], "0");
diff --git a/phosphor-power-sequencer/test/ucd90320_device_tests.cpp b/phosphor-power-sequencer/test/ucd90320_device_tests.cpp
index 980b960..951bd82 100644
--- a/phosphor-power-sequencer/test/ucd90320_device_tests.cpp
+++ b/phosphor-power-sequencer/test/ucd90320_device_tests.cpp
@@ -157,8 +157,8 @@
// Call findPgoodFault() which calls storeGPIOValues()
std::string powerSupplyError{};
std::map<std::string, std::string> additionalData{};
- std::string error = device.findPgoodFault(services, powerSupplyError,
- additionalData);
+ std::string error =
+ device.findPgoodFault(services, powerSupplyError, additionalData);
EXPECT_EQ(error,
"xyz.openbmc_project.Power.Error.PowerSequencerVoltageFault");
EXPECT_EQ(additionalData.size(), 10);
@@ -200,16 +200,17 @@
EXPECT_CALL(services, getGPIOValues("ucd90320"))
.Times(1)
.WillOnce(Return(gpioValues));
- EXPECT_CALL(services, logInfoMsg("Device UCD90320 GPIO values: ["
- "1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, "
- "1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, "
- "1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, "
- "1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, "
- "1, 1, 0, 0, 1, 1, 1, 0, "
- "1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, "
- "1, 1, 0, 0, "
- "1, 0, 0, 1, 1, 1, 0, 0, "
- "1, 0, 0]"))
+ EXPECT_CALL(services,
+ logInfoMsg("Device UCD90320 GPIO values: ["
+ "1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, "
+ "1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, "
+ "1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, "
+ "1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, "
+ "1, 1, 0, 0, 1, 1, 1, 0, "
+ "1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, "
+ "1, 1, 0, 0, "
+ "1, 0, 0, 1, 1, 1, 0, 0, "
+ "1, 0, 0]"))
.Times(1);
EXPECT_CALL(services,
logInfoMsg("Device UCD90320 MFR_STATUS: 0x123456789abc"))
@@ -244,8 +245,8 @@
// Call findPgoodFault() which calls storeGPIOValues()
std::string powerSupplyError{};
std::map<std::string, std::string> additionalData{};
- std::string error = device.findPgoodFault(services, powerSupplyError,
- additionalData);
+ std::string error =
+ device.findPgoodFault(services, powerSupplyError, additionalData);
EXPECT_EQ(error,
"xyz.openbmc_project.Power.Error.PowerSequencerVoltageFault");
EXPECT_EQ(additionalData.size(), 6);
diff --git a/phosphor-power-sequencer/test/ucd90x_device_tests.cpp b/phosphor-power-sequencer/test/ucd90x_device_tests.cpp
index 3ab5369..2571e9b 100644
--- a/phosphor-power-sequencer/test/ucd90x_device_tests.cpp
+++ b/phosphor-power-sequencer/test/ucd90x_device_tests.cpp
@@ -182,8 +182,8 @@
// Call findPgoodFault() which calls storePgoodFaultDebugData()
std::string powerSupplyError{};
std::map<std::string, std::string> additionalData{};
- std::string error = device.findPgoodFault(services, powerSupplyError,
- additionalData);
+ std::string error =
+ device.findPgoodFault(services, powerSupplyError, additionalData);
EXPECT_EQ(error,
"xyz.openbmc_project.Power.Error.PowerSequencerVoltageFault");
EXPECT_EQ(additionalData.size(), 6);
@@ -236,8 +236,8 @@
// Call findPgoodFault() which calls storePgoodFaultDebugData()
std::string powerSupplyError{};
std::map<std::string, std::string> additionalData{};
- std::string error = device.findPgoodFault(services, powerSupplyError,
- additionalData);
+ std::string error =
+ device.findPgoodFault(services, powerSupplyError, additionalData);
EXPECT_EQ(error,
"xyz.openbmc_project.Power.Error.PowerSequencerVoltageFault");
EXPECT_EQ(additionalData.size(), 5);
diff --git a/phosphor-power-supply/power_supply.cpp b/phosphor-power-supply/power_supply.cpp
index 1f65fb2..68b2c7c 100644
--- a/phosphor-power-supply/power_supply.cpp
+++ b/phosphor-power-supply/power_supply.cpp
@@ -24,14 +24,13 @@
using namespace phosphor::logging;
using namespace sdbusplus::xyz::openbmc_project::Common::Device::Error;
-PowerSupply::PowerSupply(sdbusplus::bus_t& bus, const std::string& invpath,
- std::uint8_t i2cbus, std::uint16_t i2caddr,
- const std::string& driver,
- const std::string& gpioLineName,
- std::function<bool()>&& callback) :
- bus(bus),
- inventoryPath(invpath), bindPath("/sys/bus/i2c/drivers/" + driver),
- isPowerOn(std::move(callback)), driverName(driver)
+PowerSupply::PowerSupply(
+ sdbusplus::bus_t& bus, const std::string& invpath, std::uint8_t i2cbus,
+ std::uint16_t i2caddr, const std::string& driver,
+ const std::string& gpioLineName, std::function<bool()>&& callback) :
+ bus(bus), inventoryPath(invpath),
+ bindPath("/sys/bus/i2c/drivers/" + driver), isPowerOn(std::move(callback)),
+ driverName(driver)
{
if (inventoryPath.empty())
{
@@ -383,13 +382,13 @@
{
if (statusWord != statusWordOld)
{
- log<level::ERR>(std::format("{} FANS fault/warning: "
- "STATUS_WORD = {:#06x}, "
- "STATUS_MFR_SPECIFIC = {:#04x}, "
- "STATUS_FANS_1_2 = {:#04x}",
- shortName, statusWord, statusMFR,
- statusFans12)
- .c_str());
+ log<level::ERR>(
+ std::format("{} FANS fault/warning: "
+ "STATUS_WORD = {:#06x}, "
+ "STATUS_MFR_SPECIFIC = {:#04x}, "
+ "STATUS_FANS_1_2 = {:#04x}",
+ shortName, statusWord, statusMFR, statusFans12)
+ .c_str());
}
fanFault++;
}
@@ -589,8 +588,8 @@
statusVout = pmbusIntf->read(status0Vout, Type::Debug);
statusIout = pmbusIntf->read(STATUS_IOUT, Type::Debug);
statusFans12 = pmbusIntf->read(STATUS_FANS_1_2, Type::Debug);
- statusTemperature = pmbusIntf->read(STATUS_TEMPERATURE,
- Type::Debug);
+ statusTemperature =
+ pmbusIntf->read(STATUS_TEMPERATURE, Type::Debug);
analyzeCMLFault();
@@ -859,8 +858,8 @@
const std::size_t& vpdSize)
{
std::string vpdValue;
- const std::regex illegalVPDRegex = std::regex("[^[:alnum:]]",
- std::regex::basic);
+ const std::regex illegalVPDRegex =
+ std::regex("[^[:alnum:]]", std::regex::basic);
try
{
@@ -1013,8 +1012,8 @@
try
{
- auto service = util::getService(INVENTORY_OBJ_PATH,
- INVENTORY_MGR_IFACE, bus);
+ auto service =
+ util::getService(INVENTORY_OBJ_PATH, INVENTORY_MGR_IFACE, bus);
if (service.empty())
{
@@ -1022,9 +1021,9 @@
return;
}
- auto method = bus.new_method_call(service.c_str(),
- INVENTORY_OBJ_PATH,
- INVENTORY_MGR_IFACE, "Notify");
+ auto method =
+ bus.new_method_call(service.c_str(), INVENTORY_OBJ_PATH,
+ INVENTORY_MGR_IFACE, "Notify");
method.append(std::move(object));
@@ -1051,8 +1050,8 @@
try
{
// Read max_power_out, should be direct format
- auto maxPowerOutStr = pmbusIntf->readString(MFR_POUT_MAX,
- Type::HwmonDeviceDebug);
+ auto maxPowerOutStr =
+ pmbusIntf->readString(MFR_POUT_MAX, Type::HwmonDeviceDebug);
log<level::INFO>(std::format("{} MFR_POUT_MAX read {}", shortName,
maxPowerOutStr)
.c_str());
diff --git a/phosphor-power-supply/psu_manager.cpp b/phosphor-power-supply/psu_manager.cpp
index 32da768..3195a58 100644
--- a/phosphor-power-supply/psu_manager.cpp
+++ b/phosphor-power-supply/psu_manager.cpp
@@ -167,8 +167,8 @@
// For each object in the array of objects, I want to get properties
// from the service, path, and interface.
- auto properties = getAllProperties(bus, path, IBMCFFPSInterface,
- service);
+ auto properties =
+ getAllProperties(bus, path, IBMCFFPSInterface, service);
getPSUProperties(properties);
}
@@ -232,10 +232,10 @@
presline = *preslineptr;
}
- auto invMatch = std::find_if(psus.begin(), psus.end(),
- [&invpath](auto& psu) {
- return psu->getInventoryPath() == invpath;
- });
+ auto invMatch =
+ std::find_if(psus.begin(), psus.end(), [&invpath](auto& psu) {
+ return psu->getInventoryPath() == invpath;
+ });
if (invMatch != psus.end())
{
// This power supply has the same inventory path as the one with
@@ -348,8 +348,8 @@
{
try
{
- util::DbusSubtree subtree = util::getSubTree(bus, INVENTORY_OBJ_PATH,
- supportedConfIntf, 0);
+ util::DbusSubtree subtree =
+ util::getSubTree(bus, INVENTORY_OBJ_PATH, supportedConfIntf, 0);
if (subtree.empty())
{
throw std::runtime_error("Supported Configuration Not Found");
@@ -520,8 +520,8 @@
{
additionalData["_PID"] = std::to_string(getpid());
- auto service = util::getService(loggingObjectPath,
- loggingCreateInterface, bus);
+ auto service =
+ util::getService(loggingObjectPath, loggingCreateInterface, bus);
if (service.empty())
{
@@ -583,9 +583,10 @@
void PSUManager::analyze()
{
- auto syncHistoryRequired = std::any_of(
- psus.begin(), psus.end(),
- [](const auto& psu) { return psu->isSyncHistoryRequired(); });
+ auto syncHistoryRequired =
+ std::any_of(psus.begin(), psus.end(), [](const auto& psu) {
+ return psu->isSyncHistoryRequired();
+ });
if (syncHistoryRequired)
{
syncHistory();
@@ -630,8 +631,8 @@
// hexadecimal format.
additionalData["STATUS_WORD"] =
std::format("{:#04x}", psu->getStatusWord());
- additionalData["STATUS_MFR"] = std::format("{:#02x}",
- psu->getMFRFault());
+ additionalData["STATUS_MFR"] =
+ std::format("{:#02x}", psu->getMFRFault());
// If there are faults being reported, they possibly could be
// related to a bug in the firmware version running on the power
// supply. Capture that data into the error as well.
@@ -1082,8 +1083,8 @@
psu->getInputVoltage(actualInputVoltage, inputVoltage);
if (std::find(config.second.inputVoltage.begin(),
- config.second.inputVoltage.end(),
- inputVoltage) == config.second.inputVoltage.end())
+ config.second.inputVoltage.end(), inputVoltage) ==
+ config.second.inputVoltage.end())
{
tmpAdditionalData.clear();
tmpAdditionalData["ACTUAL_VOLTAGE"] =
@@ -1315,8 +1316,8 @@
namespace fs = std::filesystem;
std::stringstream ss;
ss << std::hex << std::setw(4) << std::setfill('0') << i2caddr;
- std::string symLinkPath = deviceDirPath + std::to_string(i2cbus) + "-" +
- ss.str() + driverDirName;
+ std::string symLinkPath =
+ deviceDirPath + std::to_string(i2cbus) + "-" + ss.str() + driverDirName;
try
{
fs::path linkStrPath = fs::read_symlink(symLinkPath);
diff --git a/phosphor-power-supply/test/power_supply_tests.cpp b/phosphor-power-supply/test/power_supply_tests.cpp
index 7d2e4c9..ef1e7f3 100644
--- a/phosphor-power-supply/test/power_supply_tests.cpp
+++ b/phosphor-power-supply/test/power_supply_tests.cpp
@@ -175,9 +175,9 @@
// NOT using D-Bus inventory path for presence.
try
{
- auto psu = std::make_unique<PowerSupply>(bus, PSUInventoryPath, 3, 0x68,
- "ibm-cffps", PSUGPIOLineName,
- isPowerOn);
+ auto psu = std::make_unique<PowerSupply>(
+ bus, PSUInventoryPath, 3, 0x68, "ibm-cffps", PSUGPIOLineName,
+ isPowerOn);
EXPECT_EQ(psu->isPresent(), false);
EXPECT_EQ(psu->isFaulted(), false);
diff --git a/phosphor-power-supply/util.cpp b/phosphor-power-supply/util.cpp
index d1253da..8fe4e23 100644
--- a/phosphor-power-supply/util.cpp
+++ b/phosphor-power-supply/util.cpp
@@ -23,8 +23,8 @@
}
catch (const std::exception& e)
{
- throw std::runtime_error(std::string("Failed to find line: ") +
- e.what());
+ throw std::runtime_error(
+ std::string("Failed to find line: ") + e.what());
}
}
@@ -92,9 +92,9 @@
try
{
- line.request(
- {__FUNCTION__, gpiod::line_request::DIRECTION_OUTPUT, flags},
- value);
+ line.request({__FUNCTION__, gpiod::line_request::DIRECTION_OUTPUT,
+ flags},
+ value);
line.release();
}
diff --git a/phosphor-power-supply/util.hpp b/phosphor-power-supply/util.hpp
index 293d44d..1614138 100644
--- a/phosphor-power-supply/util.hpp
+++ b/phosphor-power-supply/util.hpp
@@ -71,9 +71,9 @@
INVENTORY_OBJ_PATH, INVENTORY_MGR_IFACE, bus);
// Update inventory
- auto invMsg = bus.new_method_call(invService.c_str(),
- INVENTORY_OBJ_PATH,
- INVENTORY_MGR_IFACE, "Notify");
+ auto invMsg =
+ bus.new_method_call(invService.c_str(), INVENTORY_OBJ_PATH,
+ INVENTORY_MGR_IFACE, "Notify");
invMsg.append(std::move(invObj));
auto invMgrResponseMsg = bus.call(invMsg);
}
@@ -105,9 +105,9 @@
auto invService = phosphor::power::util::getService(
INVENTORY_OBJ_PATH, INVENTORY_MGR_IFACE, bus);
- auto invMsg = bus.new_method_call(invService.c_str(),
- INVENTORY_OBJ_PATH,
- INVENTORY_MGR_IFACE, "Notify");
+ auto invMsg =
+ bus.new_method_call(invService.c_str(), INVENTORY_OBJ_PATH,
+ INVENTORY_MGR_IFACE, "Notify");
invMsg.append(std::move(invObj));
auto invMgrResponseMsg = bus.call(invMsg);
}
diff --git a/phosphor-power-supply/util_base.hpp b/phosphor-power-supply/util_base.hpp
index b9d5e2e..6bbcb88 100644
--- a/phosphor-power-supply/util_base.hpp
+++ b/phosphor-power-supply/util_base.hpp
@@ -55,9 +55,8 @@
getUtils().setAvailable(bus, invpath, available);
}
-inline void handleChassisHealthRollup(sdbusplus::bus_t& bus,
- const std::string& invpath,
- bool addRollup)
+inline void handleChassisHealthRollup(
+ sdbusplus::bus_t& bus, const std::string& invpath, bool addRollup)
{
getUtils().handleChassisHealthRollup(bus, invpath, addRollup);
}
diff --git a/phosphor-regulators/src/actions/action_environment.hpp b/phosphor-regulators/src/actions/action_environment.hpp
index 265a7bf..f49219a 100644
--- a/phosphor-regulators/src/actions/action_environment.hpp
+++ b/phosphor-regulators/src/actions/action_environment.hpp
@@ -72,8 +72,7 @@
*/
explicit ActionEnvironment(const IDMap& idMap, const std::string& deviceID,
Services& services) :
- idMap{idMap},
- deviceID{deviceID}, services{services}
+ idMap{idMap}, deviceID{deviceID}, services{services}
{}
/**
@@ -219,8 +218,8 @@
{
if (ruleDepth >= maxRuleDepth)
{
- throw std::runtime_error("Maximum rule depth exceeded by rule " +
- ruleID + '.');
+ throw std::runtime_error(
+ "Maximum rule depth exceeded by rule " + ruleID + '.');
}
++ruleDepth;
}
diff --git a/phosphor-regulators/src/actions/compare_vpd_action.hpp b/phosphor-regulators/src/actions/compare_vpd_action.hpp
index 110b8b5..e8538f4 100644
--- a/phosphor-regulators/src/actions/compare_vpd_action.hpp
+++ b/phosphor-regulators/src/actions/compare_vpd_action.hpp
@@ -55,8 +55,7 @@
explicit CompareVPDAction(const std::string& fru,
const std::string& keyword,
const std::vector<uint8_t>& value) :
- fru{fru},
- keyword{keyword}, value{value}
+ fru{fru}, keyword{keyword}, value{value}
{}
/**
diff --git a/phosphor-regulators/src/actions/i2c_compare_byte_action.hpp b/phosphor-regulators/src/actions/i2c_compare_byte_action.hpp
index 0459880..e5aab39 100644
--- a/phosphor-regulators/src/actions/i2c_compare_byte_action.hpp
+++ b/phosphor-regulators/src/actions/i2c_compare_byte_action.hpp
@@ -56,8 +56,7 @@
*/
explicit I2CCompareByteAction(uint8_t reg, uint8_t value,
uint8_t mask = 0xFF) :
- reg{reg},
- value{value}, mask{mask}
+ reg{reg}, value{value}, mask{mask}
{}
/**
diff --git a/phosphor-regulators/src/actions/i2c_compare_bytes_action.hpp b/phosphor-regulators/src/actions/i2c_compare_bytes_action.hpp
index 2fdd5ff..ba8ab20 100644
--- a/phosphor-regulators/src/actions/i2c_compare_bytes_action.hpp
+++ b/phosphor-regulators/src/actions/i2c_compare_bytes_action.hpp
@@ -81,8 +81,7 @@
explicit I2CCompareBytesAction(uint8_t reg,
const std::vector<uint8_t>& values,
const std::vector<uint8_t>& masks) :
- reg{reg},
- values{values}, masks{masks}
+ reg{reg}, values{values}, masks{masks}
{
// Values vector must not be empty
if (values.size() < 1)
diff --git a/phosphor-regulators/src/actions/i2c_write_byte_action.hpp b/phosphor-regulators/src/actions/i2c_write_byte_action.hpp
index 3f9e1f6..4bc291f 100644
--- a/phosphor-regulators/src/actions/i2c_write_byte_action.hpp
+++ b/phosphor-regulators/src/actions/i2c_write_byte_action.hpp
@@ -55,8 +55,7 @@
*/
explicit I2CWriteByteAction(uint8_t reg, uint8_t value,
uint8_t mask = 0xFF) :
- reg{reg},
- value{value}, mask{mask}
+ reg{reg}, value{value}, mask{mask}
{}
/**
diff --git a/phosphor-regulators/src/actions/i2c_write_bytes_action.hpp b/phosphor-regulators/src/actions/i2c_write_bytes_action.hpp
index edf2b2e..fdb5887 100644
--- a/phosphor-regulators/src/actions/i2c_write_bytes_action.hpp
+++ b/phosphor-regulators/src/actions/i2c_write_bytes_action.hpp
@@ -58,8 +58,7 @@
*/
explicit I2CWriteBytesAction(uint8_t reg,
const std::vector<uint8_t>& values) :
- reg{reg},
- values{values}, masks{}
+ reg{reg}, values{values}, masks{}
{
// Values vector must not be empty
if (values.size() < 1)
@@ -86,8 +85,7 @@
explicit I2CWriteBytesAction(uint8_t reg,
const std::vector<uint8_t>& values,
const std::vector<uint8_t>& masks) :
- reg{reg},
- values{values}, masks{masks}
+ reg{reg}, values{values}, masks{masks}
{
// Values vector must not be empty
if (values.size() < 1)
diff --git a/phosphor-regulators/src/actions/pmbus_read_sensor_action.cpp b/phosphor-regulators/src/actions/pmbus_read_sensor_action.cpp
index a94775d..896830c 100644
--- a/phosphor-regulators/src/actions/pmbus_read_sensor_action.cpp
+++ b/phosphor-regulators/src/actions/pmbus_read_sensor_action.cpp
@@ -49,8 +49,8 @@
break;
case pmbus_utils::SensorDataFormat::linear_16:
int8_t exponentValue = getExponentValue(environment, interface);
- sensorValue = pmbus_utils::convertFromVoutLinear(value,
- exponentValue);
+ sensorValue =
+ pmbus_utils::convertFromVoutLinear(value, exponentValue);
break;
}
diff --git a/phosphor-regulators/src/actions/pmbus_read_sensor_action.hpp b/phosphor-regulators/src/actions/pmbus_read_sensor_action.hpp
index 38c5d8f..12776a3 100644
--- a/phosphor-regulators/src/actions/pmbus_read_sensor_action.hpp
+++ b/phosphor-regulators/src/actions/pmbus_read_sensor_action.hpp
@@ -69,8 +69,7 @@
explicit PMBusReadSensorAction(SensorType type, uint8_t command,
pmbus_utils::SensorDataFormat format,
std::optional<int8_t> exponent) :
- type{type},
- command{command}, format{format}, exponent{exponent}
+ type{type}, command{command}, format{format}, exponent{exponent}
{}
/**
diff --git a/phosphor-regulators/src/actions/pmbus_write_vout_command_action.cpp b/phosphor-regulators/src/actions/pmbus_write_vout_command_action.cpp
index 55ed89d..ca1756f 100644
--- a/phosphor-regulators/src/actions/pmbus_write_vout_command_action.cpp
+++ b/phosphor-regulators/src/actions/pmbus_write_vout_command_action.cpp
@@ -41,8 +41,8 @@
int8_t exponentValue = getExponentValue(environment, interface);
// Convert volts value to linear data format
- uint16_t linearValue = pmbus_utils::convertToVoutLinear(voltsValue,
- exponentValue);
+ uint16_t linearValue =
+ pmbus_utils::convertToVoutLinear(voltsValue, exponentValue);
// Write linear format value to VOUT_COMMAND. I2CInterface method
// writes low-order byte first as required by PMBus.
diff --git a/phosphor-regulators/src/actions/pmbus_write_vout_command_action.hpp b/phosphor-regulators/src/actions/pmbus_write_vout_command_action.hpp
index e77ced1..e15d032 100644
--- a/phosphor-regulators/src/actions/pmbus_write_vout_command_action.hpp
+++ b/phosphor-regulators/src/actions/pmbus_write_vout_command_action.hpp
@@ -87,12 +87,11 @@
* @param isVerified Specifies whether the updated value of VOUT_COMMAND is
* verified by reading it from the device.
*/
- explicit PMBusWriteVoutCommandAction(std::optional<double> volts,
- pmbus_utils::VoutDataFormat format,
- std::optional<int8_t> exponent,
- bool isVerified) :
- volts{volts},
- format{format}, exponent{exponent}, isWriteVerified{isVerified}
+ explicit PMBusWriteVoutCommandAction(
+ std::optional<double> volts, pmbus_utils::VoutDataFormat format,
+ std::optional<int8_t> exponent, bool isVerified) :
+ volts{volts}, format{format}, exponent{exponent},
+ isWriteVerified{isVerified}
{
// Currently only linear format is supported
if (format != pmbus_utils::VoutDataFormat::linear)
diff --git a/phosphor-regulators/src/chassis.cpp b/phosphor-regulators/src/chassis.cpp
index a8c8ed6..585063f 100644
--- a/phosphor-regulators/src/chassis.cpp
+++ b/phosphor-regulators/src/chassis.cpp
@@ -51,8 +51,8 @@
void Chassis::closeDevices(Services& services)
{
// Log debug message in journal
- services.getJournal().logDebug("Closing devices in chassis " +
- std::to_string(number));
+ services.getJournal().logDebug(
+ "Closing devices in chassis " + std::to_string(number));
// Close devices
for (std::unique_ptr<Device>& device : devices)
@@ -64,8 +64,8 @@
void Chassis::configure(Services& services, System& system)
{
// Log info message in journal; important for verifying success of boot
- services.getJournal().logInfo("Configuring chassis " +
- std::to_string(number));
+ services.getJournal().logInfo(
+ "Configuring chassis " + std::to_string(number));
// Configure devices
for (std::unique_ptr<Device>& device : devices)
diff --git a/phosphor-regulators/src/chassis.hpp b/phosphor-regulators/src/chassis.hpp
index dc86ed0..e14e74c 100644
--- a/phosphor-regulators/src/chassis.hpp
+++ b/phosphor-regulators/src/chassis.hpp
@@ -69,13 +69,13 @@
explicit Chassis(unsigned int number, const std::string& inventoryPath,
std::vector<std::unique_ptr<Device>> devices =
std::vector<std::unique_ptr<Device>>{}) :
- number{number},
- inventoryPath{inventoryPath}, devices{std::move(devices)}
+ number{number}, inventoryPath{inventoryPath},
+ devices{std::move(devices)}
{
if (number < 1)
{
- throw std::invalid_argument{"Invalid chassis number: " +
- std::to_string(number)};
+ throw std::invalid_argument{
+ "Invalid chassis number: " + std::to_string(number)};
}
}
diff --git a/phosphor-regulators/src/config_file_parser.cpp b/phosphor-regulators/src/config_file_parser.cpp
index ede608b..4bb8bd8 100644
--- a/phosphor-regulators/src/config_file_parser.cpp
+++ b/phosphor-regulators/src/config_file_parser.cpp
@@ -214,8 +214,8 @@
++propertyCount;
// Required inventory_path property
- const json& inventoryPathElement = getRequiredProperty(element,
- "inventory_path");
+ const json& inventoryPathElement =
+ getRequiredProperty(element, "inventory_path");
std::string inventoryPath = parseInventoryPath(inventoryPathElement);
++propertyCount;
@@ -356,8 +356,8 @@
++propertyCount;
// Required is_regulator property
- const json& isRegulatorElement = getRequiredProperty(element,
- "is_regulator");
+ const json& isRegulatorElement =
+ getRequiredProperty(element, "is_regulator");
bool isRegulator = parseBoolean(isRegulatorElement);
++propertyCount;
@@ -367,8 +367,8 @@
++propertyCount;
// Required i2c_interface property
- const json& i2cInterfaceElement = getRequiredProperty(element,
- "i2c_interface");
+ const json& i2cInterfaceElement =
+ getRequiredProperty(element, "i2c_interface");
std::unique_ptr<i2c::I2CInterface> i2cInterface =
parseI2CInterface(i2cInterfaceElement);
++propertyCount;
diff --git a/phosphor-regulators/src/configuration.hpp b/phosphor-regulators/src/configuration.hpp
index d0f7a44..d802665 100644
--- a/phosphor-regulators/src/configuration.hpp
+++ b/phosphor-regulators/src/configuration.hpp
@@ -72,8 +72,7 @@
*/
explicit Configuration(std::optional<double> volts,
std::vector<std::unique_ptr<Action>> actions) :
- volts{volts},
- actions{std::move(actions)}
+ volts{volts}, actions{std::move(actions)}
{}
/**
diff --git a/phosphor-regulators/src/dbus_sensor.cpp b/phosphor-regulators/src/dbus_sensor.cpp
index 31932b2..8dd760a 100644
--- a/phosphor-regulators/src/dbus_sensor.cpp
+++ b/phosphor-regulators/src/dbus_sensor.cpp
@@ -70,8 +70,7 @@
SensorType type, double value, const std::string& rail,
const std::string& deviceInventoryPath,
const std::string& chassisInventoryPath) :
- bus{bus},
- name{name}, type{type}, rail{rail}
+ bus{bus}, name{name}, type{type}, rail{rail}
{
// Get sensor properties that are based on the sensor type
std::string objectPath;
diff --git a/phosphor-regulators/src/dbus_sensor.hpp b/phosphor-regulators/src/dbus_sensor.hpp
index 1a4bfe0..e5898de 100644
--- a/phosphor-regulators/src/dbus_sensor.hpp
+++ b/phosphor-regulators/src/dbus_sensor.hpp
@@ -64,10 +64,9 @@
* Define simple name for the sdbusplus object_t class that implements all
* the necessary D-Bus interfaces via templates/multiple inheritance.
*/
-using DBusSensorObject =
- sdbusplus::server::object_t<ValueInterface, OperationalStatusInterface,
- AvailabilityInterface,
- AssociationDefinitionsInterface>;
+using DBusSensorObject = sdbusplus::server::object_t<
+ ValueInterface, OperationalStatusInterface, AvailabilityInterface,
+ AssociationDefinitionsInterface>;
/**
* Define simple name for the generated C++ enum that implements the
diff --git a/phosphor-regulators/src/dbus_sensors.cpp b/phosphor-regulators/src/dbus_sensors.cpp
index c9b4c2b..446815c 100644
--- a/phosphor-regulators/src/dbus_sensors.cpp
+++ b/phosphor-regulators/src/dbus_sensors.cpp
@@ -92,9 +92,9 @@
else
{
// Sensor doesn't exist; create it and add it to the map
- auto sensor = std::make_unique<DBusSensor>(bus, sensorName, type, value,
- rail, deviceInventoryPath,
- chassisInventoryPath);
+ auto sensor = std::make_unique<DBusSensor>(
+ bus, sensorName, type, value, rail, deviceInventoryPath,
+ chassisInventoryPath);
sensors.emplace(sensorName, std::move(sensor));
}
}
diff --git a/phosphor-regulators/src/device.hpp b/phosphor-regulators/src/device.hpp
index 1815680..88e3075 100644
--- a/phosphor-regulators/src/device.hpp
+++ b/phosphor-regulators/src/device.hpp
@@ -72,8 +72,7 @@
std::unique_ptr<PhaseFaultDetection> phaseFaultDetection = nullptr,
std::vector<std::unique_ptr<Rail>> rails =
std::vector<std::unique_ptr<Rail>>{}) :
- id{id},
- isRegulatorDevice{isRegulator}, fru{fru},
+ id{id}, isRegulatorDevice{isRegulator}, fru{fru},
i2cInterface{std::move(i2cInterface)},
presenceDetection{std::move(presenceDetection)},
configuration{std::move(configuration)},
diff --git a/phosphor-regulators/src/ffdc_file.cpp b/phosphor-regulators/src/ffdc_file.cpp
index 7f528d6..a3c3ad2 100644
--- a/phosphor-regulators/src/ffdc_file.cpp
+++ b/phosphor-regulators/src/ffdc_file.cpp
@@ -35,8 +35,8 @@
int fd = open(tempFile.getPath().c_str(), O_RDWR);
if (fd == -1)
{
- throw std::runtime_error{std::string{"Unable to open FFDC file: "} +
- strerror(errno)};
+ throw std::runtime_error{
+ std::string{"Unable to open FFDC file: "} + strerror(errno)};
}
// Store file descriptor in FileDescriptor object
@@ -49,8 +49,8 @@
// Returns -1 if close failed.
if (descriptor.close() == -1)
{
- throw std::runtime_error{std::string{"Unable to close FFDC file: "} +
- strerror(errno)};
+ throw std::runtime_error{
+ std::string{"Unable to close FFDC file: "} + strerror(errno)};
}
// Delete temporary file. Does nothing if file was already deleted.
diff --git a/phosphor-regulators/src/id_map.cpp b/phosphor-regulators/src/id_map.cpp
index 0f7d3ac..f5132b2 100644
--- a/phosphor-regulators/src/id_map.cpp
+++ b/phosphor-regulators/src/id_map.cpp
@@ -28,8 +28,8 @@
const std::string& id = device.getID();
if (deviceMap.count(id) != 0)
{
- throw std::invalid_argument{"Unable to add device: Duplicate ID \"" +
- id + '"'};
+ throw std::invalid_argument{
+ "Unable to add device: Duplicate ID \"" + id + '"'};
}
deviceMap[id] = &device;
}
@@ -39,8 +39,8 @@
const std::string& id = rail.getID();
if (railMap.count(id) != 0)
{
- throw std::invalid_argument{"Unable to add rail: Duplicate ID \"" + id +
- '"'};
+ throw std::invalid_argument{
+ "Unable to add rail: Duplicate ID \"" + id + '"'};
}
railMap[id] = &rail;
}
@@ -50,8 +50,8 @@
const std::string& id = rule.getID();
if (ruleMap.count(id) != 0)
{
- throw std::invalid_argument{"Unable to add rule: Duplicate ID \"" + id +
- '"'};
+ throw std::invalid_argument{
+ "Unable to add rule: Duplicate ID \"" + id + '"'};
}
ruleMap[id] = &rule;
}
diff --git a/phosphor-regulators/src/id_map.hpp b/phosphor-regulators/src/id_map.hpp
index c466f23..1da7433 100644
--- a/phosphor-regulators/src/id_map.hpp
+++ b/phosphor-regulators/src/id_map.hpp
@@ -84,8 +84,8 @@
auto it = deviceMap.find(id);
if (it == deviceMap.end())
{
- throw std::invalid_argument{"Unable to find device with ID \"" +
- id + '"'};
+ throw std::invalid_argument{
+ "Unable to find device with ID \"" + id + '"'};
}
return *(it->second);
}
@@ -103,8 +103,8 @@
auto it = railMap.find(id);
if (it == railMap.end())
{
- throw std::invalid_argument{"Unable to find rail with ID \"" + id +
- '"'};
+ throw std::invalid_argument{
+ "Unable to find rail with ID \"" + id + '"'};
}
return *(it->second);
}
@@ -122,8 +122,8 @@
auto it = ruleMap.find(id);
if (it == ruleMap.end())
{
- throw std::invalid_argument{"Unable to find rule with ID \"" + id +
- '"'};
+ throw std::invalid_argument{
+ "Unable to find rule with ID \"" + id + '"'};
}
return *(it->second);
}
diff --git a/phosphor-regulators/src/journal.cpp b/phosphor-regulators/src/journal.cpp
index 716a999..94a9f52 100644
--- a/phosphor-regulators/src/journal.cpp
+++ b/phosphor-regulators/src/journal.cpp
@@ -54,9 +54,8 @@
sd_journal* journal{nullptr};
};
-std::vector<std::string>
- SystemdJournal::getMessages(const std::string& field,
- const std::string& fieldValue, unsigned int max)
+std::vector<std::string> SystemdJournal::getMessages(
+ const std::string& field, const std::string& fieldValue, unsigned int max)
{
// Sleep 100ms; otherwise recent journal entries sometimes not available
using namespace std::chrono_literals;
@@ -67,8 +66,8 @@
int rc = sd_journal_open(&journal, SD_JOURNAL_LOCAL_ONLY);
if (rc < 0)
{
- throw std::runtime_error{std::string{"Failed to open journal: "} +
- strerror(-rc)};
+ throw std::runtime_error{
+ std::string{"Failed to open journal: "} + strerror(-rc)};
}
// Create object to automatically close journal
@@ -79,8 +78,8 @@
rc = sd_journal_add_match(journal, match.c_str(), 0);
if (rc < 0)
{
- throw std::runtime_error{std::string{"Failed to add journal match: "} +
- strerror(-rc)};
+ throw std::runtime_error{
+ std::string{"Failed to add journal match: "} + strerror(-rc)};
}
// Loop through matching entries from newest to oldest
diff --git a/phosphor-regulators/src/journal.hpp b/phosphor-regulators/src/journal.hpp
index 2199c8c..c004031 100644
--- a/phosphor-regulators/src/journal.hpp
+++ b/phosphor-regulators/src/journal.hpp
@@ -55,9 +55,9 @@
* matching messages.
* @return matching messages from the journal
*/
- virtual std::vector<std::string> getMessages(const std::string& field,
- const std::string& fieldValue,
- unsigned int max = 0) = 0;
+ virtual std::vector<std::string>
+ getMessages(const std::string& field, const std::string& fieldValue,
+ unsigned int max = 0) = 0;
/**
* Logs a debug message in the system journal.
@@ -119,9 +119,9 @@
virtual ~SystemdJournal() = default;
/** @copydoc Journal::getMessages() */
- virtual std::vector<std::string> getMessages(const std::string& field,
- const std::string& fieldValue,
- unsigned int max) override;
+ virtual std::vector<std::string>
+ getMessages(const std::string& field, const std::string& fieldValue,
+ unsigned int max) override;
/** @copydoc Journal::logDebug(const std::string&) */
virtual void logDebug(const std::string& message) override
diff --git a/phosphor-regulators/src/manager.cpp b/phosphor-regulators/src/manager.cpp
index b08c96b..bd16776 100644
--- a/phosphor-regulators/src/manager.cpp
+++ b/phosphor-regulators/src/manager.cpp
@@ -321,8 +321,8 @@
if (!pathName.empty())
{
// Log info message in journal; config file path is important
- services.getJournal().logInfo("Loading configuration file " +
- pathName.string());
+ services.getJournal().logInfo(
+ "Loading configuration file " + pathName.string());
// Parse the config file
std::vector<std::unique_ptr<Rule>> rules{};
@@ -331,8 +331,8 @@
// Store config file information in a new System object. The old
// System object, if any, is automatically deleted.
- system = std::make_unique<System>(std::move(rules),
- std::move(chassis));
+ system =
+ std::make_unique<System>(std::move(rules), std::move(chassis));
}
}
catch (const std::exception& e)
diff --git a/phosphor-regulators/src/phase_fault_detection.cpp b/phosphor-regulators/src/phase_fault_detection.cpp
index 4ca276b..f501d9d 100644
--- a/phosphor-regulators/src/phase_fault_detection.cpp
+++ b/phosphor-regulators/src/phase_fault_detection.cpp
@@ -83,10 +83,9 @@
}
}
-void PhaseFaultDetection::checkForPhaseFault(PhaseFaultType faultType,
- Services& services,
- Device& regulator,
- ActionEnvironment& environment)
+void PhaseFaultDetection::checkForPhaseFault(
+ PhaseFaultType faultType, Services& services, Device& regulator,
+ ActionEnvironment& environment)
{
// Find ErrorType that corresponds to PhaseFaultType; used by ErrorHistory
ErrorType errorType = toErrorType(faultType);
diff --git a/phosphor-regulators/src/phase_fault_detection.hpp b/phosphor-regulators/src/phase_fault_detection.hpp
index 6a84102..2c286b6 100644
--- a/phosphor-regulators/src/phase_fault_detection.hpp
+++ b/phosphor-regulators/src/phase_fault_detection.hpp
@@ -77,8 +77,7 @@
*/
explicit PhaseFaultDetection(std::vector<std::unique_ptr<Action>> actions,
const std::string& deviceID = "") :
- actions{std::move(actions)},
- deviceID{deviceID}
+ actions{std::move(actions)}, deviceID{deviceID}
{}
/**
diff --git a/phosphor-regulators/src/pmbus_error.hpp b/phosphor-regulators/src/pmbus_error.hpp
index ac2a0a5..b901457 100644
--- a/phosphor-regulators/src/pmbus_error.hpp
+++ b/phosphor-regulators/src/pmbus_error.hpp
@@ -47,8 +47,8 @@
*/
explicit PMBusError(const std::string& error, const std::string& deviceID,
const std::string& inventoryPath) :
- error{"PMBusError: " + error},
- deviceID{deviceID}, inventoryPath{inventoryPath}
+ error{"PMBusError: " + error}, deviceID{deviceID},
+ inventoryPath{inventoryPath}
{}
/**
diff --git a/phosphor-regulators/src/presence_detection.cpp b/phosphor-regulators/src/presence_detection.cpp
index 74c241b..7d4ac92 100644
--- a/phosphor-regulators/src/presence_detection.cpp
+++ b/phosphor-regulators/src/presence_detection.cpp
@@ -52,8 +52,8 @@
{
// Log error messages in journal
services.getJournal().logError(exception_utils::getMessages(e));
- services.getJournal().logError("Unable to determine presence of " +
- device.getID());
+ services.getJournal().logError(
+ "Unable to determine presence of " + device.getID());
// Create error log entry
error_logging_utils::logError(std::current_exception(),
diff --git a/phosphor-regulators/src/rail.hpp b/phosphor-regulators/src/rail.hpp
index 70b3e3d..5877bc0 100644
--- a/phosphor-regulators/src/rail.hpp
+++ b/phosphor-regulators/src/rail.hpp
@@ -61,8 +61,7 @@
const std::string& id,
std::unique_ptr<Configuration> configuration = nullptr,
std::unique_ptr<SensorMonitoring> sensorMonitoring = nullptr) :
- id{id},
- configuration{std::move(configuration)},
+ id{id}, configuration{std::move(configuration)},
sensorMonitoring{std::move(sensorMonitoring)}
{}
diff --git a/phosphor-regulators/src/regsctl/main.cpp b/phosphor-regulators/src/regsctl/main.cpp
index 6f03016..9f65c8b 100644
--- a/phosphor-regulators/src/regsctl/main.cpp
+++ b/phosphor-regulators/src/regsctl/main.cpp
@@ -39,12 +39,12 @@
// Add dbus methods group
auto methods = app.add_option_group("Methods");
// Configure method
- CLI::App* config = methods->add_subcommand("config",
- "Configure regulators");
+ CLI::App* config =
+ methods->add_subcommand("config", "Configure regulators");
config->set_help_flag("-h,--help", "Configure regulators method help");
// Monitor method
- CLI::App* monitor = methods->add_subcommand("monitor",
- "Monitor regulators");
+ CLI::App* monitor =
+ methods->add_subcommand("monitor", "Monitor regulators");
monitor->set_help_flag("-h,--help", "Monitor regulators method help");
monitor->add_flag("-e,--enable", monitorEnable,
"Enable regulator monitoring");
diff --git a/phosphor-regulators/src/regsctl/utility.hpp b/phosphor-regulators/src/regsctl/utility.hpp
index b64eab5..b1a1418 100644
--- a/phosphor-regulators/src/regsctl/utility.hpp
+++ b/phosphor-regulators/src/regsctl/utility.hpp
@@ -23,8 +23,8 @@
auto callMethod(const std::string& method, Args&&... args)
{
auto bus = sdbusplus::bus::new_default();
- auto reqMsg = bus.new_method_call(busName, objPath, interface,
- method.c_str());
+ auto reqMsg =
+ bus.new_method_call(busName, objPath, interface, method.c_str());
reqMsg.append(std::forward<Args>(args)...);
// Set timeout to 6 minutes; some regulator methods take over 5 minutes
diff --git a/phosphor-regulators/src/rule.hpp b/phosphor-regulators/src/rule.hpp
index ddfaa62..f774af8 100644
--- a/phosphor-regulators/src/rule.hpp
+++ b/phosphor-regulators/src/rule.hpp
@@ -58,8 +58,7 @@
*/
explicit Rule(const std::string& id,
std::vector<std::unique_ptr<Action>> actions) :
- id{id},
- actions{std::move(actions)}
+ id{id}, actions{std::move(actions)}
{}
/**
diff --git a/phosphor-regulators/src/system.hpp b/phosphor-regulators/src/system.hpp
index accd7f0..02a33eb 100644
--- a/phosphor-regulators/src/system.hpp
+++ b/phosphor-regulators/src/system.hpp
@@ -54,8 +54,7 @@
*/
explicit System(std::vector<std::unique_ptr<Rule>> rules,
std::vector<std::unique_ptr<Chassis>> chassis) :
- rules{std::move(rules)},
- chassis{std::move(chassis)}
+ rules{std::move(rules)}, chassis{std::move(chassis)}
{
buildIDMap();
}
diff --git a/phosphor-regulators/src/write_verification_error.hpp b/phosphor-regulators/src/write_verification_error.hpp
index 6a7420d..4a42187 100644
--- a/phosphor-regulators/src/write_verification_error.hpp
+++ b/phosphor-regulators/src/write_verification_error.hpp
@@ -51,8 +51,8 @@
explicit WriteVerificationError(const std::string& error,
const std::string& deviceID,
const std::string& inventoryPath) :
- error{"WriteVerificationError: " + error},
- deviceID{deviceID}, inventoryPath{inventoryPath}
+ error{"WriteVerificationError: " + error}, deviceID{deviceID},
+ inventoryPath{inventoryPath}
{}
/**
diff --git a/phosphor-regulators/test/actions/compare_vpd_action_tests.cpp b/phosphor-regulators/test/actions/compare_vpd_action_tests.cpp
index c90c09e..ce661c3 100644
--- a/phosphor-regulators/test/actions/compare_vpd_action_tests.cpp
+++ b/phosphor-regulators/test/actions/compare_vpd_action_tests.cpp
@@ -216,10 +216,11 @@
CompareVPDAction action{
"/xyz/openbmc_project/inventory/system/chassis/disk_backplane",
"CCIN", std::vector<uint8_t>{0x01, 0xA3, 0x0, 0xFF}};
- EXPECT_EQ(action.toString(), "compare_vpd: { fru: "
- "/xyz/openbmc_project/inventory/system/"
- "chassis/disk_backplane, keyword: "
- "CCIN, value: [ 0x1, 0xA3, 0x0, 0xFF ] }");
+ EXPECT_EQ(action.toString(),
+ "compare_vpd: { fru: "
+ "/xyz/openbmc_project/inventory/system/"
+ "chassis/disk_backplane, keyword: "
+ "CCIN, value: [ 0x1, 0xA3, 0x0, 0xFF ] }");
}
// Test where value vector is empty
@@ -227,9 +228,10 @@
CompareVPDAction action{
"/xyz/openbmc_project/inventory/system/chassis/disk_backplane",
"CCIN", std::vector<uint8_t>{}};
- EXPECT_EQ(action.toString(), "compare_vpd: { fru: "
- "/xyz/openbmc_project/inventory/system/"
- "chassis/disk_backplane, keyword: "
- "CCIN, value: [ ] }");
+ EXPECT_EQ(action.toString(),
+ "compare_vpd: { fru: "
+ "/xyz/openbmc_project/inventory/system/"
+ "chassis/disk_backplane, keyword: "
+ "CCIN, value: [ ] }");
}
}
diff --git a/phosphor-regulators/test/actions/i2c_compare_bit_action_tests.cpp b/phosphor-regulators/test/actions/i2c_compare_bit_action_tests.cpp
index 609026e..165b57b 100644
--- a/phosphor-regulators/test/actions/i2c_compare_bit_action_tests.cpp
+++ b/phosphor-regulators/test/actions/i2c_compare_bit_action_tests.cpp
@@ -109,14 +109,15 @@
// Test where actual bit value is equal to expected bit value.
// Test all bits in register value 0x96 == 1001 0110).
{
- I2CCompareBitAction actions[] = {I2CCompareBitAction{0x7C, 7, 1},
- I2CCompareBitAction{0x7C, 6, 0},
- I2CCompareBitAction{0x7C, 5, 0},
- I2CCompareBitAction{0x7C, 4, 1},
- I2CCompareBitAction{0x7C, 3, 0},
- I2CCompareBitAction{0x7C, 2, 1},
- I2CCompareBitAction{0x7C, 1, 1},
- I2CCompareBitAction{0x7C, 0, 0}};
+ I2CCompareBitAction actions[] = {
+ I2CCompareBitAction{0x7C, 7, 1},
+ I2CCompareBitAction{0x7C, 6, 0},
+ I2CCompareBitAction{0x7C, 5, 0},
+ I2CCompareBitAction{0x7C, 4, 1},
+ I2CCompareBitAction{0x7C, 3, 0},
+ I2CCompareBitAction{0x7C, 2, 1},
+ I2CCompareBitAction{0x7C, 1, 1},
+ I2CCompareBitAction{0x7C, 0, 0}};
for (I2CCompareBitAction& action : actions)
{
EXPECT_EQ(action.execute(env), true);
@@ -126,14 +127,15 @@
// Test where actual bit value is not equal to expected bit value.
// Test all bits in register value 0x96 == 1001 0110).
{
- I2CCompareBitAction actions[] = {I2CCompareBitAction{0x7C, 7, 0},
- I2CCompareBitAction{0x7C, 6, 1},
- I2CCompareBitAction{0x7C, 5, 1},
- I2CCompareBitAction{0x7C, 4, 0},
- I2CCompareBitAction{0x7C, 3, 1},
- I2CCompareBitAction{0x7C, 2, 0},
- I2CCompareBitAction{0x7C, 1, 0},
- I2CCompareBitAction{0x7C, 0, 1}};
+ I2CCompareBitAction actions[] = {
+ I2CCompareBitAction{0x7C, 7, 0},
+ I2CCompareBitAction{0x7C, 6, 1},
+ I2CCompareBitAction{0x7C, 5, 1},
+ I2CCompareBitAction{0x7C, 4, 0},
+ I2CCompareBitAction{0x7C, 3, 1},
+ I2CCompareBitAction{0x7C, 2, 0},
+ I2CCompareBitAction{0x7C, 1, 0},
+ I2CCompareBitAction{0x7C, 0, 1}};
for (I2CCompareBitAction& action : actions)
{
EXPECT_EQ(action.execute(env), false);
diff --git a/phosphor-regulators/test/actions/set_device_action_tests.cpp b/phosphor-regulators/test/actions/set_device_action_tests.cpp
index 139abd1..2651f13 100644
--- a/phosphor-regulators/test/actions/set_device_action_tests.cpp
+++ b/phosphor-regulators/test/actions/set_device_action_tests.cpp
@@ -53,8 +53,8 @@
idMap.addDevice(reg1);
// Create Device regulator2 and add to IDMap
- i2cInterface = i2c::create(1, 0x72,
- i2c::I2CInterface::InitialState::CLOSED);
+ i2cInterface =
+ i2c::create(1, 0x72, i2c::I2CInterface::InitialState::CLOSED);
Device reg2{
"regulator2", true,
"/xyz/openbmc_project/inventory/system/chassis/motherboard/reg2",
diff --git a/phosphor-regulators/test/chassis_tests.cpp b/phosphor-regulators/test/chassis_tests.cpp
index 7963430..f5892bf 100644
--- a/phosphor-regulators/test/chassis_tests.cpp
+++ b/phosphor-regulators/test/chassis_tests.cpp
@@ -293,11 +293,11 @@
EXPECT_CALL(*i2cInterface, close).Times(1);
// Create Device
- auto device =
- std::make_unique<Device>("vdd0_reg", true,
- "/xyz/openbmc_project/inventory/"
- "system/chassis/motherboard/vdd0_reg",
- std::move(i2cInterface));
+ auto device = std::make_unique<Device>(
+ "vdd0_reg", true,
+ "/xyz/openbmc_project/inventory/"
+ "system/chassis/motherboard/vdd0_reg",
+ std::move(i2cInterface));
devices.emplace_back(std::move(device));
}
@@ -309,11 +309,11 @@
EXPECT_CALL(*i2cInterface, close).Times(1);
// Create Device
- auto device =
- std::make_unique<Device>("vdd1_reg", true,
- "/xyz/openbmc_project/inventory/"
- "system/chassis/motherboard/vdd1_reg",
- std::move(i2cInterface));
+ auto device = std::make_unique<Device>(
+ "vdd1_reg", true,
+ "/xyz/openbmc_project/inventory/"
+ "system/chassis/motherboard/vdd1_reg",
+ std::move(i2cInterface));
devices.emplace_back(std::move(device));
}
diff --git a/phosphor-regulators/test/device_tests.cpp b/phosphor-regulators/test/device_tests.cpp
index 5aaa2fe..021a02a 100644
--- a/phosphor-regulators/test/device_tests.cpp
+++ b/phosphor-regulators/test/device_tests.cpp
@@ -74,8 +74,8 @@
std::vector<std::unique_ptr<Rule>> rules{};
std::vector<std::unique_ptr<Chassis>> chassisVec{};
chassisVec.emplace_back(std::move(chassis));
- this->system = std::make_unique<System>(std::move(rules),
- std::move(chassisVec));
+ this->system =
+ std::make_unique<System>(std::move(rules), std::move(chassisVec));
}
protected:
@@ -455,8 +455,8 @@
EXPECT_CALL(*action, execute).Times(0);
std::vector<std::unique_ptr<Action>> actions{};
actions.emplace_back(std::move(action));
- configuration = std::make_unique<Configuration>(volts,
- std::move(actions));
+ configuration =
+ std::make_unique<Configuration>(volts, std::move(actions));
}
// Create Device
@@ -516,8 +516,8 @@
std::make_unique<Configuration>(volts, std::move(actions));
// Create Rail
- auto rail = std::make_unique<Rail>("vdd0",
- std::move(configuration));
+ auto rail =
+ std::make_unique<Rail>("vdd0", std::move(configuration));
rails.emplace_back(std::move(rail));
}
@@ -533,8 +533,8 @@
std::make_unique<Configuration>(volts, std::move(actions));
// Create Rail
- auto rail = std::make_unique<Rail>("vio0",
- std::move(configuration));
+ auto rail =
+ std::make_unique<Rail>("vio0", std::move(configuration));
rails.emplace_back(std::move(rail));
}
diff --git a/phosphor-regulators/test/id_map_tests.cpp b/phosphor-regulators/test/id_map_tests.cpp
index 6c8d1ca..15ace68 100644
--- a/phosphor-regulators/test/id_map_tests.cpp
+++ b/phosphor-regulators/test/id_map_tests.cpp
@@ -68,8 +68,8 @@
// Test where device ID already exists in map
try
{
- i2cInterface = i2c::create(1, 0x72,
- i2c::I2CInterface::InitialState::CLOSED);
+ i2cInterface =
+ i2c::create(1, 0x72, i2c::I2CInterface::InitialState::CLOSED);
Device device2{"vio_reg", true,
"/xyz/openbmc_project/inventory/system/chassis/"
"motherboard/vio_reg2",
diff --git a/phosphor-regulators/test/phase_fault_detection_tests.cpp b/phosphor-regulators/test/phase_fault_detection_tests.cpp
index d7fa5f3..c85970c 100644
--- a/phosphor-regulators/test/phase_fault_detection_tests.cpp
+++ b/phosphor-regulators/test/phase_fault_detection_tests.cpp
@@ -108,8 +108,8 @@
std::vector<std::unique_ptr<Rule>> rules{};
std::vector<std::unique_ptr<Chassis>> chassisVec{};
chassisVec.emplace_back(std::move(chassis));
- this->system = std::make_unique<System>(std::move(rules),
- std::move(chassisVec));
+ this->system =
+ std::make_unique<System>(std::move(rules), std::move(chassisVec));
}
protected:
diff --git a/phosphor-regulators/test/system_tests.cpp b/phosphor-regulators/test/system_tests.cpp
index 6cff029..1ea34b3 100644
--- a/phosphor-regulators/test/system_tests.cpp
+++ b/phosphor-regulators/test/system_tests.cpp
@@ -102,8 +102,8 @@
// Create Chassis that contains Device
std::vector<std::unique_ptr<Device>> devices{};
devices.emplace_back(std::move(device));
- auto chassis = std::make_unique<Chassis>(1, chassisInvPath,
- std::move(devices));
+ auto chassis =
+ std::make_unique<Chassis>(1, chassisInvPath, std::move(devices));
Chassis* chassisPtr = chassis.get();
// Create System that contains Chassis
@@ -157,8 +157,8 @@
// Create Chassis that contains Device
std::vector<std::unique_ptr<Device>> devices{};
devices.emplace_back(std::move(device));
- auto chassis = std::make_unique<Chassis>(1, chassisInvPath,
- std::move(devices));
+ auto chassis =
+ std::make_unique<Chassis>(1, chassisInvPath, std::move(devices));
// Create System that contains Chassis
std::vector<std::unique_ptr<Rule>> rules{};
diff --git a/phosphor-regulators/test/test_utils.hpp b/phosphor-regulators/test/test_utils.hpp
index e04dd6d..b3df87a 100644
--- a/phosphor-regulators/test/test_utils.hpp
+++ b/phosphor-regulators/test/test_utils.hpp
@@ -55,9 +55,8 @@
* @param railIDs rail IDs (optional)
* @return Device object
*/
-inline std::unique_ptr<Device>
- createDevice(const std::string& id,
- const std::vector<std::string>& railIDs = {})
+inline std::unique_ptr<Device> createDevice(
+ const std::string& id, const std::vector<std::string>& railIDs = {})
{
// Create Rails (if any)
std::vector<std::unique_ptr<Rail>> rails{};
diff --git a/pmbus.cpp b/pmbus.cpp
index 9424ee6..de387d6 100644
--- a/pmbus.cpp
+++ b/pmbus.cpp
@@ -151,11 +151,11 @@
{
auto rc = errno;
- log<level::ERR>((std::string("Failed to read sysfs file "
- "errno=") +
- std::to_string(rc) + std::string(" FILENAME=") +
- path.string())
- .c_str());
+ log<level::ERR>(
+ (std::string("Failed to read sysfs file "
+ "errno=") +
+ std::to_string(rc) + std::string(" FILENAME=") + path.string())
+ .c_str());
using metadata = xyz::openbmc_project::Common::Device::ReadFailure;
@@ -261,8 +261,8 @@
{
std::vector<uint8_t> data(length, 0);
- auto bytes = fread(data.data(), sizeof(decltype(data[0])), length,
- file.get());
+ auto bytes =
+ fread(data.data(), sizeof(decltype(data[0])), length, file.get());
if (bytes != length)
{
@@ -274,11 +274,11 @@
else if (ferror(file.get()))
{
auto rc = errno;
- log<level::ERR>((std::string("Failed to read sysfs file "
- "errno=") +
- std::to_string(rc) +
- " FILENAME=" + path.string())
- .c_str());
+ log<level::ERR>(
+ (std::string("Failed to read sysfs file "
+ "errno=") +
+ std::to_string(rc) + " FILENAME=" + path.string())
+ .c_str());
using metadata =
xyz::openbmc_project::Common::Device::ReadFailure;
@@ -397,11 +397,11 @@
}
}
-std::unique_ptr<PMBusBase> PMBus::createPMBus(std::uint8_t bus,
- const std::string& address)
+std::unique_ptr<PMBusBase>
+ PMBus::createPMBus(std::uint8_t bus, const std::string& address)
{
- const std::string physpath = {"/sys/bus/i2c/devices/" +
- std::to_string(bus) + "-" + address};
+ const std::string physpath = {
+ "/sys/bus/i2c/devices/" + std::to_string(bus) + "-" + address};
auto interface = std::make_unique<PMBus>(physpath);
return interface;
diff --git a/pmbus.hpp b/pmbus.hpp
index ecf7377..c798f51 100644
--- a/pmbus.hpp
+++ b/pmbus.hpp
@@ -237,8 +237,7 @@
*/
PMBus(const std::string& path, const std::string& driverName,
size_t instance) :
- basePath(path),
- driverName(driverName), instance(instance)
+ basePath(path), driverName(driverName), instance(instance)
{
findHwmonDir();
}
@@ -251,8 +250,8 @@
*
* @return PMBusBase pointer
*/
- static std::unique_ptr<PMBusBase> createPMBus(std::uint8_t bus,
- const std::string& address);
+ static std::unique_ptr<PMBusBase>
+ createPMBus(std::uint8_t bus, const std::string& address);
/**
* Reads a file in sysfs that represents a single bit,
diff --git a/power-sequencer/pgood_monitor.hpp b/power-sequencer/pgood_monitor.hpp
index 85c20bf..2d0935d 100644
--- a/power-sequencer/pgood_monitor.hpp
+++ b/power-sequencer/pgood_monitor.hpp
@@ -45,8 +45,7 @@
PGOODMonitor(std::unique_ptr<phosphor::power::Device>&& d,
sdbusplus::bus_t& b, const sdeventplus::Event& e,
std::chrono::milliseconds& t) :
- DeviceMonitor(std::move(d), e, t),
- bus(b)
+ DeviceMonitor(std::move(d), e, t), bus(b)
{}
/**
diff --git a/power-sequencer/runtime_monitor.hpp b/power-sequencer/runtime_monitor.hpp
index a194d2e..986d128 100644
--- a/power-sequencer/runtime_monitor.hpp
+++ b/power-sequencer/runtime_monitor.hpp
@@ -51,10 +51,10 @@
RuntimeMonitor(std::unique_ptr<phosphor::power::Device>&& d,
sdbusplus::bus_t& b, const sdeventplus::Event& e,
std::chrono::milliseconds& i) :
- DeviceMonitor(std::move(d), e, i),
- bus(b), match(bus, getMatchString(),
- std::bind(std::mem_fn(&RuntimeMonitor::onPowerLost), this,
- std::placeholders::_1))
+ DeviceMonitor(std::move(d), e, i), bus(b),
+ match(bus, getMatchString(),
+ std::bind(std::mem_fn(&RuntimeMonitor::onPowerLost), this,
+ std::placeholders::_1))
{}
/**
diff --git a/power-supply/main.cpp b/power-supply/main.cpp
index d441dbe..c57cc9f 100644
--- a/power-supply/main.cpp
+++ b/power-supply/main.cpp
@@ -123,16 +123,16 @@
}
std::string name{"ps" + instnum + "_input_power"};
- std::string basePath = std::string{INPUT_HISTORY_SENSOR_ROOT} + '/' +
- name;
+ std::string basePath =
+ std::string{INPUT_HISTORY_SENSOR_ROOT} + '/' + name;
psuDevice->enableHistory(basePath, numRecords, syncGPIOPath, gpioNum);
// Systemd object manager
sdbusplus::server::manager_t objManager{bus, basePath.c_str()};
- std::string busName = std::string{INPUT_HISTORY_BUSNAME_ROOT} + '.' +
- name;
+ std::string busName =
+ std::string{INPUT_HISTORY_BUSNAME_ROOT} + '.' + name;
bus.request_name(busName.c_str());
}
diff --git a/power-supply/power_supply.cpp b/power-supply/power_supply.cpp
index af5295e..6ebf3a9 100644
--- a/power-supply/power_supply.cpp
+++ b/power-supply/power_supply.cpp
@@ -45,20 +45,19 @@
const std::string& objpath, const std::string& invpath,
sdbusplus::bus_t& bus, const sdeventplus::Event& e,
std::chrono::seconds& t, std::chrono::seconds& p) :
- Device(name, inst),
- monitorPath(objpath), pmbusIntf(objpath),
+ Device(name, inst), monitorPath(objpath), pmbusIntf(objpath),
inventoryPath(INVENTORY_OBJ_PATH + invpath), bus(bus), presentInterval(p),
presentTimer(e, std::bind([this]() {
- // The hwmon path may have changed.
- pmbusIntf.findHwmonDir();
- this->present = true;
+ // The hwmon path may have changed.
+ pmbusIntf.findHwmonDir();
+ this->present = true;
- // Sync the INPUT_HISTORY data for all PSs
- syncHistory();
+ // Sync the INPUT_HISTORY data for all PSs
+ syncHistory();
- // Update the inventory for the new device
- updateInventory();
-})),
+ // Update the inventory for the new device
+ updateInventory();
+ })),
powerOnInterval(t),
powerOnTimer(e, std::bind([this]() { this->powerOn = true; }))
{
@@ -573,8 +572,8 @@
return;
}
- auto logEntryService = util::getService(logEntries[0], LOGGING_IFACE,
- bus);
+ auto logEntryService =
+ util::getService(logEntries[0], LOGGING_IFACE, bus);
if (logEntryService.empty())
{
return;
@@ -654,8 +653,8 @@
try
{
- auto service = util::getService(INVENTORY_OBJ_PATH, INVENTORY_MGR_IFACE,
- bus);
+ auto service =
+ util::getService(INVENTORY_OBJ_PATH, INVENTORY_MGR_IFACE, bus);
if (service.empty())
{
@@ -705,10 +704,9 @@
}
}
-void PowerSupply::enableHistory(const std::string& objectPath,
- size_t numRecords,
- const std::string& syncGPIOPath,
- size_t syncGPIONum)
+void PowerSupply::enableHistory(
+ const std::string& objectPath, size_t numRecords,
+ const std::string& syncGPIOPath, size_t syncGPIONum)
{
historyObjectPath = objectPath;
syncGPIODevPath = syncGPIOPath;
@@ -733,9 +731,9 @@
}
// Read just the most recent average/max record
- auto data = pmbusIntf.readBinary(INPUT_HISTORY,
- pmbus::Type::HwmonDeviceDebug,
- history::RecordManager::RAW_RECORD_SIZE);
+ auto data =
+ pmbusIntf.readBinary(INPUT_HISTORY, pmbus::Type::HwmonDeviceDebug,
+ history::RecordManager::RAW_RECORD_SIZE);
// Update D-Bus only if something changed (a new record ID, or cleared out)
auto changed = recordManager->add(data);
diff --git a/temporary_file.cpp b/temporary_file.cpp
index 69be79d..4ab6327 100644
--- a/temporary_file.cpp
+++ b/temporary_file.cpp
@@ -32,8 +32,8 @@
TemporaryFile::TemporaryFile()
{
// Build template path required by mkstemp()
- std::string templatePath = fs::temp_directory_path() /
- "phosphor-power-XXXXXX";
+ std::string templatePath =
+ fs::temp_directory_path() / "phosphor-power-XXXXXX";
// Generate unique file name, create file, and open it. The XXXXXX
// characters are replaced by mkstemp() to make the file name unique.
diff --git a/temporary_subdirectory.cpp b/temporary_subdirectory.cpp
index dbab102..b4e6cc9 100644
--- a/temporary_subdirectory.cpp
+++ b/temporary_subdirectory.cpp
@@ -31,8 +31,8 @@
TemporarySubDirectory::TemporarySubDirectory()
{
// Build template path required by mkdtemp()
- std::string templatePath = fs::temp_directory_path() /
- "phosphor-power-XXXXXX";
+ std::string templatePath =
+ fs::temp_directory_path() / "phosphor-power-XXXXXX";
// Generate unique subdirectory name and create it. The XXXXXX characters
// are replaced by mkdtemp() to make the subdirectory name unique.
diff --git a/tools/i2c/i2c.cpp b/tools/i2c/i2c.cpp
index 0dbfe9a..f361be5 100644
--- a/tools/i2c/i2c.cpp
+++ b/tools/i2c/i2c.cpp
@@ -358,18 +358,17 @@
}
}
-std::unique_ptr<I2CInterface> I2CDevice::create(uint8_t busId, uint8_t devAddr,
- InitialState initialState,
- int maxRetries)
+std::unique_ptr<I2CInterface> I2CDevice::create(
+ uint8_t busId, uint8_t devAddr, InitialState initialState, int maxRetries)
{
std::unique_ptr<I2CDevice> dev(
new I2CDevice(busId, devAddr, initialState, maxRetries));
return dev;
}
-std::unique_ptr<I2CInterface> create(uint8_t busId, uint8_t devAddr,
- I2CInterface::InitialState initialState,
- int maxRetries)
+std::unique_ptr<I2CInterface>
+ create(uint8_t busId, uint8_t devAddr,
+ I2CInterface::InitialState initialState, int maxRetries)
{
return I2CDevice::create(busId, devAddr, initialState, maxRetries);
}
diff --git a/tools/i2c/i2c.hpp b/tools/i2c/i2c.hpp
index 5a01ebf..5bd049f 100644
--- a/tools/i2c/i2c.hpp
+++ b/tools/i2c/i2c.hpp
@@ -24,8 +24,7 @@
explicit I2CDevice(uint8_t busId, uint8_t devAddr,
InitialState initialState = InitialState::OPEN,
int maxRetries = 0) :
- busId(busId),
- devAddr(devAddr), maxRetries(maxRetries),
+ busId(busId), devAddr(devAddr), maxRetries(maxRetries),
busStr("/dev/i2c-" + std::to_string(busId))
{
if (initialState == InitialState::OPEN)
diff --git a/tools/i2c/i2c_interface.hpp b/tools/i2c/i2c_interface.hpp
index 77b3d7b..637794b 100644
--- a/tools/i2c/i2c_interface.hpp
+++ b/tools/i2c/i2c_interface.hpp
@@ -17,8 +17,7 @@
public:
explicit I2CException(const std::string& info, const std::string& bus,
uint8_t addr, int errorCode = 0) :
- bus(bus),
- addr(addr), errorCode(errorCode)
+ bus(bus), addr(addr), errorCode(errorCode)
{
std::stringstream ss;
ss << "I2CException: " << info << ": bus " << bus << ", addr 0x"
diff --git a/tools/power-utils/updater.cpp b/tools/power-utils/updater.cpp
index 0b33c95..5c4f7f5 100644
--- a/tools/power-utils/updater.cpp
+++ b/tools/power-utils/updater.cpp
@@ -101,9 +101,9 @@
Updater::Updater(const std::string& psuInventoryPath,
const std::string& devPath, const std::string& imageDir) :
- bus(sdbusplus::bus::new_default()),
- psuInventoryPath(psuInventoryPath), devPath(devPath),
- devName(internal::getDeviceName(devPath)), imageDir(imageDir)
+ bus(sdbusplus::bus::new_default()), psuInventoryPath(psuInventoryPath),
+ devPath(devPath), devName(internal::getDeviceName(devPath)),
+ imageDir(imageDir)
{
fs::path p = fs::path(devPath) / "driver";
try
diff --git a/tools/power-utils/version.cpp b/tools/power-utils/version.cpp
index f24a08e..93b9a82 100644
--- a/tools/power-utils/version.cpp
+++ b/tools/power-utils/version.cpp
@@ -97,8 +97,8 @@
std::string getVersion(const std::string& psuInventoryPath)
{
- const auto& [devicePath, type,
- versionStr] = utils::getVersionInfo(psuInventoryPath);
+ const auto& [devicePath, type, versionStr] =
+ utils::getVersionInfo(psuInventoryPath);
if (devicePath.empty() || versionStr.empty())
{
return {};
diff --git a/utility.cpp b/utility.cpp
index a14dec0..0e687dd 100644
--- a/utility.cpp
+++ b/utility.cpp
@@ -116,9 +116,9 @@
const sdbusplus::message::object_path& path,
const std::vector<std::string>& interfaces, int32_t depth)
{
- auto mapperCall = bus.new_method_call(MAPPER_BUSNAME, MAPPER_PATH,
- MAPPER_INTERFACE,
- "GetAssociatedSubTreePaths");
+ auto mapperCall =
+ bus.new_method_call(MAPPER_BUSNAME, MAPPER_PATH, MAPPER_INTERFACE,
+ "GetAssociatedSubTreePaths");
mapperCall.append(associationPath);
mapperCall.append(path);
mapperCall.append(depth);