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: I94e2bfdc8fae9bc14e30c701a0e622709ee9b0fe
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/occ_command.cpp b/occ_command.cpp
index e2ec8a7..5ab5e12 100644
--- a/occ_command.cpp
+++ b/occ_command.cpp
@@ -209,8 +209,8 @@
// Validate checksum (last 2 bytes of response)
const unsigned int csumIndex = response.size() - 2;
- const uint32_t rspChecksum = (response[csumIndex] << 8) +
- response[csumIndex + 1];
+ const uint32_t rspChecksum =
+ (response[csumIndex] << 8) + response[csumIndex + 1];
uint32_t calcChecksum = 0;
for (unsigned int index = 0; index < csumIndex; ++index)
{
diff --git a/occ_dbus.cpp b/occ_dbus.cpp
index fb2ff27..62ae23f 100644
--- a/occ_dbus.cpp
+++ b/occ_dbus.cpp
@@ -241,8 +241,8 @@
void OccDBusSensors::setDvfsTemp(const std::string& path, double value)
{
- dvfsTemps[path] = std::make_unique<SensorIntf>(utils::getBus(),
- path.c_str());
+ dvfsTemps[path] =
+ std::make_unique<SensorIntf>(utils::getBus(), path.c_str());
dvfsTemps[path]->value(value);
}
diff --git a/occ_device.hpp b/occ_device.hpp
index b853412..0f7aaaf 100644
--- a/occ_device.hpp
+++ b/occ_device.hpp
@@ -51,8 +51,8 @@
std::unique_ptr<powermode::PowerMode>& powerModeRef,
#endif
unsigned int instance = 0) :
- devPath(path),
- instance(instance), statusObject(status), managerObject(manager),
+ devPath(path), instance(instance), statusObject(status),
+ managerObject(manager),
error(event, path / "occ_error",
std::bind(std::mem_fn(&Device::errorCallback), this,
std::placeholders::_1)),
diff --git a/occ_errors.hpp b/occ_errors.hpp
index 5d2db87..8cd97af 100644
--- a/occ_errors.hpp
+++ b/occ_errors.hpp
@@ -41,8 +41,7 @@
*/
Error(EventPtr& event, const fs::path& file,
std::function<void(int)> callBack = nullptr) :
- event(event),
- file(file), callBack(callBack)
+ event(event), file(file), callBack(callBack)
{
// Nothing to do here.
}
@@ -76,8 +75,7 @@
*/
Descriptor(const char* path, int err = 0,
const char* callout = nullptr) :
- log(true),
- err(err), callout(callout), path(path)
+ log(true), err(err), callout(callout), path(path)
{}
bool log;
diff --git a/occ_ffdc.cpp b/occ_ffdc.cpp
index 131913b..da3df79 100644
--- a/occ_ffdc.cpp
+++ b/occ_ffdc.cpp
@@ -57,8 +57,8 @@
}
// Add journal traces to PEL FFDC
- auto occJournalFile = addJournalEntries(pelFFDCInfo,
- "openpower-occ-control", 25);
+ auto occJournalFile =
+ addJournalEntries(pelFFDCInfo, "openpower-occ-control", 25);
std::map<std::string, std::string> additionalData;
additionalData.emplace("SRC6", std::to_string(src6));
@@ -69,11 +69,11 @@
try
{
- std::string service = utils::getService(loggingObjectPath,
- opLoggingInterface);
- auto method = bus.new_method_call(service.c_str(), loggingObjectPath,
- opLoggingInterface,
- "CreatePELWithFFDCFiles");
+ std::string service =
+ utils::getService(loggingObjectPath, opLoggingInterface);
+ auto method =
+ bus.new_method_call(service.c_str(), loggingObjectPath,
+ opLoggingInterface, "CreatePELWithFFDCFiles");
// Set level to Notice (Informational). Error should trigger an OCC
// reset and if it does not recover, HTMGT/HBRT will create an
@@ -128,14 +128,14 @@
{
FFDCFiles ffdc;
// Add journal traces to PEL FFDC
- auto occJournalFile = addJournalEntries(ffdc, "openpower-occ-control",
- 25);
+ auto occJournalFile =
+ addJournalEntries(ffdc, "openpower-occ-control", 25);
- std::string service = utils::getService(loggingObjectPath,
- opLoggingInterface);
- auto method = bus.new_method_call(service.c_str(), loggingObjectPath,
- opLoggingInterface,
- "CreatePELWithFFDCFiles");
+ std::string service =
+ utils::getService(loggingObjectPath, opLoggingInterface);
+ auto method =
+ bus.new_method_call(service.c_str(), loggingObjectPath,
+ opLoggingInterface, "CreatePELWithFFDCFiles");
// Set level to Notice (Informational). Error should trigger an OCC
// reset and if it does not recover, HTMGT/HBRT will create an
@@ -195,8 +195,8 @@
if (total > sbe_status_header_size)
{
- std::string templateString = fs::temp_directory_path() /
- "OCC_FFDC_XXXXXX";
+ std::string templateString =
+ fs::temp_directory_path() / "OCC_FFDC_XXXXXX";
tfd = mkostemp(templateString.data(), O_RDWR);
if (tfd < 0)
{
@@ -232,9 +232,8 @@
}
// Create file with the latest journal entries for specified executable
-std::unique_ptr<FFDCFile> FFDC::addJournalEntries(FFDCFiles& fileList,
- const std::string& executable,
- unsigned int lines)
+std::unique_ptr<FFDCFile> FFDC::addJournalEntries(
+ FFDCFiles& fileList, const std::string& executable, unsigned int lines)
{
auto journalFile = makeJsonFFDCFile(getJournalEntries(lines, executable));
if (journalFile && journalFile->fd() != -1)
@@ -342,8 +341,8 @@
message = getFieldValue(journal, "MESSAGE");
// Build one line string containing field values
- entries.push_back(timeStamp + " " + syslogID + "[" + pid +
- "]: " + message);
+ entries.push_back(
+ timeStamp + " " + syslogID + "[" + pid + "]: " + message);
// Stop after number of lines was read
if (count++ >= numLines)
diff --git a/occ_ffdc.hpp b/occ_ffdc.hpp
index 143669a..7578e4d 100644
--- a/occ_ffdc.hpp
+++ b/occ_ffdc.hpp
@@ -137,9 +137,8 @@
*
* @return std::unique_ptr<FFDCFile> - The file object
*/
- static std::unique_ptr<FFDCFile>
- addJournalEntries(FFDCFiles& fileList, const std::string& executable,
- unsigned int lines);
+ static std::unique_ptr<FFDCFile> addJournalEntries(
+ FFDCFiles& fileList, const std::string& executable, unsigned int lines);
private:
/** @brief OCC instance number. Ex, 0,1, etc */
diff --git a/occ_manager.cpp b/occ_manager.cpp
index eede8d1..932b052 100644
--- a/occ_manager.cpp
+++ b/occ_manager.cpp
@@ -379,12 +379,13 @@
#endif
}
- passThroughObjects.emplace_back(std::make_unique<PassThrough>(path.c_str()
+ passThroughObjects.emplace_back(std::make_unique<PassThrough>(
+ path.c_str()
#ifdef POWER10
- ,
- pmode
+ ,
+ pmode
#endif
- ));
+ ));
}
void Manager::statusCallBack(instanceID instance, bool status)
@@ -513,8 +514,8 @@
{
auto obj = std::find_if(statusObjects.begin(), statusObjects.end(),
[instance](const auto& obj) {
- return instance == obj->getOccInstanceID();
- });
+ return instance == obj->getOccInstanceID();
+ });
if (obj != statusObjects.end() && (*obj)->occActive())
{
@@ -532,8 +533,8 @@
{
auto obj = std::find_if(statusObjects.begin(), statusObjects.end(),
[instance](const auto& obj) {
- return instance == obj->getOccInstanceID();
- });
+ return instance == obj->getOccInstanceID();
+ });
const bool hostRunning = open_power::occ::utils::isHostRunning();
if (obj != statusObjects.end())
@@ -649,8 +650,8 @@
constexpr auto interface = "xyz.openbmc_project.Dump.Create";
constexpr auto function = "CreateDump";
- std::string service = utils::getService(OP_DUMP_OBJ_PATH,
- interface);
+ std::string service =
+ utils::getService(OP_DUMP_OBJ_PATH, interface);
auto method = bus.new_method_call(service.c_str(), OP_DUMP_OBJ_PATH,
interface, function);
@@ -859,20 +860,20 @@
continue;
}
- std::string sensorPath = OCC_SENSORS_ROOT +
- std::string("/temperature/");
+ std::string sensorPath =
+ OCC_SENSORS_ROOT + std::string("/temperature/");
std::string dvfsTempPath;
if (fruTypeValue == VRMVdd)
{
- sensorPath.append("vrm_vdd" + std::to_string(occInstance) +
- "_temp");
+ sensorPath.append(
+ "vrm_vdd" + std::to_string(occInstance) + "_temp");
}
else if (fruTypeValue == processorIoRing)
{
- sensorPath.append("proc" + std::to_string(occInstance) +
- "_ioring_temp");
+ sensorPath.append(
+ "proc" + std::to_string(occInstance) + "_ioring_temp");
dvfsTempPath = std::string{OCC_SENSORS_ROOT} + "/temperature/proc" +
std::to_string(occInstance) + "_ioring_dvfs_temp";
}
@@ -900,8 +901,8 @@
continue;
}
- sensorPath.append("dimm" + std::to_string(instanceID) +
- iter->second);
+ sensorPath.append(
+ "dimm" + std::to_string(instanceID) + iter->second);
dvfsTempPath = std::string{OCC_SENSORS_ROOT} + "/temperature/" +
dimmDVFSSensorName.at(fruTypeValue);
@@ -1145,8 +1146,8 @@
dbus::OccDBusSensors::getOccDBus().setValue(
sensorPath, tempValue * std::pow(10, -3) * std::pow(10, -3));
- dbus::OccDBusSensors::getOccDBus().setOperationalStatus(sensorPath,
- true);
+ dbus::OccDBusSensors::getOccDBus().setOperationalStatus(
+ sensorPath, true);
if (existingSensors.find(sensorPath) == existingSensors.end())
{
@@ -1168,8 +1169,8 @@
dbus::OccDBusSensors::getOccDBus().setValue(
sensorPath, std::numeric_limits<double>::quiet_NaN());
- dbus::OccDBusSensors::getOccDBus().setOperationalStatus(sensorPath,
- true);
+ dbus::OccDBusSensors::getOccDBus().setOperationalStatus(
+ sensorPath, true);
}
}
return;
@@ -1184,8 +1185,8 @@
dbus::OccDBusSensors::getOccDBus().setValue(
sensorPath, std::numeric_limits<double>::quiet_NaN());
- dbus::OccDBusSensors::getOccDBus().setOperationalStatus(sensorPath,
- false);
+ dbus::OccDBusSensors::getOccDBus().setOperationalStatus(
+ sensorPath, false);
}
}
return;
@@ -1432,11 +1433,11 @@
static constexpr auto loggingObjectPath =
"/xyz/openbmc_project/logging";
static constexpr auto opLoggingInterface = "org.open_power.Logging.PEL";
- std::string service = utils::getService(loggingObjectPath,
- opLoggingInterface);
- auto method = bus.new_method_call(service.c_str(), loggingObjectPath,
- opLoggingInterface,
- "CreatePELWithFFDCFiles");
+ std::string service =
+ utils::getService(loggingObjectPath, opLoggingInterface);
+ auto method =
+ bus.new_method_call(service.c_str(), loggingObjectPath,
+ opLoggingInterface, "CreatePELWithFFDCFiles");
// Set level to Warning (Predictive).
auto level =
diff --git a/occ_pass_through.cpp b/occ_pass_through.cpp
index 230152d..5588e5a 100644
--- a/occ_pass_through.cpp
+++ b/occ_pass_through.cpp
@@ -31,8 +31,7 @@
std::unique_ptr<open_power::occ::powermode::PowerMode>& powerModeRef
#endif
) :
- Iface(utils::getBus(), path),
- path(path),
+ Iface(utils::getBus(), path), path(path),
#ifdef POWER10
pmode(powerModeRef),
#endif
diff --git a/occ_presence.hpp b/occ_presence.hpp
index ef63c89..c9ab3fc 100644
--- a/occ_presence.hpp
+++ b/occ_presence.hpp
@@ -29,8 +29,7 @@
*/
Presence(EventPtr& event, const fs::path& file, const Manager& mgr,
std::function<void(int)> callBack = nullptr) :
- Error(event, file, callBack),
- manager(mgr)
+ Error(event, file, callBack), manager(mgr)
{
// Nothing to do here.
}
diff --git a/occ_status.cpp b/occ_status.cpp
index 078447c..f8a3e8d 100644
--- a/occ_status.cpp
+++ b/occ_status.cpp
@@ -360,9 +360,9 @@
}
// Build the base HWMON path
- fs::path prefixPath = fs::path{OCC_HWMON_PATH + "occ-hwmon."s +
- std::to_string(instance + 1) +
- "/hwmon/"s};
+ fs::path prefixPath =
+ fs::path{OCC_HWMON_PATH + "occ-hwmon."s +
+ std::to_string(instance + 1) + "/hwmon/"s};
// Get the hwmonXX directory name
try
diff --git a/pldm.cpp b/pldm.cpp
index b573d66..67847c8 100644
--- a/pldm.cpp
+++ b/pldm.cpp
@@ -315,10 +315,9 @@
}
}
-void Interface::fetchEffecterInfo(uint16_t stateSetId,
- InstanceToEffecter& instanceToEffecterMap,
- CompositeEffecterCount& effecterCount,
- uint8_t& stateIdPos)
+void Interface::fetchEffecterInfo(
+ uint16_t stateSetId, InstanceToEffecter& instanceToEffecterMap,
+ CompositeEffecterCount& effecterCount, uint8_t& stateIdPos)
{
PdrList pdrs{};
@@ -390,10 +389,9 @@
}
}
-std::vector<uint8_t>
- Interface::prepareSetEffecterReq(EffecterID effecterId,
- CompositeEffecterCount effecterCount,
- uint8_t stateIdPos, uint8_t stateSetValue)
+std::vector<uint8_t> Interface::prepareSetEffecterReq(
+ EffecterID effecterId, CompositeEffecterCount effecterCount,
+ uint8_t stateIdPos, uint8_t stateSetValue)
{
if (!getPldmInstanceId())
{
@@ -860,8 +858,8 @@
pldmIface->pldmInstanceID = std::nullopt;
// Set pointer to autodelete
- std::unique_ptr<uint8_t, decltype(std::free)*> responseMsgPtr{responseMsg,
- std::free};
+ std::unique_ptr<uint8_t, decltype(std::free)*> responseMsgPtr{
+ responseMsg, std::free};
auto response = reinterpret_cast<pldm_msg*>(responseMsgPtr.get());
if (response->payload[0] != PLDM_SUCCESS)
@@ -945,8 +943,8 @@
return 0;
};
-std::vector<uint8_t> Interface::encodeGetStateSensorRequest(uint8_t instance,
- uint16_t sensorId)
+std::vector<uint8_t>
+ Interface::encodeGetStateSensorRequest(uint8_t instance, uint16_t sensorId)
{
if (!getPldmInstanceId())
{
@@ -956,8 +954,8 @@
}
bitfield8_t sRearm = {0};
- const size_t msgSize = sizeof(pldm_msg_hdr) +
- PLDM_GET_STATE_SENSOR_READINGS_REQ_BYTES;
+ const size_t msgSize =
+ sizeof(pldm_msg_hdr) + PLDM_GET_STATE_SENSOR_READINGS_REQ_BYTES;
std::vector<uint8_t> request(msgSize);
auto msg = reinterpret_cast<pldm_msg*>(request.data());
diff --git a/pldm.hpp b/pldm.hpp
index 1f1bad1..384ad20 100644
--- a/pldm.hpp
+++ b/pldm.hpp
@@ -63,9 +63,8 @@
std::function<bool(open_power::occ::instanceID, bool)> callBack,
std::function<void(open_power::occ::instanceID, bool)> sbeCallBack,
std::function<void(bool)> safeModeCallBack, EventPtr& event) :
- callBack(callBack),
- sbeCallBack(sbeCallBack), safeModeCallBack(safeModeCallBack),
- event(event),
+ callBack(callBack), sbeCallBack(sbeCallBack),
+ safeModeCallBack(safeModeCallBack), event(event),
pldmEventSignal(
open_power::occ::utils::getBus(),
MatchRules::type::signal() +
@@ -135,10 +134,9 @@
* @return PLDM request message to be sent to host for OCC reset or SBE
* HRESET, empty response in the case of failure.
*/
- std::vector<uint8_t>
- prepareSetEffecterReq(EffecterID effecterId,
- CompositeEffecterCount effecterCount,
- uint8_t stateIdPos, uint8_t stateSetValue);
+ std::vector<uint8_t> prepareSetEffecterReq(
+ EffecterID effecterId, CompositeEffecterCount effecterCount,
+ uint8_t stateIdPos, uint8_t stateSetValue);
/** @brief Send the PLDM message to reset the OCC
*
@@ -346,8 +344,8 @@
*
* @return request - The encoded PLDM messsage to be sent
*/
- std::vector<uint8_t> encodeGetStateSensorRequest(uint8_t instance,
- uint16_t sensorId);
+ std::vector<uint8_t>
+ encodeGetStateSensorRequest(uint8_t instance, uint16_t sensorId);
/** @brief setup PLDM transport for sending and receiving PLDM messages.
*
diff --git a/powercap.cpp b/powercap.cpp
index be9f90e..a70d4e9 100644
--- a/powercap.cpp
+++ b/powercap.cpp
@@ -463,8 +463,8 @@
try
{
- prop = utils::getProperty(PCAP_PATH, PCAP_INTERFACE,
- POWER_CAP_SOFT_MIN);
+ prop =
+ utils::getProperty(PCAP_PATH, PCAP_INTERFACE, POWER_CAP_SOFT_MIN);
softMin = std::get<uint32_t>(prop);
}
catch (const sdbusplus::exception_t& e)
@@ -479,8 +479,8 @@
try
{
- prop = utils::getProperty(PCAP_PATH, PCAP_INTERFACE,
- POWER_CAP_HARD_MIN);
+ prop =
+ utils::getProperty(PCAP_PATH, PCAP_INTERFACE, POWER_CAP_HARD_MIN);
hardMin = std::get<uint32_t>(prop);
}
catch (const sdbusplus::exception_t& e)
diff --git a/powercap.hpp b/powercap.hpp
index 3ef09c9..45d1203 100644
--- a/powercap.hpp
+++ b/powercap.hpp
@@ -51,7 +51,7 @@
sdbusRule::argN(0, "xyz.openbmc_project.Control.Power.Cap") +
sdbusRule::interface("org.freedesktop.DBus.Properties"),
std::bind(std::mem_fn(&PowerCap::pcapChanged), this,
- std::placeholders::_1)){};
+ std::placeholders::_1)) {};
/** @brief Return the appropriate value to write to the OCC (output/DC
* power)
diff --git a/powermode.cpp b/powermode.cpp
index 3055050..776edc4 100644
--- a/powermode.cpp
+++ b/powermode.cpp
@@ -71,9 +71,9 @@
using Mode =
sdbusplus::xyz::openbmc_project::Control::Power::server::Mode;
// Update power modes that will be allowed by the Redfish interface
- ModeInterface::allowedPowerModes({Mode::PowerMode::Static,
- Mode::PowerMode::MaximumPerformance,
- Mode::PowerMode::PowerSaving});
+ ModeInterface::allowedPowerModes(
+ {Mode::PowerMode::Static, Mode::PowerMode::MaximumPerformance,
+ Mode::PowerMode::PowerSaving});
}
SysPwrMode currentMode;
@@ -136,8 +136,8 @@
.c_str());
if (!occCmd)
{
- occCmd = std::make_unique<open_power::occ::OccCommand>(occInstance,
- path.c_str());
+ occCmd = std::make_unique<open_power::occ::OccCommand>(
+ occInstance, path.c_str());
}
masterOccSet = true;
};
@@ -857,9 +857,9 @@
std::string path = "/";
std::string service =
utils::getServiceUsingSubTree(PMODE_DEFAULT_INTERFACE, path);
- auto method = bus.new_method_call(service.c_str(), path.c_str(),
- "org.freedesktop.DBus.Properties",
- "Get");
+ auto method =
+ bus.new_method_call(service.c_str(), path.c_str(),
+ "org.freedesktop.DBus.Properties", "Get");
method.append(PMODE_DEFAULT_INTERFACE, "PowerMode");
auto reply = bus.call(method);
@@ -867,8 +867,8 @@
reply.read(stateEntryValue);
auto propVal = std::get<std::string>(stateEntryValue);
- const std::string fullModeString = PMODE_INTERFACE + ".PowerMode."s +
- propVal;
+ const std::string fullModeString =
+ PMODE_INTERFACE + ".PowerMode."s + propVal;
defaultMode = powermode::convertStringToMode(fullModeString);
if (!VALID_POWER_MODE_SETTING(defaultMode))
{
@@ -914,9 +914,9 @@
std::string path = "/";
std::string service =
utils::getServiceUsingSubTree(PMODE_DEFAULT_INTERFACE, path);
- auto method = bus.new_method_call(service.c_str(), path.c_str(),
- "org.freedesktop.DBus.Properties",
- "GetAll");
+ auto method =
+ bus.new_method_call(service.c_str(), path.c_str(),
+ "org.freedesktop.DBus.Properties", "GetAll");
method.append(PMODE_DEFAULT_INTERFACE);
auto reply = bus.call(method);
reply.read(ipsProperties);
@@ -1035,10 +1035,10 @@
const int open_errno = errno;
if (fd < 0)
{
- log<level::ERR>(std::format("openIpsFile Error({})={} : File={}",
- open_errno, strerror(open_errno),
- ipsStatusFile.c_str())
- .c_str());
+ log<level::ERR>(
+ std::format("openIpsFile Error({})={} : File={}", open_errno,
+ strerror(open_errno), ipsStatusFile.c_str())
+ .c_str());
close(fd);
@@ -1200,10 +1200,10 @@
// If the Retry did not get to "watching = true" we already have an
// error log, just post trace.
- log<level::ERR>(std::format("Retry on File seek Error({})={} : File={}",
- open_errno, strerror(open_errno),
- ipsStatusFile.c_str())
- .c_str());
+ log<level::ERR>(
+ std::format("Retry on File seek Error({})={} : File={}", open_errno,
+ strerror(open_errno), ipsStatusFile.c_str())
+ .c_str());
// NOTE: this will leave the system not reporting IPS active state to
// Fan Controls, Until an APP reload, or IPL and we will attempt again.
@@ -1305,9 +1305,9 @@
std::string path = "/";
std::string service =
utils::getServiceUsingSubTree(PMODE_DEFAULT_INTERFACE, path);
- auto method = bus.new_method_call(service.c_str(), path.c_str(),
- "org.freedesktop.DBus.Properties",
- "GetAll");
+ auto method =
+ bus.new_method_call(service.c_str(), path.c_str(),
+ "org.freedesktop.DBus.Properties", "GetAll");
method.append(PMODE_DEFAULT_INTERFACE);
auto reply = bus.call(method);
reply.read(powerModeProperties);
@@ -1340,8 +1340,8 @@
for (auto mode : modeList)
{
// Ensure mode is valid
- const std::string fullModeString = PMODE_INTERFACE +
- ".PowerMode."s + mode;
+ const std::string fullModeString =
+ PMODE_INTERFACE + ".PowerMode."s + mode;
log<level::INFO>(
std::format("getSupportedModes(): {}", mode).c_str());
SysPwrMode modeValue =
@@ -1385,8 +1385,8 @@
for (auto mode : OmodeList)
{
// Ensure mode is valid
- const std::string fullModeString = PMODE_INTERFACE +
- ".PowerMode."s + mode;
+ const std::string fullModeString =
+ PMODE_INTERFACE + ".PowerMode."s + mode;
SysPwrMode modeValue =
powermode::convertStringToMode(fullModeString);
if (VALID_POWER_MODE_SETTING(modeValue) ||
diff --git a/powermode.hpp b/powermode.hpp
index 7133948..a9b01de 100644
--- a/powermode.hpp
+++ b/powermode.hpp
@@ -378,9 +378,9 @@
SysPwrMode::MAX_FREQ};
/** @brief IPS status data filename to read */
- const fs::path ipsStatusFile = std::filesystem::path{OCC_HWMON_PATH} /
- std::filesystem::path{OCC_MASTER_NAME} /
- "occ_ips_status";
+ const fs::path ipsStatusFile =
+ std::filesystem::path{OCC_HWMON_PATH} /
+ std::filesystem::path{OCC_MASTER_NAME} / "occ_ips_status";
/** @brief Current state of error watching */
bool watching = false;
diff --git a/utils.cpp b/utils.cpp
index 4b85604..44abfa4 100644
--- a/utils.cpp
+++ b/utils.cpp
@@ -122,9 +122,8 @@
}
}
-std::vector<std::string>
- getSubtreePaths(const std::vector<std::string>& interfaces,
- const std::string& path)
+std::vector<std::string> getSubtreePaths(
+ const std::vector<std::string>& interfaces, const std::string& path)
{
std::vector<std::string> paths;
@@ -199,9 +198,9 @@
throw std::runtime_error("getStateValue: Failed to get service");
}
- auto method = bus.new_method_call(service.c_str(), objPath.c_str(),
- "org.freedesktop.DBus.Properties",
- "Get");
+ auto method =
+ bus.new_method_call(service.c_str(), objPath.c_str(),
+ "org.freedesktop.DBus.Properties", "Get");
method.append(intf, state);
diff --git a/utils.hpp b/utils.hpp
index eb38c03..2085bf4 100644
--- a/utils.hpp
+++ b/utils.hpp
@@ -75,9 +75,8 @@
*
* @throw sdbusplus::exception_t when it fails
*/
-std::vector<std::string>
- getSubtreePaths(const std::vector<std::string>& interfaces,
- const std::string& path = "/");
+std::vector<std::string> getSubtreePaths(
+ const std::vector<std::string>& interfaces, const std::string& path = "/");
/**
* @brief Get the D-Bus service and object path for an interface