clang-format: copy latest and re-format
clang-format-16 has some backwards incompatible changes that require
additional settings for best compatibility and re-running the formatter.
Copy the latest .clang-format from the docs repository and reformat the
repository.
Change-Id: If66f68c96df4baf8dc07abf8729a3cb7657e932d
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/.clang-format b/.clang-format
index cab3139..d92a3f1 100644
--- a/.clang-format
+++ b/.clang-format
@@ -6,12 +6,14 @@
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Right
-AlignOperands: true
-AlignTrailingComments: true
+AlignOperands: Align
+AlignTrailingComments:
+ Kind: Always
+ OverEmptyLines: 1
AllowAllParametersOfDeclarationOnNextLine: true
-AllowShortBlocksOnASingleLine: false
+AllowShortBlocksOnASingleLine: Empty
AllowShortCaseLabelsOnASingleLine: false
-AllowShortFunctionsOnASingleLine: None
+AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None
@@ -36,6 +38,7 @@
SplitEmptyFunction: false
SplitEmptyRecord: false
SplitEmptyNamespace: false
+BreakAfterAttributes: Never
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeTernaryOperators: true
@@ -49,6 +52,7 @@
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
+DeriveLineEnding: false
DerivePointerAlignment: false
PointerAlignment: Left
DisableFormat: false
@@ -74,9 +78,13 @@
- Regex: '.*'
Priority: 6
IndentCaseLabels: true
+IndentRequiresClause: true
IndentWidth: 4
IndentWrappedFunctionNames: true
-KeepEmptyLinesAtTheStartOfBlocks: true
+InsertNewlineAtEOF: true
+KeepEmptyLinesAtTheStartOfBlocks: false
+LambdaBodyIndentation: OuterScope
+LineEnding: LF
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
@@ -84,13 +92,19 @@
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
+PenaltyBreakAssignment: 25
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
+PenaltyIndentedWhitespace: 0
+QualifierAlignment: Left
+ReferenceAlignment: Left
ReflowComments: true
+RequiresClausePosition: OwnLine
+RequiresExpressionIndentation: Keyword
SortIncludes: true
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
diff --git a/cold-redundancy/cold_redundancy.cpp b/cold-redundancy/cold_redundancy.cpp
index 08ed491..5554f85 100644
--- a/cold-redundancy/cold_redundancy.cpp
+++ b/cold-redundancy/cold_redundancy.cpp
@@ -52,86 +52,86 @@
[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())
+ 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)
{
- 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)
- {
- return;
- }
- else if (ec)
- {
- std::cerr << "timer error\n";
- }
- createPSU(systemBus);
- });
- };
+ 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::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);
+ 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
+ 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)
{
- message.read(objectName, values);
- }
- catch (const sdbusplus::exception_t& e)
- {
- std::cerr << "Failed to read message from PSU Event\n";
- return;
+ continue;
}
- for (auto& psu : powerSupplies)
+ std::string psuEventName = "functional";
+ auto findEvent = values.find(psuEventName);
+ if (findEvent != values.end())
{
- if (psu->name != psuName)
+ bool* functional = std::get_if<bool>(&(findEvent->second));
+ if (functional == nullptr)
{
+ std::cerr << "Unable to get valid functional status\n";
continue;
}
-
- std::string psuEventName = "functional";
- auto findEvent = values.find(psuEventName);
- if (findEvent != values.end())
+ if (*functional)
{
- 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;
- }
+ psu->state = CR::PSUState::normal;
+ }
+ else
+ {
+ psu->state = CR::PSUState::acLost;
}
}
- };
+ }
+ };
using namespace sdbusplus::bus::match::rules;
for (const char* type : psuInterfaceTypes)
@@ -168,99 +168,94 @@
conn->async_method_call(
[this, &conn](const boost::system::error_code ec,
CR::GetSubTreeType subtree) {
- if (ec)
+ 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)
{
- 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)
+ std::string serviceName = serviceIface.first;
+ for (const auto& interface : serviceIface.second)
{
- std::string serviceName = serviceIface.first;
- for (const auto& interface : serviceIface.second)
+ // only get property of matched interface
+ bool isIfaceMatched = false;
+ for (const auto& type : psuInterfaceTypes)
{
- // only get property of matched interface
- bool isIfaceMatched = false;
- for (const auto& type : psuInterfaceTypes)
+ if (type == interface)
{
- if (type == interface)
+ 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))
{
- isIfaceMatched = true;
- break;
+ return;
}
}
- 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;
- }
+ uint8_t order = 0;
- auto configName =
- std::get_if<std::string>(&propMap["Name"]);
- if (configName == nullptr)
- {
- std::cerr << "error finding necessary "
- "entry in configuration\n";
- return;
- }
+ powerSupplies.emplace_back(
+ std::make_unique<PowerSupply>(
+ *configName, static_cast<uint8_t>(*configBus),
+ static_cast<uint8_t>(*configAddress), order,
+ conn));
- 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);
- }
+ 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",
diff --git a/device.hpp b/device.hpp
index eee9b9b..c4a4e3b 100644
--- a/device.hpp
+++ b/device.hpp
@@ -30,8 +30,7 @@
* @param name - the device name
* @param inst - the device instance
*/
- Device(const std::string& name, size_t inst) : name(name), instance(inst)
- {}
+ Device(const std::string& name, size_t inst) : name(name), instance(inst) {}
/**
* Returns the instance number
@@ -59,8 +58,7 @@
* the chip is in error state. Override if functionality
* is required
*/
- virtual void onFailure()
- {}
+ virtual void onFailure() {}
/**
* Pure virtual function to clear faults on the device
diff --git a/file_descriptor.hpp b/file_descriptor.hpp
index 4b98aea..c321de0 100644
--- a/file_descriptor.hpp
+++ b/file_descriptor.hpp
@@ -28,8 +28,7 @@
*
* @param[in] fd - File descriptor
*/
- FileDescriptor(int fd) : fd(fd)
- {}
+ FileDescriptor(int fd) : fd(fd) {}
/**
* Move constructor.
diff --git a/phosphor-power-sequencer/src/power_control.cpp b/phosphor-power-sequencer/src/power_control.cpp
index 5578491..096fe5f 100644
--- a/phosphor-power-sequencer/src/power_control.cpp
+++ b/phosphor-power-sequencer/src/power_control.cpp
@@ -285,8 +285,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 @@
}
// Get the properties for the device interface
- auto properties =
- util::getAllProperties(bus, path, interfaceName, service);
+ auto properties = util::getAllProperties(bus, path, interfaceName,
+ service);
getDeviceProperties(properties);
}
diff --git a/phosphor-power-supply/power_supply.cpp b/phosphor-power-supply/power_supply.cpp
index a6e4fae..4d7e8e8 100644
--- a/phosphor-power-supply/power_supply.cpp
+++ b/phosphor-power-supply/power_supply.cpp
@@ -9,7 +9,7 @@
#include <xyz/openbmc_project/Common/Device/error.hpp>
-#include <chrono> // sleep_for()
+#include <chrono> // sleep_for()
#include <cmath>
#include <cstdint> // uint8_t...
#include <fstream>
@@ -565,8 +565,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();
@@ -830,8 +830,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
{
@@ -919,8 +919,8 @@
sn = readVPDValue(SERIAL_NUMBER, Type::Debug, SERIAL_SIZE);
assetProps.emplace(SN_PROP, header + sn);
- fwVersion =
- readVPDValue(FW_VERSION, Type::HwmonDeviceDebug, VERSION_SIZE);
+ fwVersion = readVPDValue(FW_VERSION, Type::HwmonDeviceDebug,
+ VERSION_SIZE);
versionProps.emplace(VERSION_PROP, fwVersion);
ipzvpdVINIProps.emplace(
@@ -971,8 +971,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())
{
@@ -980,9 +980,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));
@@ -1009,8 +1009,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>(fmt::format("{} MFR_POUT_MAX read {}", shortName,
maxPowerOutStr)
.c_str());
@@ -1044,8 +1044,8 @@
std::string name{fmt::format("{}_input_power", shortName)};
- historyObjectPath =
- std::string{INPUT_HISTORY_SENSOR_ROOT} + '/' + name;
+ historyObjectPath = std::string{INPUT_HISTORY_SENSOR_ROOT} +
+ '/' + name;
// If the power supply was present, we created the
// recordManager. If it then went missing, the recordManager is
@@ -1060,8 +1060,8 @@
if (!average)
{
- auto avgPath =
- historyObjectPath + '/' + history::Average::name;
+ auto avgPath = historyObjectPath + '/' +
+ history::Average::name;
average = std::make_unique<history::Average>(bus, avgPath);
log<level::DEBUG>(
fmt::format("{} avgPath: {}", shortName, avgPath)
@@ -1070,8 +1070,8 @@
if (!maximum)
{
- auto maxPath =
- historyObjectPath + '/' + history::Maximum::name;
+ auto maxPath = historyObjectPath + '/' +
+ history::Maximum::name;
maximum = std::make_unique<history::Maximum>(bus, maxPath);
log<level::DEBUG>(
fmt::format("{} maxPath: {}", shortName, maxPath)
@@ -1113,9 +1113,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)
diff --git a/phosphor-power-supply/power_supply.hpp b/phosphor-power-supply/power_supply.hpp
index 5db6714..097cac6 100644
--- a/phosphor-power-supply/power_supply.hpp
+++ b/phosphor-power-supply/power_supply.hpp
@@ -824,7 +824,7 @@
*/
std::string findShortName(const std::string& invPath)
{
- auto const lastSlashPos = invPath.find_last_of('/');
+ const auto lastSlashPos = invPath.find_last_of('/');
if ((lastSlashPos == std::string::npos) ||
((lastSlashPos + 1) == invPath.size()))
diff --git a/phosphor-power-supply/psu_manager.cpp b/phosphor-power-supply/psu_manager.cpp
index 5ad749c..d456ebf 100644
--- a/phosphor-power-supply/psu_manager.cpp
+++ b/phosphor-power-supply/psu_manager.cpp
@@ -168,8 +168,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);
}
@@ -233,10 +233,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
@@ -343,11 +343,10 @@
void PSUManager::getSystemProperties()
{
-
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");
@@ -518,8 +517,8 @@
{
additionalData["_PID"] = std::to_string(getpid());
- auto service =
- util::getService(loggingObjectPath, loggingCreateInterface, bus);
+ auto service = util::getService(loggingObjectPath,
+ loggingCreateInterface, bus);
if (service.empty())
{
@@ -569,10 +568,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();
@@ -616,8 +615,8 @@
// hexadecimal format.
additionalData["STATUS_WORD"] =
fmt::format("{:#04x}", psu->getStatusWord());
- additionalData["STATUS_MFR"] =
- fmt::format("{:#02x}", psu->getMFRFault());
+ additionalData["STATUS_MFR"] = fmt::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.
@@ -1301,8 +1300,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/mock.hpp b/phosphor-power-supply/test/mock.hpp
index d964964..6e2705e 100644
--- a/phosphor-power-supply/test/mock.hpp
+++ b/phosphor-power-supply/test/mock.hpp
@@ -15,7 +15,6 @@
{
class MockedPMBus : public PMBusBase
{
-
public:
virtual ~MockedPMBus() = default;
diff --git a/phosphor-power-supply/util.hpp b/phosphor-power-supply/util.hpp
index b09731a..b2b27f5 100644
--- a/phosphor-power-supply/util.hpp
+++ b/phosphor-power-supply/util.hpp
@@ -72,9 +72,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);
}
@@ -103,13 +103,12 @@
try
{
-
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-regulators/src/actions/i2c_write_bytes_action.cpp b/phosphor-regulators/src/actions/i2c_write_bytes_action.cpp
index 21b31f1..e9a02f3 100644
--- a/phosphor-regulators/src/actions/i2c_write_bytes_action.cpp
+++ b/phosphor-regulators/src/actions/i2c_write_bytes_action.cpp
@@ -51,8 +51,8 @@
// Combine values to write with current values
for (unsigned int i = 0; i < values.size(); ++i)
{
- valuesToWrite[i] =
- (values[i] & masks[i]) | (currentValues[i] & (~masks[i]));
+ valuesToWrite[i] = (values[i] & masks[i]) |
+ (currentValues[i] & (~masks[i]));
}
}
diff --git a/phosphor-regulators/src/actions/log_phase_fault_action.hpp b/phosphor-regulators/src/actions/log_phase_fault_action.hpp
index 70c4cd0..b587699 100644
--- a/phosphor-regulators/src/actions/log_phase_fault_action.hpp
+++ b/phosphor-regulators/src/actions/log_phase_fault_action.hpp
@@ -47,8 +47,7 @@
*
* @param type phase fault type
*/
- explicit LogPhaseFaultAction(PhaseFaultType type) : type{type}
- {}
+ explicit LogPhaseFaultAction(PhaseFaultType type) : type{type} {}
/**
* Executes this action.
diff --git a/phosphor-regulators/src/actions/pmbus_read_sensor_action.cpp b/phosphor-regulators/src/actions/pmbus_read_sensor_action.cpp
index 896830c..a94775d 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_write_vout_command_action.cpp b/phosphor-regulators/src/actions/pmbus_write_vout_command_action.cpp
index ca1756f..55ed89d 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/run_rule_action.hpp b/phosphor-regulators/src/actions/run_rule_action.hpp
index 87cd0c4..568f9f0 100644
--- a/phosphor-regulators/src/actions/run_rule_action.hpp
+++ b/phosphor-regulators/src/actions/run_rule_action.hpp
@@ -47,8 +47,7 @@
*
* @param ruleID rule ID
*/
- explicit RunRuleAction(const std::string& ruleID) : ruleID{ruleID}
- {}
+ explicit RunRuleAction(const std::string& ruleID) : ruleID{ruleID} {}
/**
* Executes this action.
diff --git a/phosphor-regulators/src/config_file_parser.cpp b/phosphor-regulators/src/config_file_parser.cpp
index 4bb8bd8..ede608b 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/device.hpp b/phosphor-regulators/src/device.hpp
index 352daeb..1815680 100644
--- a/phosphor-regulators/src/device.hpp
+++ b/phosphor-regulators/src/device.hpp
@@ -74,11 +74,11 @@
std::vector<std::unique_ptr<Rail>>{}) :
id{id},
isRegulatorDevice{isRegulator}, fru{fru},
- i2cInterface{std::move(i2cInterface)}, presenceDetection{std::move(
- presenceDetection)},
+ i2cInterface{std::move(i2cInterface)},
+ presenceDetection{std::move(presenceDetection)},
configuration{std::move(configuration)},
- phaseFaultDetection{std::move(phaseFaultDetection)}, rails{std::move(
- rails)}
+ phaseFaultDetection{std::move(phaseFaultDetection)},
+ rails{std::move(rails)}
{}
/**
diff --git a/phosphor-regulators/src/error_logging.hpp b/phosphor-regulators/src/error_logging.hpp
index ae26dab..1c633f9 100644
--- a/phosphor-regulators/src/error_logging.hpp
+++ b/phosphor-regulators/src/error_logging.hpp
@@ -166,8 +166,7 @@
*
* @param bus D-Bus bus object
*/
- explicit DBusErrorLogging(sdbusplus::bus_t& bus) : bus{bus}
- {}
+ explicit DBusErrorLogging(sdbusplus::bus_t& bus) : bus{bus} {}
/** @copydoc ErrorLogging::logConfigFileError() */
virtual void logConfigFileError(Entry::Level severity,
diff --git a/phosphor-regulators/src/journal.cpp b/phosphor-regulators/src/journal.cpp
index 955792a..716a999 100644
--- a/phosphor-regulators/src/journal.cpp
+++ b/phosphor-regulators/src/journal.cpp
@@ -43,8 +43,7 @@
JournalCloser& operator=(const JournalCloser&) = delete;
JournalCloser& operator=(JournalCloser&&) = delete;
- explicit JournalCloser(sd_journal* journal) : journal{journal}
- {}
+ explicit JournalCloser(sd_journal* journal) : journal{journal} {}
~JournalCloser()
{
diff --git a/phosphor-regulators/src/manager.cpp b/phosphor-regulators/src/manager.cpp
index 4bb9a23..cfbb811 100644
--- a/phosphor-regulators/src/manager.cpp
+++ b/phosphor-regulators/src/manager.cpp
@@ -73,9 +73,8 @@
Manager::Manager(sdbusplus::bus_t& bus, const sdeventplus::Event& event) :
ManagerObject{bus, managerObjPath}, bus{bus}, eventLoop{event},
- services{bus}, phaseFaultTimer{event,
- std::bind(&Manager::phaseFaultTimerExpired,
- this)},
+ services{bus},
+ phaseFaultTimer{event, std::bind(&Manager::phaseFaultTimerExpired, this)},
sensorTimer{event, std::bind(&Manager::sensorTimerExpired, this)}
{
// Subscribe to D-Bus interfacesAdded signal from Entity Manager. This
@@ -414,8 +413,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/presence_service.hpp b/phosphor-regulators/src/presence_service.hpp
index 9520dbd..5ae96d3 100644
--- a/phosphor-regulators/src/presence_service.hpp
+++ b/phosphor-regulators/src/presence_service.hpp
@@ -83,8 +83,7 @@
*
* @param bus D-Bus bus object
*/
- explicit DBusPresenceService(sdbusplus::bus_t& bus) : bus{bus}
- {}
+ explicit DBusPresenceService(sdbusplus::bus_t& bus) : bus{bus} {}
/** @copydoc PresenceService::clearCache() */
virtual void clearCache(void) override
diff --git a/phosphor-regulators/src/rail.hpp b/phosphor-regulators/src/rail.hpp
index 63d80eb..70b3e3d 100644
--- a/phosphor-regulators/src/rail.hpp
+++ b/phosphor-regulators/src/rail.hpp
@@ -62,8 +62,8 @@
std::unique_ptr<Configuration> configuration = nullptr,
std::unique_ptr<SensorMonitoring> sensorMonitoring = nullptr) :
id{id},
- configuration{std::move(configuration)}, sensorMonitoring{std::move(
- sensorMonitoring)}
+ 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 9f65c8b..6f03016 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 b1a1418..b64eab5 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/services.hpp b/phosphor-regulators/src/services.hpp
index 3c2e3ff..0721479 100644
--- a/phosphor-regulators/src/services.hpp
+++ b/phosphor-regulators/src/services.hpp
@@ -112,8 +112,8 @@
* @param bus D-Bus bus object
*/
explicit BMCServices(sdbusplus::bus_t& bus) :
- bus{bus}, errorLogging{bus},
- presenceService{bus}, sensors{bus}, vpd{bus}
+ bus{bus}, errorLogging{bus}, presenceService{bus}, sensors{bus},
+ vpd{bus}
{}
/** @copydoc Services::getBus() */
diff --git a/phosphor-regulators/src/temporary_file.cpp b/phosphor-regulators/src/temporary_file.cpp
index 514d818..5b5954d 100644
--- a/phosphor-regulators/src/temporary_file.cpp
+++ b/phosphor-regulators/src/temporary_file.cpp
@@ -30,8 +30,8 @@
TemporaryFile::TemporaryFile()
{
// Build template path required by mkstemp()
- std::string templatePath =
- fs::temp_directory_path() / "phosphor-regulators-XXXXXX";
+ std::string templatePath = fs::temp_directory_path() /
+ "phosphor-regulators-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/phosphor-regulators/src/vpd.hpp b/phosphor-regulators/src/vpd.hpp
index 514172c..e86f834 100644
--- a/phosphor-regulators/src/vpd.hpp
+++ b/phosphor-regulators/src/vpd.hpp
@@ -88,8 +88,7 @@
*
* @param bus D-Bus bus object
*/
- explicit DBusVPD(sdbusplus::bus_t& bus) : bus{bus}
- {}
+ explicit DBusVPD(sdbusplus::bus_t& bus) : bus{bus} {}
/** @copydoc VPD::clearCache() */
virtual void clearCache(void) override
diff --git a/phosphor-regulators/test/actions/i2c_write_byte_action_tests.cpp b/phosphor-regulators/test/actions/i2c_write_byte_action_tests.cpp
index b09e3fa..986ca2e 100644
--- a/phosphor-regulators/test/actions/i2c_write_byte_action_tests.cpp
+++ b/phosphor-regulators/test/actions/i2c_write_byte_action_tests.cpp
@@ -132,7 +132,6 @@
// Test where fails: Getting I2CInterface fails
try
{
-
// Create IDMap, MockServices, and ActionEnvironment
IDMap idMap{};
MockServices services{};
diff --git a/phosphor-regulators/test/actions/set_device_action_tests.cpp b/phosphor-regulators/test/actions/set_device_action_tests.cpp
index 2651f13..139abd1 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/device_tests.cpp b/phosphor-regulators/test/device_tests.cpp
index 0c43b1e..d5fdf74 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:
@@ -456,8 +456,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
@@ -517,8 +517,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));
}
@@ -534,8 +534,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 15ace68..6c8d1ca 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 c85970c..d7fa5f3 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 1ea34b3..6cff029 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_sdbus_error.hpp b/phosphor-regulators/test/test_sdbus_error.hpp
index 1937e2d..ff4f4e2 100644
--- a/phosphor-regulators/test/test_sdbus_error.hpp
+++ b/phosphor-regulators/test/test_sdbus_error.hpp
@@ -28,8 +28,7 @@
class TestSDBusError : public sdbusplus::exception_t
{
public:
- TestSDBusError(const std::string& error) : error{error}
- {}
+ TestSDBusError(const std::string& error) : error{error} {}
const char* what() const noexcept override
{
diff --git a/phosphor-regulators/test/validate-regulators-config_tests.cpp b/phosphor-regulators/test/validate-regulators-config_tests.cpp
index 16b2fec..10cd7ce 100644
--- a/phosphor-regulators/test/validate-regulators-config_tests.cpp
+++ b/phosphor-regulators/test/validate-regulators-config_tests.cpp
@@ -3367,8 +3367,8 @@
}
// Invalid: -s specified more than once
{
- command =
- validateTool + "-s -s " + schemaFile + configuration + fileName;
+ command = validateTool + "-s -s " + schemaFile + configuration +
+ fileName;
expectCommandLineSyntax(outputMessageHelp, outputMessage, command, 2);
}
// Invalid: No file name specified after -c
diff --git a/pmbus.cpp b/pmbus.cpp
index 6ab6944..9424ee6 100644
--- a/pmbus.cpp
+++ b/pmbus.cpp
@@ -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)
{
diff --git a/power-sequencer/mihawk-cpld.hpp b/power-sequencer/mihawk-cpld.hpp
index 7adf09e..cf554cc 100644
--- a/power-sequencer/mihawk-cpld.hpp
+++ b/power-sequencer/mihawk-cpld.hpp
@@ -54,8 +54,7 @@
/**
* Clears faults in the device
*/
- void clearFaults() override
- {}
+ void clearFaults() override {}
private:
/**
diff --git a/power-sequencer/ucd90160.cpp b/power-sequencer/ucd90160.cpp
index 3801d40..1b2be11 100644
--- a/power-sequencer/ucd90160.cpp
+++ b/power-sequencer/ucd90160.cpp
@@ -328,7 +328,6 @@
bool UCD90160::doExtraAnalysis(const ucd90160::GPIConfig& config)
{
-
auto type = std::get<ucd90160::extraAnalysisField>(config);
if (type == ucd90160::extraAnalysisType::none)
{
diff --git a/power-sequencer/ucd90160.hpp b/power-sequencer/ucd90160.hpp
index 4701826..33f8d4f 100644
--- a/power-sequencer/ucd90160.hpp
+++ b/power-sequencer/ucd90160.hpp
@@ -60,8 +60,7 @@
/**
* Clears faults in the device
*/
- void clearFaults() override
- {}
+ void clearFaults() override {}
private:
/**
diff --git a/power-supply/main.cpp b/power-supply/main.cpp
index b526264..a0be28c 100644
--- a/power-supply/main.cpp
+++ b/power-supply/main.cpp
@@ -121,16 +121,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 ce6a43a..1dc383d 100644
--- a/power-supply/power_supply.cpp
+++ b/power-supply/power_supply.cpp
@@ -573,8 +573,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 +654,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())
{
@@ -733,9 +733,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/power-supply/record_manager.cpp b/power-supply/record_manager.cpp
index a182c8c..7b34961 100644
--- a/power-supply/record_manager.cpp
+++ b/power-supply/record_manager.cpp
@@ -62,8 +62,8 @@
// If it just rolled over from 0xFF to 0x00, then no
// need to clear. If we see a 0 seemingly out of nowhere,
// then it was a sync so clear the old records.
- auto rolledOver =
- (previousID == lastSequenceID) && (id == FIRST_SEQUENCE_ID);
+ auto rolledOver = (previousID == lastSequenceID) &&
+ (id == FIRST_SEQUENCE_ID);
if (!rolledOver)
{
diff --git a/power-supply/record_manager.hpp b/power-supply/record_manager.hpp
index 88baa31..0f15b0a 100644
--- a/power-supply/record_manager.hpp
+++ b/power-supply/record_manager.hpp
@@ -28,8 +28,7 @@
class InvalidRecordException : public std::runtime_error
{
public:
- InvalidRecordException() : std::runtime_error("Invalid history record")
- {}
+ InvalidRecordException() : std::runtime_error("Invalid history record") {}
};
/**
diff --git a/tools/power-utils/main.cpp b/tools/power-utils/main.cpp
index f93272c..ed63071 100644
--- a/tools/power-utils/main.cpp
+++ b/tools/power-utils/main.cpp
@@ -25,7 +25,6 @@
int main(int argc, char** argv)
{
-
std::string psuPath;
std::vector<std::string> versions;
bool rawOutput = false;
diff --git a/tools/power-utils/version.cpp b/tools/power-utils/version.cpp
index c5c1f5f..2becfa5 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 0082d36..74ee75b 100644
--- a/utility.cpp
+++ b/utility.cpp
@@ -109,9 +109,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);