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: Ide19264aa5b2b01a5102b4b2a9cf226ba8dec699
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/include/commandutils.hpp b/include/commandutils.hpp
index f52b9b7..58b0b2d 100644
--- a/include/commandutils.hpp
+++ b/include/commandutils.hpp
@@ -79,10 +79,9 @@
}
}
-inline static void ipmiPrintAndRegister(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
- ipmi_context_t context,
- ipmid_callback_t handler,
- ipmi_cmd_privilege_t priv)
+inline static void ipmiPrintAndRegister(
+ ipmi_netfn_t netfn, ipmi_cmd_t cmd, ipmi_context_t context,
+ ipmid_callback_t handler, ipmi_cmd_privilege_t priv)
{
printRegistration(netfn, cmd);
ipmi_register_callback(netfn, cmd, context, handler, priv);
diff --git a/include/oemcommands.hpp b/include/oemcommands.hpp
index 3893bdf..aedd592 100644
--- a/include/oemcommands.hpp
+++ b/include/oemcommands.hpp
@@ -167,9 +167,9 @@
Bit3=0b: IPv4 first
Bit3=1b: IPv6 first
*/
-std::map<std::string, int> bootMap = {{"USB_DEV", 0}, {"NET_IPV4", 1},
- {"NET_IPV6", 9}, {"SATA_HDD", 2},
- {"SATA_CD", 3}, {"OTHER", 4}};
+std::map<std::string, int> bootMap = {
+ {"USB_DEV", 0}, {"NET_IPV4", 1}, {"NET_IPV6", 9},
+ {"SATA_HDD", 2}, {"SATA_CD", 3}, {"OTHER", 4}};
std::map<size_t, std::string> dimmVenMap = {
{0xce, "Samsung"}, {0xad, "Hynix"}, {0x2c, "Micron"}};
diff --git a/include/sensorutils.hpp b/include/sensorutils.hpp
index 00e844d..766e9dc 100644
--- a/include/sensorutils.hpp
+++ b/include/sensorutils.hpp
@@ -77,10 +77,10 @@
return false;
}
sdbusplus::bus_t dbus(bus);
- auto mapperCall = dbus.new_method_call("xyz.openbmc_project.ObjectMapper",
- "/xyz/openbmc_project/object_mapper",
- "xyz.openbmc_project.ObjectMapper",
- "GetSubTree");
+ auto mapperCall =
+ dbus.new_method_call("xyz.openbmc_project.ObjectMapper",
+ "/xyz/openbmc_project/object_mapper",
+ "xyz.openbmc_project.ObjectMapper", "GetSubTree");
static constexpr const auto depth = 2;
static constexpr std::array<const char*, 3> interfaces = {
"xyz.openbmc_project.Sensor.Value",
@@ -164,10 +164,9 @@
return 0x1; // reading type = threshold
}
-static inline bool getSensorAttributes(const double max, const double min,
- int16_t& mValue, int8_t& rExp,
- int16_t& bValue, int8_t& bExp,
- bool& bSigned)
+static inline bool getSensorAttributes(
+ const double max, const double min, int16_t& mValue, int8_t& rExp,
+ int16_t& bValue, int8_t& bExp, bool& bSigned)
{
// computing y = (10^rRexp) * (Mx + (B*(10^Bexp)))
// check for 0, assume always positive
@@ -275,10 +274,9 @@
return true;
}
-static inline uint8_t
- scaleIPMIValueFromDouble(const double value, const uint16_t mValue,
- const int8_t rExp, const uint16_t bValue,
- const int8_t bExp, const bool bSigned)
+static inline uint8_t scaleIPMIValueFromDouble(
+ const double value, const uint16_t mValue, const int8_t rExp,
+ const uint16_t bValue, const int8_t bExp, const bool bSigned)
{
uint32_t scaledValue =
(value - (bValue * std::pow(10, bExp) * std::pow(10, rExp))) /
diff --git a/src/appcommands.cpp b/src/appcommands.cpp
index ecbc2b4..4c7b229 100644
--- a/src/appcommands.cpp
+++ b/src/appcommands.cpp
@@ -323,8 +323,8 @@
//----------------------------------------------------------------------
// Set Sys Info Params (IPMI/Sec 22.14a) (CMD_APP_SET_SYS_INFO_PARAMS)
//----------------------------------------------------------------------
-ipmi::RspType<uint8_t> ipmiAppSetSysInfoParams(ipmi::Context::ptr ctx,
- std::vector<uint8_t> req)
+ipmi::RspType<uint8_t>
+ ipmiAppSetSysInfoParams(ipmi::Context::ptr ctx, std::vector<uint8_t> req)
{
uint8_t param = req[0];
uint8_t req_len = req.size();
@@ -401,9 +401,8 @@
//----------------------------------------------------------------------
// Get Sys Info Params (IPMI/Sec 22.14b) (CMD_APP_GET_SYS_INFO_PARAMS)
//----------------------------------------------------------------------
-ipmi::RspType<std::vector<uint8_t>>
- ipmiAppGetSysInfoParams(ipmi::Context::ptr ctx, uint8_t, uint8_t param,
- uint8_t, uint8_t)
+ipmi::RspType<std::vector<uint8_t>> ipmiAppGetSysInfoParams(
+ ipmi::Context::ptr ctx, uint8_t, uint8_t param, uint8_t, uint8_t)
{
int len;
std::vector<uint8_t> respData;
@@ -459,10 +458,10 @@
break;
case SYS_INFO_PARAM_BIOS_CURRENT_BOOT_LIST:
len = appData[KEY_BIOS_BOOT_LEN].get<uint8_t>();
- respData.insert(respData.end(),
- std::begin(sysInfoParams.bios_current_boot_list),
- std::begin(sysInfoParams.bios_current_boot_list) +
- len);
+ respData.insert(
+ respData.end(),
+ std::begin(sysInfoParams.bios_current_boot_list),
+ std::begin(sysInfoParams.bios_current_boot_list) + len);
break;
case SYS_INFO_PARAM_BIOS_FIXED_BOOT_DEVICE:
respData.insert(respData.end(),
diff --git a/src/biccommands.cpp b/src/biccommands.cpp
index 2220dfe..6da886e 100644
--- a/src/biccommands.cpp
+++ b/src/biccommands.cpp
@@ -154,10 +154,9 @@
// netfn=0x38 and cmd=0x08 or 0x33 send the response back to the sender.
//----------------------------------------------------------------------
-ipmi::RspType<IanaType> ipmiOemPostCodeHandler(ipmi::Context::ptr ctx,
- IanaType reqIana,
- uint8_t dataLen,
- std::vector<uint8_t> data)
+ipmi::RspType<IanaType>
+ ipmiOemPostCodeHandler(ipmi::Context::ptr ctx, IanaType reqIana,
+ uint8_t dataLen, std::vector<uint8_t> data)
{
// creating bus connection
auto conn = getSdBus();
@@ -248,9 +247,8 @@
// send the response back to the sender.
//----------------------------------------------------------------------
-ipmi::RspType<IanaType> ipmiOemSetHostPowerState(ipmi::Context::ptr ctx,
- IanaType reqIana,
- uint8_t status)
+ipmi::RspType<IanaType> ipmiOemSetHostPowerState(
+ ipmi::Context::ptr ctx, IanaType reqIana, uint8_t status)
{
std::string targetUnit;
@@ -298,9 +296,8 @@
// netfn=0x38 and cmd=0x19 send the response back to the sender.
//----------------------------------------------------------------------
-ipmi::RspType<IanaType, flashSize>
- ipmiOemGetBiosFlashSize(ipmi::Context::ptr ctx, IanaType ianaReq,
- uint8_t target)
+ipmi::RspType<IanaType, flashSize> ipmiOemGetBiosFlashSize(
+ ipmi::Context::ptr ctx, IanaType ianaReq, uint8_t target)
{
if (iana != ianaReq)
{
diff --git a/src/commandutils.cpp b/src/commandutils.cpp
index 007bb09..06f9321 100644
--- a/src/commandutils.cpp
+++ b/src/commandutils.cpp
@@ -28,10 +28,10 @@
}
sdbusplus::bus_t dbus(ipmid_get_sd_bus_connection());
- auto mapperCall = dbus.new_method_call("xyz.openbmc_project.ObjectMapper",
- "/xyz/openbmc_project/object_mapper",
- "xyz.openbmc_project.ObjectMapper",
- "GetSubTreePaths");
+ auto mapperCall = dbus.new_method_call(
+ "xyz.openbmc_project.ObjectMapper",
+ "/xyz/openbmc_project/object_mapper",
+ "xyz.openbmc_project.ObjectMapper", "GetSubTreePaths");
static constexpr int32_t depth = 0;
static constexpr auto iface = "xyz.openbmc_project.Configuration.EEPROM";
static constexpr auto entityManager = "xyz.openbmc_project.EntityManager";
diff --git a/src/oemcommands.cpp b/src/oemcommands.cpp
index 6d9af87..b8ea6f2 100644
--- a/src/oemcommands.cpp
+++ b/src/oemcommands.cpp
@@ -133,9 +133,9 @@
for (auto& object : objectTree)
{
- auto variant = ipmi::getDbusProperty(bus, object.second.begin()->first,
- object.first, IP_INTERFACE,
- "Type");
+ auto variant =
+ ipmi::getDbusProperty(bus, object.second.begin()->first,
+ object.first, IP_INTERFACE, "Type");
if (std::get<std::string>(variant) != protocol)
{
continue;
@@ -210,8 +210,8 @@
std::tuple<std::string, std::string> objPath(size_t id)
{
std::string hostName = "host" + std::to_string(id);
- std::string bootObjPath = "/xyz/openbmc_project/control/" + hostName +
- "/boot";
+ std::string bootObjPath =
+ "/xyz/openbmc_project/control/" + hostName + "/boot";
return std::make_tuple(std::move(bootObjPath), std::move(hostName));
}
@@ -237,8 +237,8 @@
std::string bootOption =
sdbusplus::message::convert_to_string<boot::BootMode>(bootValue);
- std::string service = getService(*dbus, ipmi::boot::bootModeIntf,
- bootObjPath);
+ std::string service =
+ getService(*dbus, ipmi::boot::bootModeIntf, bootObjPath);
setDbusProperty(*dbus, service, bootObjPath, ipmi::boot::bootModeIntf,
ipmi::boot::bootModeProp, bootOption);
@@ -315,11 +315,11 @@
// GETTING PROPERTY OF MODE INTERFACE
- std::string service = getService(*dbus, ipmi::boot::bootModeIntf,
- bootObjPath);
- Value variant = getDbusProperty(*dbus, service, bootObjPath,
- ipmi::boot::bootModeIntf,
- ipmi::boot::bootModeProp);
+ std::string service =
+ getService(*dbus, ipmi::boot::bootModeIntf, bootObjPath);
+ Value variant =
+ getDbusProperty(*dbus, service, bootObjPath, ipmi::boot::bootModeIntf,
+ ipmi::boot::bootModeProp);
auto bootMode = sdbusplus::message::convert_from_string<boot::BootMode>(
std::get<std::string>(variant));
@@ -329,18 +329,18 @@
// GETTING PROPERTY OF TYPE INTERFACE
service = getService(*dbus, ipmi::boot::bootTypeIntf, bootObjPath);
- variant = getDbusProperty(*dbus, service, bootObjPath,
- ipmi::boot::bootTypeIntf,
- ipmi::boot::bootTypeProp);
+ variant =
+ getDbusProperty(*dbus, service, bootObjPath, ipmi::boot::bootTypeIntf,
+ ipmi::boot::bootTypeProp);
auto bootType = sdbusplus::message::convert_from_string<boot::BootType>(
std::get<std::string>(variant));
// Get the valid bit to boot enabled property
service = getService(*dbus, ipmi::boot::bootEnableIntf, bootObjPath);
- variant = getDbusProperty(*dbus, service, bootObjPath,
- ipmi::boot::bootEnableIntf,
- ipmi::boot::bootEnableProp);
+ variant =
+ getDbusProperty(*dbus, service, bootObjPath, ipmi::boot::bootEnableIntf,
+ ipmi::boot::bootEnableProp);
bool validFlag = std::get<bool>(variant);
@@ -541,10 +541,10 @@
return -1;
}
sdbusplus::bus_t dbus(bus);
- auto mapperCall = dbus.new_method_call("xyz.openbmc_project.ObjectMapper",
- "/xyz/openbmc_project/object_mapper",
- "xyz.openbmc_project.ObjectMapper",
- "GetSubTreePaths");
+ auto mapperCall = dbus.new_method_call(
+ "xyz.openbmc_project.ObjectMapper",
+ "/xyz/openbmc_project/object_mapper",
+ "xyz.openbmc_project.ObjectMapper", "GetSubTreePaths");
static constexpr std::array<const char*, 1> interface = {
"xyz.openbmc_project.Inventory.Decorator.Asset"};
mapperCall.append("/xyz/openbmc_project/inventory/", depth, interface);
@@ -745,10 +745,9 @@
//----------------------------------------------------------------------
// Get Debug Frame Info
//----------------------------------------------------------------------
-ipmi_ret_t ipmiOemDbgGetFrameInfo(ipmi_netfn_t, ipmi_cmd_t,
- ipmi_request_t request,
- ipmi_response_t response,
- ipmi_data_len_t data_len, ipmi_context_t)
+ipmi_ret_t ipmiOemDbgGetFrameInfo(
+ ipmi_netfn_t, ipmi_cmd_t, ipmi_request_t request, ipmi_response_t response,
+ ipmi_data_len_t data_len, ipmi_context_t)
{
uint8_t* req = reinterpret_cast<uint8_t*>(request);
uint8_t* res = reinterpret_cast<uint8_t*>(response);
@@ -764,10 +763,9 @@
//----------------------------------------------------------------------
// Get Debug Updated Frames
//----------------------------------------------------------------------
-ipmi_ret_t ipmiOemDbgGetUpdFrames(ipmi_netfn_t, ipmi_cmd_t,
- ipmi_request_t request,
- ipmi_response_t response,
- ipmi_data_len_t data_len, ipmi_context_t)
+ipmi_ret_t ipmiOemDbgGetUpdFrames(
+ ipmi_netfn_t, ipmi_cmd_t, ipmi_request_t request, ipmi_response_t response,
+ ipmi_data_len_t data_len, ipmi_context_t)
{
uint8_t* req = reinterpret_cast<uint8_t*>(request);
uint8_t* res = reinterpret_cast<uint8_t*>(response);
@@ -787,10 +785,9 @@
//----------------------------------------------------------------------
// Get Debug POST Description
//----------------------------------------------------------------------
-ipmi_ret_t ipmiOemDbgGetPostDesc(ipmi_netfn_t, ipmi_cmd_t,
- ipmi_request_t request,
- ipmi_response_t response,
- ipmi_data_len_t data_len, ipmi_context_t)
+ipmi_ret_t ipmiOemDbgGetPostDesc(
+ ipmi_netfn_t, ipmi_cmd_t, ipmi_request_t request, ipmi_response_t response,
+ ipmi_data_len_t data_len, ipmi_context_t)
{
uint8_t* req = reinterpret_cast<uint8_t*>(request);
uint8_t* res = reinterpret_cast<uint8_t*>(response);
@@ -826,10 +823,9 @@
//----------------------------------------------------------------------
// Get Debug GPIO Description
//----------------------------------------------------------------------
-ipmi_ret_t ipmiOemDbgGetGpioDesc(ipmi_netfn_t, ipmi_cmd_t,
- ipmi_request_t request,
- ipmi_response_t response,
- ipmi_data_len_t data_len, ipmi_context_t)
+ipmi_ret_t ipmiOemDbgGetGpioDesc(
+ ipmi_netfn_t, ipmi_cmd_t, ipmi_request_t request, ipmi_response_t response,
+ ipmi_data_len_t data_len, ipmi_context_t)
{
uint8_t* req = reinterpret_cast<uint8_t*>(request);
uint8_t* res = reinterpret_cast<uint8_t*>(response);
@@ -866,10 +862,9 @@
//----------------------------------------------------------------------
// Get Debug Frame Data
//----------------------------------------------------------------------
-ipmi_ret_t ipmiOemDbgGetFrameData(ipmi_netfn_t, ipmi_cmd_t,
- ipmi_request_t request,
- ipmi_response_t response,
- ipmi_data_len_t data_len, ipmi_context_t)
+ipmi_ret_t ipmiOemDbgGetFrameData(
+ ipmi_netfn_t, ipmi_cmd_t, ipmi_request_t request, ipmi_response_t response,
+ ipmi_data_len_t data_len, ipmi_context_t)
{
uint8_t* req = reinterpret_cast<uint8_t*>(request);
uint8_t* res = reinterpret_cast<uint8_t*>(response);
@@ -903,10 +898,9 @@
//----------------------------------------------------------------------
// Get Debug Control Panel
//----------------------------------------------------------------------
-ipmi_ret_t ipmiOemDbgGetCtrlPanel(ipmi_netfn_t, ipmi_cmd_t,
- ipmi_request_t request,
- ipmi_response_t response,
- ipmi_data_len_t data_len, ipmi_context_t)
+ipmi_ret_t ipmiOemDbgGetCtrlPanel(
+ ipmi_netfn_t, ipmi_cmd_t, ipmi_request_t request, ipmi_response_t response,
+ ipmi_data_len_t data_len, ipmi_context_t)
{
uint8_t* req = reinterpret_cast<uint8_t*>(request);
uint8_t* res = reinterpret_cast<uint8_t*>(response);
@@ -997,9 +991,9 @@
auto conn = getSdBus();
/* Get the post codes by calling GetPostCodes method */
- auto msg = conn->new_method_call(postCodeService.c_str(),
- postCodeObjPath.c_str(), postCodeInterface,
- "GetPostCodes");
+ auto msg =
+ conn->new_method_call(postCodeService.c_str(), postCodeObjPath.c_str(),
+ postCodeInterface, "GetPostCodes");
msg.append(lastestPostCodeIndex);
try
@@ -1569,10 +1563,9 @@
// Byte 6..7 – Revision
//
-ipmi::RspType<> ipmiOemQSetProcInfo(ipmi::Context::ptr ctx, uint8_t, uint8_t,
- uint8_t, uint8_t procIndex,
- uint8_t paramSel,
- std::vector<uint8_t> request)
+ipmi::RspType<> ipmiOemQSetProcInfo(
+ ipmi::Context::ptr ctx, uint8_t, uint8_t, uint8_t, uint8_t procIndex,
+ uint8_t paramSel, std::vector<uint8_t> request)
{
uint8_t numParam = sizeof(cpuInfoKey) / sizeof(uint8_t*);
std::stringstream ss;
@@ -1720,10 +1713,9 @@
// Byte 1 - Module Manufacturer ID, LSB
// Byte 2 - Module Manufacturer ID, MSB
//
-ipmi::RspType<> ipmiOemQSetDimmInfo(ipmi::Context::ptr ctx, uint8_t, uint8_t,
- uint8_t, uint8_t dimmIndex,
- uint8_t paramSel,
- std::vector<uint8_t> request)
+ipmi::RspType<> ipmiOemQSetDimmInfo(
+ ipmi::Context::ptr ctx, uint8_t, uint8_t, uint8_t, uint8_t dimmIndex,
+ uint8_t paramSel, std::vector<uint8_t> request)
{
uint8_t numParam = sizeof(dimmInfoKey) / sizeof(uint8_t*);
std::stringstream ss;
@@ -1990,10 +1982,9 @@
// Byte 2..N – Configuration parameter data (see Table_1415h Parameters of HDD
// Information)
//
-ipmi_ret_t ipmiOemQGetDriveInfo(ipmi_netfn_t, ipmi_cmd_t,
- ipmi_request_t request,
- ipmi_response_t response,
- ipmi_data_len_t data_len, ipmi_context_t)
+ipmi_ret_t ipmiOemQGetDriveInfo(
+ ipmi_netfn_t, ipmi_cmd_t, ipmi_request_t request, ipmi_response_t response,
+ ipmi_data_len_t data_len, ipmi_context_t)
{
qDriveInfo_t* req = reinterpret_cast<qDriveInfo_t*>(request);
uint8_t numParam = sizeof(driveInfoKey) / sizeof(uint8_t*);
@@ -2073,38 +2064,33 @@
/* DCMI Command handellers. */
-ipmi::RspType<std::vector<uint8_t>>
- ipmiOemDCMIGetPowerReading(ipmi::Context::ptr ctx,
- std::vector<uint8_t> reqData)
+ipmi::RspType<std::vector<uint8_t>> ipmiOemDCMIGetPowerReading(
+ ipmi::Context::ptr ctx, std::vector<uint8_t> reqData)
{
return sendDCMICmd(ctx, ipmi::dcmi::cmdGetPowerReading, reqData);
}
-ipmi::RspType<std::vector<uint8_t>>
- ipmiOemDCMIGetPowerLimit(ipmi::Context::ptr ctx,
- std::vector<uint8_t> reqData)
+ipmi::RspType<std::vector<uint8_t>> ipmiOemDCMIGetPowerLimit(
+ ipmi::Context::ptr ctx, std::vector<uint8_t> reqData)
{
return sendDCMICmd(ctx, ipmi::dcmi::cmdGetPowerLimit, reqData);
}
-ipmi::RspType<std::vector<uint8_t>>
- ipmiOemDCMISetPowerLimit(ipmi::Context::ptr ctx,
- std::vector<uint8_t> reqData)
+ipmi::RspType<std::vector<uint8_t>> ipmiOemDCMISetPowerLimit(
+ ipmi::Context::ptr ctx, std::vector<uint8_t> reqData)
{
return sendDCMICmd(ctx, ipmi::dcmi::cmdSetPowerLimit, reqData);
}
-ipmi::RspType<std::vector<uint8_t>>
- ipmiOemDCMIApplyPowerLimit(ipmi::Context::ptr ctx,
- std::vector<uint8_t> reqData)
+ipmi::RspType<std::vector<uint8_t>> ipmiOemDCMIApplyPowerLimit(
+ ipmi::Context::ptr ctx, std::vector<uint8_t> reqData)
{
return sendDCMICmd(ctx, ipmi::dcmi::cmdActDeactivatePwrLimit, reqData);
}
// Https Boot related functions
-ipmi::RspType<std::vector<uint8_t>>
- ipmiOemGetHttpsData([[maybe_unused]] ipmi::Context::ptr ctx,
- std::vector<uint8_t> reqData)
+ipmi::RspType<std::vector<uint8_t>> ipmiOemGetHttpsData(
+ [[maybe_unused]] ipmi::Context::ptr ctx, std::vector<uint8_t> reqData)
{
if (reqData.size() < sizeof(HttpsDataReq))
return ipmi::responseReqDataLenInvalid();
@@ -2131,9 +2117,8 @@
return ipmi::responseSuccess(resData);
}
-ipmi::RspType<std::vector<uint8_t>>
- ipmiOemGetHttpsAttr([[maybe_unused]] ipmi::Context::ptr ctx,
- std::vector<uint8_t> reqData)
+ipmi::RspType<std::vector<uint8_t>> ipmiOemGetHttpsAttr(
+ [[maybe_unused]] ipmi::Context::ptr ctx, std::vector<uint8_t> reqData)
{
if (reqData.size() < sizeof(HttpsBootAttr))
return ipmi::responseReqDataLenInvalid();
@@ -2307,9 +2292,9 @@
}
template <size_t N>
-static ipmi_ret_t handleHwAssertBank(const char* name,
- std::span<const uint8_t> data,
- CrdState& currState, std::stringstream& ss)
+static ipmi_ret_t
+ handleHwAssertBank(const char* name, std::span<const uint8_t> data,
+ CrdState& currState, std::stringstream& ss)
{
if (data.size() < sizeof(CrdHwAssertBank<N>))
return IPMI_CC_REQ_DATA_LEN_INVALID;
@@ -2523,9 +2508,8 @@
return IPMI_CC_OK;
}
-ipmi::RspType<std::vector<uint8_t>>
- ipmiOemCrashdump([[maybe_unused]] ipmi::Context::ptr ctx,
- std::vector<uint8_t> reqData)
+ipmi::RspType<std::vector<uint8_t>> ipmiOemCrashdump(
+ [[maybe_unused]] ipmi::Context::ptr ctx, std::vector<uint8_t> reqData)
{
static CrdState dumpState = CrdState::free;
static std::stringstream ss;
@@ -2692,25 +2676,25 @@
PRIVILEGE_USER); // Get Drive Info
/* FB OEM DCMI Commands as per DCMI spec 1.5 Section 6 */
- ipmi::registerGroupHandler(ipmi::prioOpenBmcBase, groupDCMI,
- ipmi::dcmi::cmdGetPowerReading,
- ipmi::Privilege::User,
- ipmiOemDCMIGetPowerReading); // Get Power Reading
+ ipmi::registerGroupHandler(
+ ipmi::prioOpenBmcBase, groupDCMI, ipmi::dcmi::cmdGetPowerReading,
+ ipmi::Privilege::User,
+ ipmiOemDCMIGetPowerReading); // Get Power Reading
- ipmi::registerGroupHandler(ipmi::prioOpenBmcBase, groupDCMI,
- ipmi::dcmi::cmdGetPowerLimit,
- ipmi::Privilege::User,
- ipmiOemDCMIGetPowerLimit); // Get Power Limit
+ ipmi::registerGroupHandler(
+ ipmi::prioOpenBmcBase, groupDCMI, ipmi::dcmi::cmdGetPowerLimit,
+ ipmi::Privilege::User,
+ ipmiOemDCMIGetPowerLimit); // Get Power Limit
- ipmi::registerGroupHandler(ipmi::prioOpenBmcBase, groupDCMI,
- ipmi::dcmi::cmdSetPowerLimit,
- ipmi::Privilege::Operator,
- ipmiOemDCMISetPowerLimit); // Set Power Limit
+ ipmi::registerGroupHandler(
+ ipmi::prioOpenBmcBase, groupDCMI, ipmi::dcmi::cmdSetPowerLimit,
+ ipmi::Privilege::Operator,
+ ipmiOemDCMISetPowerLimit); // Set Power Limit
- ipmi::registerGroupHandler(ipmi::prioOpenBmcBase, groupDCMI,
- ipmi::dcmi::cmdActDeactivatePwrLimit,
- ipmi::Privilege::Operator,
- ipmiOemDCMIApplyPowerLimit); // Apply Power Limit
+ ipmi::registerGroupHandler(
+ ipmi::prioOpenBmcBase, groupDCMI, ipmi::dcmi::cmdActDeactivatePwrLimit,
+ ipmi::Privilege::Operator,
+ ipmiOemDCMIApplyPowerLimit); // Apply Power Limit
/* FB OEM BOOT ORDER COMMANDS */
ipmi::registerHandler(ipmi::prioOpenBmcBase, ipmi::netFnOemOne,
diff --git a/src/selcommands.cpp b/src/selcommands.cpp
index 51c1d15..9d5afe5 100644
--- a/src/selcommands.cpp
+++ b/src/selcommands.cpp
@@ -712,18 +712,19 @@
static void logPCHThermal(uint8_t* data, std::string& errLog)
{
- const std::vector<std::string> thresEvtName = {"Lower Non-critical",
- "Unknown",
- "Lower Critical",
- "Unknown",
- "Lower Non-recoverable",
- "Unknown",
- "Unknown",
- "Upper Non-critical",
- "Unknown",
- "Upper Critical",
- "Unknown",
- "Upper Non-recoverable"};
+ const std::vector<std::string> thresEvtName = {
+ "Lower Non-critical",
+ "Unknown",
+ "Lower Critical",
+ "Unknown",
+ "Lower Non-recoverable",
+ "Unknown",
+ "Unknown",
+ "Upper Non-critical",
+ "Unknown",
+ "Upper Critical",
+ "Unknown",
+ "Upper Non-recoverable"};
if ((data[0] & 0x0f) < 12)
{
@@ -771,9 +772,8 @@
errLog = "Unknown";
}
- errLog += ", Domain:" + nmDomName[domIdx] +
- ", ErrType:" + nmErrType[errIdx] + ", Err:0x" +
- byteToStr(data[2]);
+ errLog += ", Domain:" + nmDomName[domIdx] + ", ErrType:" +
+ nmErrType[errIdx] + ", Err:0x" + byteToStr(data[2]);
}
static void logNmCap(uint8_t* data, std::string& errLog)
@@ -860,35 +860,36 @@
static const boost::container::flat_map<
uint8_t,
std::pair<std::string, std::function<void(uint8_t*, std::string&)>>>
- sensorNameTable = {{0xE9, {"SYSTEM_EVENT", logSysEvent}},
- {0x7D, {"THERM_THRESH_EVT", logThermalEvent}},
- {0xAA, {"BUTTON", logDefault}},
- {0xAB, {"POWER_STATE", logDefault}},
- {0xEA, {"CRITICAL_IRQ", logCritIrq}},
- {0x2B, {"POST_ERROR", logPostErr}},
- {0x40, {"MACHINE_CHK_ERR", logMchChkErr}},
- {0x41, {"PCIE_ERR", logPcieErr}},
- {0x43, {"IIO_ERR", logIioErr}},
- {0X63, {"MEMORY_ECC_ERR", logDefault}},
- {0X87, {"MEMORY_ERR_LOG_DIS", logDefault}},
- {0X51, {"PROCHOT_EXT", logDefault}},
- {0X56, {"PWR_ERR", logPwrErr}},
- {0xE6, {"CATERR_A", logCatErr}},
- {0xEB, {"CATERR_B", logCatErr}},
- {0xB3, {"CPU_DIMM_HOT", logDimmHot}},
- {0x90, {"SOFTWARE_NMI", logSwNMI}},
- {0x1C, {"CPU0_THERM_STATUS", logCPUThermalSts}},
- {0x1D, {"CPU1_THERM_STATUS", logCPUThermalSts}},
- {0x16, {"ME_POWER_STATE", logMEPwrState}},
- {0x17, {"SPS_FW_HEALTH", logSPSFwHealth}},
- {0x18, {"NM_EXCEPTION_A", logNmExcA}},
- {0x08, {"PCH_THERM_THRESHOLD", logPCHThermal}},
- {0x19, {"NM_HEALTH", logNmHealth}},
- {0x1A, {"NM_CAPABILITIES", logNmCap}},
- {0x1B, {"NM_THRESHOLD", logNmThreshold}},
- {0x3B, {"PWR_THRESH_EVT", logPwrThreshold}},
- {0xE7, {"MSMI", logMSMI}},
- {0xC5, {"HPR_WARNING", logHprWarn}}};
+ sensorNameTable = {
+ {0xE9, {"SYSTEM_EVENT", logSysEvent}},
+ {0x7D, {"THERM_THRESH_EVT", logThermalEvent}},
+ {0xAA, {"BUTTON", logDefault}},
+ {0xAB, {"POWER_STATE", logDefault}},
+ {0xEA, {"CRITICAL_IRQ", logCritIrq}},
+ {0x2B, {"POST_ERROR", logPostErr}},
+ {0x40, {"MACHINE_CHK_ERR", logMchChkErr}},
+ {0x41, {"PCIE_ERR", logPcieErr}},
+ {0x43, {"IIO_ERR", logIioErr}},
+ {0X63, {"MEMORY_ECC_ERR", logDefault}},
+ {0X87, {"MEMORY_ERR_LOG_DIS", logDefault}},
+ {0X51, {"PROCHOT_EXT", logDefault}},
+ {0X56, {"PWR_ERR", logPwrErr}},
+ {0xE6, {"CATERR_A", logCatErr}},
+ {0xEB, {"CATERR_B", logCatErr}},
+ {0xB3, {"CPU_DIMM_HOT", logDimmHot}},
+ {0x90, {"SOFTWARE_NMI", logSwNMI}},
+ {0x1C, {"CPU0_THERM_STATUS", logCPUThermalSts}},
+ {0x1D, {"CPU1_THERM_STATUS", logCPUThermalSts}},
+ {0x16, {"ME_POWER_STATE", logMEPwrState}},
+ {0x17, {"SPS_FW_HEALTH", logSPSFwHealth}},
+ {0x18, {"NM_EXCEPTION_A", logNmExcA}},
+ {0x08, {"PCH_THERM_THRESHOLD", logPCHThermal}},
+ {0x19, {"NM_HEALTH", logNmHealth}},
+ {0x1A, {"NM_CAPABILITIES", logNmCap}},
+ {0x1B, {"NM_THRESHOLD", logNmThreshold}},
+ {0x3B, {"PWR_THRESH_EVT", logPwrThreshold}},
+ {0xE7, {"MSMI", logMSMI}},
+ {0xC5, {"HPR_WARNING", logHprWarn}}};
static void parseSelHelper(StdSELEntry* data, std::string& errStr)
{
@@ -1180,13 +1181,14 @@
std::vector<std::string> certErr = {
"No certificate at BMC", "IPMI transaction fail",
"Certificate data corrupted", "Reserved"};
- std::vector<std::string> pcieEvent = {"PCIe DPC Event",
- "PCIe LER Event",
- "PCIe Link Retraining and Recovery",
- "PCIe Link CRC Error Check and Retry",
- "PCIe Corrupt Data Containment",
- "PCIe Express ECRC",
- "Reserved"};
+ std::vector<std::string> pcieEvent = {
+ "PCIe DPC Event",
+ "PCIe LER Event",
+ "PCIe Link Retraining and Recovery",
+ "PCIe Link CRC Error Check and Retry",
+ "PCIe Corrupt Data Containment",
+ "PCIe Express ECRC",
+ "Reserved"};
std::vector<std::string> memEvent = {
"Memory PPR event",
"Memory Correctable Error logging limit reached",
@@ -1201,9 +1203,9 @@
"Run time", "Reserved"};
std::vector<std::string> memPpr = {"PPR success", "PPR fail", "PPR request",
"Reserved"};
- std::vector<std::string> memAdddc = {"Bank VLS", "r-Bank VLS + re-buddy",
- "r-Bank VLS + Rank VLS",
- "r-Rank VLS + re-buddy", "Reserved"};
+ std::vector<std::string> memAdddc = {
+ "Bank VLS", "r-Bank VLS + re-buddy", "r-Bank VLS + Rank VLS",
+ "r-Rank VLS + re-buddy", "Reserved"};
std::vector<std::string> pprEvent = {"PPR disable", "Soft PPR", "Hard PPR",
"Reserved"};
@@ -1293,13 +1295,13 @@
break;
case unifiedMemEvt:
eventType = ptr[9] & 0xf;
- tmpStream << std::format("GeneralInfo: MemEvent(0x{:02X})", genInfo)
- << (static_cast<MemEvtType>(eventType) !=
- MemEvtType::noDimm
- ? std::format(", {}", dimmLocationStr(
- ptr[5], ptr[6], ptr[7]))
- : "")
- << ", DIMM Failure Event: ";
+ tmpStream
+ << std::format("GeneralInfo: MemEvent(0x{:02X})", genInfo)
+ << (static_cast<MemEvtType>(eventType) != MemEvtType::noDimm
+ ? std::format(", {}",
+ dimmLocationStr(ptr[5], ptr[6], ptr[7]))
+ : "")
+ << ", DIMM Failure Event: ";
switch (static_cast<MemEvtType>(eventType))
{
@@ -1597,8 +1599,8 @@
}
}
-ipmi::RspType<uint16_t> ipmiStorageAddSELEntry(ipmi::Context::ptr ctx,
- std::vector<uint8_t> data)
+ipmi::RspType<uint16_t>
+ ipmiStorageAddSELEntry(ipmi::Context::ptr ctx, std::vector<uint8_t> data)
{
/* Per the IPMI spec, need to cancel any reservation when a
* SEL entry is added
@@ -1617,8 +1619,8 @@
fb_oem::ipmi::sel::parseSelData((ctx->hostIdx + 1), data, logErr);
static const std::string openBMCMessageRegistryVersion("0.1");
- std::string messageID = "OpenBMC." + openBMCMessageRegistryVersion +
- ".SELEntryAdded";
+ std::string messageID =
+ "OpenBMC." + openBMCMessageRegistryVersion + ".SELEntryAdded";
/* Log the Raw SEL message to the journal */
std::string journalMsg = "SEL Entry Added: " + ipmiRaw;
diff --git a/src/storagecommands.cpp b/src/storagecommands.cpp
index 346171c..84801ba 100644
--- a/src/storagecommands.cpp
+++ b/src/storagecommands.cpp
@@ -304,10 +304,9 @@
return IPMI_CC_OK;
}
-ipmi_ret_t ipmiStorageReadFRUData(ipmi_netfn_t, ipmi_cmd_t,
- ipmi_request_t request,
- ipmi_response_t response,
- ipmi_data_len_t dataLen, ipmi_context_t)
+ipmi_ret_t ipmiStorageReadFRUData(
+ ipmi_netfn_t, ipmi_cmd_t, ipmi_request_t request, ipmi_response_t response,
+ ipmi_data_len_t dataLen, ipmi_context_t)
{
if (*dataLen != 4)
{
@@ -355,10 +354,9 @@
return IPMI_CC_OK;
}
-ipmi_ret_t ipmiStorageWriteFRUData(ipmi_netfn_t, ipmi_cmd_t,
- ipmi_request_t request,
- ipmi_response_t response,
- ipmi_data_len_t dataLen, ipmi_context_t)
+ipmi_ret_t ipmiStorageWriteFRUData(
+ ipmi_netfn_t, ipmi_cmd_t, ipmi_request_t request, ipmi_response_t response,
+ ipmi_data_len_t dataLen, ipmi_context_t)
{
if (*dataLen < 4 ||
*dataLen >=
@@ -481,31 +479,33 @@
return IPMI_CC_RESPONSE_ERROR;
}
boost::container::flat_map<std::string, DbusVariant>* fruData = nullptr;
- auto fru = std::find_if(frus.begin(), frus.end(),
- [bus, address, &fruData](ManagedEntry& entry) {
- auto findFruDevice = entry.second.find("xyz.openbmc_project.FruDevice");
- if (findFruDevice == entry.second.end())
- {
- return false;
- }
- fruData = &(findFruDevice->second);
- auto findBus = findFruDevice->second.find("BUS");
- auto findAddress = findFruDevice->second.find("ADDRESS");
- if (findBus == findFruDevice->second.end() ||
- findAddress == findFruDevice->second.end())
- {
- return false;
- }
- if (std::get<uint32_t>(findBus->second) != bus)
- {
- return false;
- }
- if (std::get<uint32_t>(findAddress->second) != address)
- {
- return false;
- }
- return true;
- });
+ auto fru = std::find_if(
+ frus.begin(), frus.end(),
+ [bus, address, &fruData](ManagedEntry& entry) {
+ auto findFruDevice =
+ entry.second.find("xyz.openbmc_project.FruDevice");
+ if (findFruDevice == entry.second.end())
+ {
+ return false;
+ }
+ fruData = &(findFruDevice->second);
+ auto findBus = findFruDevice->second.find("BUS");
+ auto findAddress = findFruDevice->second.find("ADDRESS");
+ if (findBus == findFruDevice->second.end() ||
+ findAddress == findFruDevice->second.end())
+ {
+ return false;
+ }
+ if (std::get<uint32_t>(findBus->second) != bus)
+ {
+ return false;
+ }
+ if (std::get<uint32_t>(findAddress->second) != address)
+ {
+ return false;
+ }
+ return true;
+ });
if (fru == frus.end())
{
return IPMI_CC_RESPONSE_ERROR;
@@ -968,10 +968,9 @@
return -1;
}
-ipmi_ret_t ipmiStorageGetFRUInvAreaInfo(ipmi_netfn_t, ipmi_cmd_t,
- ipmi_request_t request,
- ipmi_response_t response,
- ipmi_data_len_t dataLen, ipmi_context_t)
+ipmi_ret_t ipmiStorageGetFRUInvAreaInfo(
+ ipmi_netfn_t, ipmi_cmd_t, ipmi_request_t request, ipmi_response_t response,
+ ipmi_data_len_t dataLen, ipmi_context_t)
{
if (*dataLen != 1)
{
diff --git a/src/transportcommands.cpp b/src/transportcommands.cpp
index 6e334d1..77f9ba5 100644
--- a/src/transportcommands.cpp
+++ b/src/transportcommands.cpp
@@ -46,10 +46,9 @@
//----------------------------------------------------------------------
// Get SoL Config (IPMI/Section 26.3) (CMD_TRANSPORT_GET_SOL_CONFIG)
//----------------------------------------------------------------------
-ipmi_ret_t ipmiTransGetSolConfig(ipmi_netfn_t, ipmi_cmd_t,
- ipmi_request_t request,
- ipmi_response_t response,
- ipmi_data_len_t data_len, ipmi_context_t)
+ipmi_ret_t ipmiTransGetSolConfig(
+ ipmi_netfn_t, ipmi_cmd_t, ipmi_request_t request, ipmi_response_t response,
+ ipmi_data_len_t data_len, ipmi_context_t)
{
uint8_t* req = reinterpret_cast<uint8_t*>(request);
uint8_t* res = reinterpret_cast<uint8_t*>(response);
diff --git a/src/usb-dbg.cpp b/src/usb-dbg.cpp
index d2f9f05..d47a0a1 100644
--- a/src/usb-dbg.cpp
+++ b/src/usb-dbg.cpp
@@ -57,11 +57,11 @@
try
{
std::shared_ptr<sdbusplus::asio::connection> dbus = getSdBus();
- std::string service = getService(*dbus, ipmi::selector::interface,
- ipmi::selector::path);
- Value variant = getDbusProperty(*dbus, service, ipmi::selector::path,
- ipmi::selector::interface,
- "MaxPosition");
+ std::string service =
+ getService(*dbus, ipmi::selector::interface, ipmi::selector::path);
+ Value variant =
+ getDbusProperty(*dbus, service, ipmi::selector::path,
+ ipmi::selector::interface, "MaxPosition");
maxPosition = std::get<size_t>(variant);
}
catch (const std::exception& e)
@@ -77,8 +77,8 @@
try
{
std::shared_ptr<sdbusplus::asio::connection> dbus = getSdBus();
- std::string service = getService(*dbus, ipmi::selector::interface,
- ipmi::selector::path);
+ std::string service =
+ getService(*dbus, ipmi::selector::interface, ipmi::selector::path);
Value variant = getDbusProperty(*dbus, service, ipmi::selector::path,
ipmi::selector::interface, "Position");
hostPosition = std::get<size_t>(variant);
@@ -516,8 +516,8 @@
{
if (postObj.size() != phase)
{
- std::string nextPhaseStr = "Phase" +
- std::to_string(phase + 1);
+ std::string nextPhaseStr =
+ "Phase" + std::to_string(phase + 1);
postCode = postObj[nextPhaseStr][0][0];
*next = stoul(postCode, nullptr, 16);
*end = 0;
@@ -1007,8 +1007,8 @@
}
// '*': boot flags valid, BIOS has not yet read
- bootOrderPanel.item_str[0] = std::string("Boot Order") +
- ((bootMode & bootValid) ? "*" : "");
+ bootOrderPanel.item_str[0] =
+ std::string("Boot Order") + ((bootMode & bootValid) ? "*" : "");
static const std::unordered_map<uint8_t, const char*>
bootOrderMappingTable = {