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: I61b093f75011417cc9c7acf9605200f4fa429bac
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/.clang-format b/.clang-format
index 00e2e25..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
@@ -75,9 +78,13 @@
- Regex: '.*'
Priority: 6
IndentCaseLabels: true
+IndentRequiresClause: true
IndentWidth: 4
IndentWrappedFunctionNames: true
+InsertNewlineAtEOF: true
KeepEmptyLinesAtTheStartOfBlocks: false
+LambdaBodyIndentation: OuterScope
+LineEnding: LF
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
@@ -85,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
@@ -111,7 +124,6 @@
SpacesInSquareBrackets: false
Standard: Latest
TabWidth: 4
-UseCRLF: false
UseTab: Never
...
diff --git a/common/flight_recorder.hpp b/common/flight_recorder.hpp
index 7cf3ae9..a2710f3 100644
--- a/common/flight_recorder.hpp
+++ b/common/flight_recorder.hpp
@@ -79,8 +79,8 @@
int currentIndex = index++;
tapeRecorder[currentIndex] = std::make_tuple(
pldm::utils::getCurrentSystemTime(), isRequest, buffer);
- index =
- (currentIndex == FLIGHT_RECORDER_MAX_ENTRIES - 1) ? 0 : index;
+ index = (currentIndex == FLIGHT_RECORDER_MAX_ENTRIES - 1) ? 0
+ : index;
}
}
diff --git a/common/utils.cpp b/common/utils.cpp
index 7d06fa8..fca6985 100644
--- a/common/utils.cpp
+++ b/common/utils.cpp
@@ -281,8 +281,8 @@
{
auto setDbusValue = [&dBusMap, this](const auto& variant) {
auto& bus = getBus();
- auto service =
- getService(dBusMap.objectPath.c_str(), dBusMap.interface.c_str());
+ auto service = getService(dBusMap.objectPath.c_str(),
+ dBusMap.interface.c_str());
auto method = bus.new_method_call(
service.c_str(), dBusMap.objectPath.c_str(), dbusProperties, "Set");
method.append(dBusMap.interface.c_str(), dBusMap.propertyName.c_str(),
@@ -351,8 +351,8 @@
{
auto& bus = DBusHandler::getBus();
auto service = getService(objPath, dbusInterface);
- auto method =
- bus.new_method_call(service.c_str(), objPath, dbusProperties, "Get");
+ auto method = bus.new_method_call(service.c_str(), objPath, dbusProperties,
+ "Get");
method.append(dbusInterface, dbusProp);
PropertyValue value{};
auto reply = bus.call(method);
@@ -502,8 +502,8 @@
{
return sensorPdr->sensor_id;
}
- possible_states_start +=
- possibleStateSize + sizeof(setId) + sizeof(possibleStateSize);
+ possible_states_start += possibleStateSize + sizeof(setId) +
+ sizeof(possibleStateSize);
}
}
return PLDM_INVALID_EFFECTER_ID;
diff --git a/common/utils.hpp b/common/utils.hpp
index 0efb89b..f1357db 100644
--- a/common/utils.hpp
+++ b/common/utils.hpp
@@ -41,8 +41,7 @@
CustomFD(CustomFD&&) = delete;
CustomFD& operator=(CustomFD&&) = delete;
- CustomFD(int fd) : fd(fd)
- {}
+ CustomFD(int fd) : fd(fd) {}
~CustomFD()
{
@@ -254,8 +253,8 @@
auto getDbusProperty(const char* objPath, const char* dbusProp,
const char* dbusInterface)
{
- auto VariantValue =
- getDbusPropertyVariant(objPath, dbusProp, dbusInterface);
+ auto VariantValue = getDbusPropertyVariant(objPath, dbusProp,
+ dbusInterface);
return std::get<Property>(VariantValue);
}
diff --git a/fw-update/activation.hpp b/fw-update/activation.hpp
index 3a061b1..50a6dbb 100644
--- a/fw-update/activation.hpp
+++ b/fw-update/activation.hpp
@@ -115,8 +115,8 @@
{
if (!deleteImpl)
{
- deleteImpl =
- std::make_unique<Delete>(bus, objPath, updateManager);
+ deleteImpl = std::make_unique<Delete>(bus, objPath,
+ updateManager);
}
}
diff --git a/fw-update/device_updater.cpp b/fw-update/device_updater.cpp
index 6123365..4009a48 100644
--- a/fw-update/device_updater.cpp
+++ b/fw-update/device_updater.cpp
@@ -204,9 +204,9 @@
uint8_t compResponse = 0;
uint8_t compResponseCode = 0;
- auto rc =
- decode_pass_component_table_resp(response, respMsgLen, &completionCode,
- &compResponse, &compResponseCode);
+ auto rc = decode_pass_component_table_resp(response, respMsgLen,
+ &completionCode, &compResponse,
+ &compResponseCode);
if (rc)
{
// Handle error scenario
@@ -447,8 +447,8 @@
auto responseMsg = reinterpret_cast<pldm_msg*>(response.data());
uint8_t transferResult = 0;
- auto rc =
- decode_transfer_complete_req(request, payloadLength, &transferResult);
+ auto rc = decode_transfer_complete_req(request, payloadLength,
+ &transferResult);
if (rc)
{
error("Decoding TransferComplete request failed, EID={EID}, RC = {RC}",
@@ -693,4 +693,4 @@
} // namespace fw_update
-} // namespace pldm
\ No newline at end of file
+} // namespace pldm
diff --git a/fw-update/device_updater.hpp b/fw-update/device_updater.hpp
index 03ee0c3..dcda263 100644
--- a/fw-update/device_updater.hpp
+++ b/fw-update/device_updater.hpp
@@ -212,4 +212,4 @@
} // namespace fw_update
-} // namespace pldm
\ No newline at end of file
+} // namespace pldm
diff --git a/fw-update/package_parser.cpp b/fw-update/package_parser.cpp
index 7a387ad..ddc82d6 100644
--- a/fw-update/package_parser.cpp
+++ b/fw-update/package_parser.cpp
@@ -322,4 +322,4 @@
} // namespace fw_update
-} // namespace pldm
\ No newline at end of file
+} // namespace pldm
diff --git a/fw-update/test/package_parser_test.cpp b/fw-update/test/package_parser_test.cpp
index b20777e..1720eb8 100644
--- a/fw-update/test/package_parser_test.cpp
+++ b/fw-update/test/package_parser_test.cpp
@@ -177,4 +177,4 @@
EXPECT_EQ(parser->pkgHeaderSize, fwPkgHdr.size());
EXPECT_EQ(parser->pkgVersion, pkgVersion);
EXPECT_THROW(parser->parse(fwPkgHdr, pkgSize), std::exception);
-}
\ No newline at end of file
+}
diff --git a/fw-update/update_manager.cpp b/fw-update/update_manager.cpp
index 412a420..e43d099 100644
--- a/fw-update/update_manager.cpp
+++ b/fw-update/update_manager.cpp
@@ -291,4 +291,4 @@
} // namespace fw_update
-} // namespace pldm
\ No newline at end of file
+} // namespace pldm
diff --git a/host-bmc/dbus_to_event_handler.cpp b/host-bmc/dbus_to_event_handler.cpp
index d1125f1..e8f84a6 100644
--- a/host-bmc/dbus_to_event_handler.cpp
+++ b/host-bmc/dbus_to_event_handler.cpp
@@ -49,9 +49,8 @@
return;
}
- auto platformEventMessageResponseHandler = [](mctp_eid_t /*eid*/,
- const pldm_msg* response,
- size_t respMsgLen) {
+ auto platformEventMessageResponseHandler =
+ [](mctp_eid_t /*eid*/, const pldm_msg* response, size_t respMsgLen) {
if (response == nullptr || !respMsgLen)
{
error("Failed to receive response for platform event message");
@@ -115,52 +114,50 @@
dbusMapping.interface.c_str()),
[this, sensorEventDataVec, dbusValueMapping,
dbusMapping](auto& msg) mutable {
- DbusChangedProps props{};
- std::string intf;
- msg.read(intf, props);
- if (!props.contains(dbusMapping.propertyName))
+ DbusChangedProps props{};
+ std::string intf;
+ msg.read(intf, props);
+ if (!props.contains(dbusMapping.propertyName))
+ {
+ return;
+ }
+ for (const auto& itr : dbusValueMapping)
+ {
+ bool findValue = false;
+ if (dbusMapping.propertyType == "string")
{
- return;
- }
- for (const auto& itr : dbusValueMapping)
- {
- bool findValue = false;
- if (dbusMapping.propertyType == "string")
- {
- std::string src = std::get<std::string>(itr.second);
- std::string dst = std::get<std::string>(
- props.at(dbusMapping.propertyName));
+ std::string src = std::get<std::string>(itr.second);
+ std::string dst = std::get<std::string>(
+ props.at(dbusMapping.propertyName));
- auto values = pldm::utils::split(src, "||", " ");
- for (auto& value : values)
+ auto values = pldm::utils::split(src, "||", " ");
+ for (auto& value : values)
+ {
+ if (value == dst)
{
- if (value == dst)
- {
- findValue = true;
- break;
- }
+ findValue = true;
+ break;
}
}
- else
- {
- findValue =
- itr.second == props.at(dbusMapping.propertyName)
- ? true
- : false;
- }
-
- if (findValue)
- {
- auto eventData =
- reinterpret_cast<struct pldm_sensor_event_data*>(
- sensorEventDataVec.data());
- eventData->event_class[1] = itr.first;
- eventData->event_class[2] = itr.first;
- this->sendEventMsg(PLDM_SENSOR_EVENT,
- sensorEventDataVec);
- break;
- }
}
+ else
+ {
+ findValue = itr.second == props.at(dbusMapping.propertyName)
+ ? true
+ : false;
+ }
+
+ if (findValue)
+ {
+ auto eventData =
+ reinterpret_cast<struct pldm_sensor_event_data*>(
+ sensorEventDataVec.data());
+ eventData->event_class[1] = itr.first;
+ eventData->event_class[2] = itr.first;
+ this->sendEventMsg(PLDM_SENSOR_EVENT, sensorEventDataVec);
+ break;
+ }
+ }
});
stateSensorMatchs.emplace_back(std::move(stateSensorMatch));
}
@@ -172,7 +169,7 @@
const std::map<Type, sensorEvent> sensorHandlers = {
{PLDM_STATE_SENSOR_PDR,
[this](SensorId sensorId, const DbusObjMaps& dbusMaps) {
- this->sendStateSensorEvent(sensorId, dbusMaps);
+ this->sendStateSensorEvent(sensorId, dbusMaps);
}}};
pldm_state_sensor_pdr* pdr = nullptr;
diff --git a/host-bmc/dbus_to_host_effecters.cpp b/host-bmc/dbus_to_host_effecters.cpp
index 32419a2..8f54ca2 100644
--- a/host-bmc/dbus_to_host_effecters.cpp
+++ b/host-bmc/dbus_to_host_effecters.cpp
@@ -71,12 +71,12 @@
EffecterInfo effecterInfo;
effecterInfo.mctpEid = entry.value("mctp_eid", 0xFF);
auto jsonEffecterInfo = entry.value("effecter_info", empty);
- auto effecterId =
- jsonEffecterInfo.value("effecterID", PLDM_INVALID_EFFECTER_ID);
+ auto effecterId = jsonEffecterInfo.value("effecterID",
+ PLDM_INVALID_EFFECTER_ID);
effecterInfo.containerId = jsonEffecterInfo.value("containerID", 0);
effecterInfo.entityType = jsonEffecterInfo.value("entityType", 0);
- effecterInfo.entityInstance =
- jsonEffecterInfo.value("entityInstance", 0);
+ effecterInfo.entityInstance = jsonEffecterInfo.value("entityInstance",
+ 0);
effecterInfo.compEffecterCnt =
jsonEffecterInfo.value("compositeEffecterCount", 0);
auto effecters = entry.value("effecters", emptyList);
@@ -86,10 +86,10 @@
auto jsonDbusInfo = effecter.value("dbus_info", empty);
dbusInfo.dbusMap.objectPath = jsonDbusInfo.value("object_path", "");
dbusInfo.dbusMap.interface = jsonDbusInfo.value("interface", "");
- dbusInfo.dbusMap.propertyName =
- jsonDbusInfo.value("property_name", "");
- dbusInfo.dbusMap.propertyType =
- jsonDbusInfo.value("property_type", "");
+ dbusInfo.dbusMap.propertyName = jsonDbusInfo.value("property_name",
+ "");
+ dbusInfo.dbusMap.propertyType = jsonDbusInfo.value("property_type",
+ "");
Json propertyValues = jsonDbusInfo["property_values"];
populatePropVals(propertyValues, dbusInfo.propertyValues,
@@ -187,8 +187,8 @@
uint8_t newState{};
try
{
- newState =
- findNewStateValue(effecterInfoIndex, dbusInfoIndex, it->second);
+ newState = findNewStateValue(effecterInfoIndex, dbusInfoIndex,
+ it->second);
}
catch (const std::out_of_range& e)
{
@@ -273,9 +273,8 @@
return rc;
}
- auto setStateEffecterStatesRespHandler = [](mctp_eid_t /*eid*/,
- const pldm_msg* response,
- size_t respMsgLen) {
+ auto setStateEffecterStatesRespHandler =
+ [](mctp_eid_t /*eid*/, const pldm_msg* response, size_t respMsgLen) {
if (response == nullptr || !respMsgLen)
{
error(
@@ -323,11 +322,11 @@
propertiesChanged(objectPath, interface),
[this, effecterInfoIndex, dbusInfoIndex,
effecterId](sdbusplus::message_t& msg) {
- DbusChgHostEffecterProps props;
- std::string iface;
- msg.read(iface, props);
- processHostEffecterChangeNotification(props, effecterInfoIndex,
- dbusInfoIndex, effecterId);
+ DbusChgHostEffecterProps props;
+ std::string iface;
+ msg.read(iface, props);
+ processHostEffecterChangeNotification(props, effecterInfoIndex,
+ dbusInfoIndex, effecterId);
}));
}
diff --git a/host-bmc/dbus_to_host_effecters.hpp b/host-bmc/dbus_to_host_effecters.hpp
index 11721bb..c5aef12 100644
--- a/host-bmc/dbus_to_host_effecters.hpp
+++ b/host-bmc/dbus_to_host_effecters.hpp
@@ -54,7 +54,7 @@
uint16_t entityInstance; //!< Entity instance for the host effecter
uint8_t compEffecterCnt; //!< Composite effecter count
std::vector<DBusEffecterMapping>
- dbusInfo; //!< D-Bus information for the effecter id
+ dbusInfo; //!< D-Bus information for the effecter id
};
/** @class HostEffecterParser
diff --git a/host-bmc/host_pdr_handler.cpp b/host-bmc/host_pdr_handler.cpp
index cedebb0..a5ecced 100644
--- a/host-bmc/host_pdr_handler.cpp
+++ b/host-bmc/host_pdr_handler.cpp
@@ -96,29 +96,29 @@
propertiesChanged("/xyz/openbmc_project/state/host0",
"xyz.openbmc_project.State.Host"),
[this, repo, entityTree, bmcEntityTree](sdbusplus::message_t& msg) {
- DbusChangedProps props{};
- std::string intf;
- msg.read(intf, props);
- const auto itr = props.find("CurrentHostState");
- if (itr != props.end())
+ DbusChangedProps props{};
+ std::string intf;
+ msg.read(intf, props);
+ const auto itr = props.find("CurrentHostState");
+ if (itr != props.end())
+ {
+ PropertyValue value = itr->second;
+ auto propVal = std::get<std::string>(value);
+ if (propVal == "xyz.openbmc_project.State.Host.HostState.Off")
{
- PropertyValue value = itr->second;
- auto propVal = std::get<std::string>(value);
- if (propVal == "xyz.openbmc_project.State.Host.HostState.Off")
- {
- // Delete all the remote terminus information
- std::erase_if(tlPDRInfo, [](const auto& item) {
- auto const& [key, value] = item;
- return key != TERMINUS_HANDLE;
- });
- pldm_pdr_remove_remote_pdrs(repo);
- pldm_entity_association_tree_destroy_root(entityTree);
- pldm_entity_association_tree_copy_root(bmcEntityTree,
- entityTree);
- this->sensorMap.clear();
- this->responseReceived = false;
- }
+ // Delete all the remote terminus information
+ std::erase_if(tlPDRInfo, [](const auto& item) {
+ auto const& [key, value] = item;
+ return key != TERMINUS_HANDLE;
+ });
+ pldm_pdr_remove_remote_pdrs(repo);
+ pldm_entity_association_tree_destroy_root(entityTree);
+ pldm_entity_association_tree_copy_root(bmcEntityTree,
+ entityTree);
+ this->sensorMap.clear();
+ this->responseReceived = false;
}
+ }
});
}
@@ -174,9 +174,9 @@
}
auto instanceId = requester.getInstanceId(mctp_eid);
- auto rc =
- encode_get_pdr_req(instanceId, recordHandle, 0, PLDM_GET_FIRSTPART,
- UINT16_MAX, 0, request, PLDM_GET_PDR_REQ_BYTES);
+ auto rc = encode_get_pdr_req(instanceId, recordHandle, 0,
+ PLDM_GET_FIRSTPART, UINT16_MAX, 0, request,
+ PLDM_GET_PDR_REQ_BYTES);
if (rc != PLDM_SUCCESS)
{
requester.markFree(mctp_eid, instanceId);
@@ -330,9 +330,8 @@
return;
}
- auto platformEventMessageResponseHandler = [](mctp_eid_t /*eid*/,
- const pldm_msg* response,
- size_t respMsgLen) {
+ auto platformEventMessageResponseHandler =
+ [](mctp_eid_t /*eid*/, const pldm_msg* response, size_t respMsgLen) {
if (response == nullptr || !respMsgLen)
{
error(
@@ -692,11 +691,9 @@
return;
}
- auto getStateSensorReadingRespHandler = [=, this](
- mctp_eid_t /*eid*/,
- const pldm_msg*
- response,
- size_t respMsgLen) {
+ auto getStateSensorReadingRespHandler =
+ [=, this](mctp_eid_t /*eid*/, const pldm_msg* response,
+ size_t respMsgLen) {
if (response == nullptr || !respMsgLen)
{
error(
@@ -774,8 +771,8 @@
error("Error invalid_data, Invalid event state");
return;
}
- const auto& [containerId, entityType, entityInstance] =
- entityInfo;
+ const auto& [containerId, entityType,
+ entityInstance] = entityInfo;
pldm::responder::events::StateSensorEntry
stateSensorEntry{containerId, entityType,
entityInstance, sensorOffset};
diff --git a/libpldmresponder/base.cpp b/libpldmresponder/base.cpp
index 4639007..dd0e94a 100644
--- a/libpldmresponder/base.cpp
+++ b/libpldmresponder/base.cpp
@@ -202,9 +202,8 @@
return;
}
- auto processSetEventReceiverResponse = [](mctp_eid_t /*eid*/,
- const pldm_msg* response,
- size_t respMsgLen) {
+ auto processSetEventReceiverResponse =
+ [](mctp_eid_t /*eid*/, const pldm_msg* response, size_t respMsgLen) {
if (response == nullptr || !respMsgLen)
{
error("Failed to receive response for setEventReceiver command");
diff --git a/libpldmresponder/base.hpp b/libpldmresponder/base.hpp
index 7652279..9a13f2d 100644
--- a/libpldmresponder/base.hpp
+++ b/libpldmresponder/base.hpp
@@ -34,20 +34,20 @@
{
handlers.emplace(PLDM_GET_PLDM_TYPES,
[this](const pldm_msg* request, size_t payloadLength) {
- return this->getPLDMTypes(request, payloadLength);
- });
- handlers.emplace(PLDM_GET_PLDM_COMMANDS, [this](const pldm_msg* request,
- size_t payloadLength) {
+ return this->getPLDMTypes(request, payloadLength);
+ });
+ handlers.emplace(PLDM_GET_PLDM_COMMANDS,
+ [this](const pldm_msg* request, size_t payloadLength) {
return this->getPLDMCommands(request, payloadLength);
});
- handlers.emplace(PLDM_GET_PLDM_VERSION, [this](const pldm_msg* request,
- size_t payloadLength) {
+ handlers.emplace(PLDM_GET_PLDM_VERSION,
+ [this](const pldm_msg* request, size_t payloadLength) {
return this->getPLDMVersion(request, payloadLength);
});
handlers.emplace(PLDM_GET_TID,
[this](const pldm_msg* request, size_t payloadLength) {
- return this->getTID(request, payloadLength);
- });
+ return this->getTID(request, payloadLength);
+ });
}
/** @brief Handler for getPLDMTypes
diff --git a/libpldmresponder/bios.cpp b/libpldmresponder/bios.cpp
index a75e9d6..e2e4e52 100644
--- a/libpldmresponder/bios.cpp
+++ b/libpldmresponder/bios.cpp
@@ -79,30 +79,29 @@
handlers.emplace(PLDM_SET_DATE_TIME,
[this](const pldm_msg* request, size_t payloadLength) {
- return this->setDateTime(request, payloadLength);
- });
+ return this->setDateTime(request, payloadLength);
+ });
handlers.emplace(PLDM_GET_DATE_TIME,
[this](const pldm_msg* request, size_t payloadLength) {
- return this->getDateTime(request, payloadLength);
- });
+ return this->getDateTime(request, payloadLength);
+ });
handlers.emplace(PLDM_GET_BIOS_TABLE,
[this](const pldm_msg* request, size_t payloadLength) {
- return this->getBIOSTable(request, payloadLength);
- });
+ return this->getBIOSTable(request, payloadLength);
+ });
handlers.emplace(PLDM_SET_BIOS_TABLE,
[this](const pldm_msg* request, size_t payloadLength) {
- return this->setBIOSTable(request, payloadLength);
- });
+ return this->setBIOSTable(request, payloadLength);
+ });
handlers.emplace(PLDM_GET_BIOS_ATTRIBUTE_CURRENT_VALUE_BY_HANDLE,
[this](const pldm_msg* request, size_t payloadLength) {
- return this->getBIOSAttributeCurrentValueByHandle(
- request, payloadLength);
- });
+ return this->getBIOSAttributeCurrentValueByHandle(request,
+ payloadLength);
+ });
handlers.emplace(PLDM_SET_BIOS_ATTRIBUTE_CURRENT_VALUE,
[this](const pldm_msg* request, size_t payloadLength) {
- return this->setBIOSAttributeCurrentValue(
- request, payloadLength);
- });
+ return this->setBIOSAttributeCurrentValue(request, payloadLength);
+ });
}
Response Handler::getDateTime(const pldm_msg* request, size_t /*payloadLength*/)
diff --git a/libpldmresponder/bios_config.cpp b/libpldmresponder/bios_config.cpp
index 92a0d04..716b0dc 100644
--- a/libpldmresponder/bios_config.cpp
+++ b/libpldmresponder/bios_config.cpp
@@ -340,8 +340,8 @@
// get default_value
for (size_t i = 0; i < defIndices.size(); i++)
{
- defaultValue =
- getValue(pvHandls[defIndices[i]], *stringTable);
+ defaultValue = getValue(pvHandls[defIndices[i]],
+ *stringTable);
}
break;
@@ -443,8 +443,8 @@
try
{
auto& bus = dbusHandler->getBus();
- auto service =
- dbusHandler->getService(biosConfigPath, biosConfigInterface);
+ auto service = dbusHandler->getService(biosConfigPath,
+ biosConfigInterface);
auto method = bus.new_method_call(service.c_str(), biosConfigPath,
dbusProperties, "Set");
std::variant<BaseBIOSTable> value = baseBIOSTableMaps;
@@ -488,9 +488,9 @@
{
auto& bus = dbusHandler->getBus();
auto service = dbusHandler->getService(biosObjPath, biosInterface);
- auto method =
- bus.new_method_call(service.c_str(), biosObjPath,
- "org.freedesktop.DBus.Properties", "Get");
+ auto method = bus.new_method_call(service.c_str(), biosObjPath,
+ "org.freedesktop.DBus.Properties",
+ "Get");
method.append(biosInterface, "BaseBIOSTable");
auto reply = bus.call(method);
std::variant<BaseBIOSTable> varBiosTable{};
@@ -665,8 +665,8 @@
auto stringTable = getBIOSTable(PLDM_BIOS_STRING_TABLE);
auto attrTable = getBIOSTable(PLDM_BIOS_ATTR_TABLE);
- auto [attrHandle, attrType] =
- table::attribute_value::decodeHeader(attrValueEntry);
+ auto [attrHandle,
+ attrType] = table::attribute_value::decodeHeader(attrValueEntry);
auto attrHeader = table::attribute::decodeHeader(attrEntry);
BIOSStringTable biosStringTable(*stringTable);
@@ -726,8 +726,8 @@
const pldm_bios_attr_table_entry* attrEntry, Table&)
{
- auto [attrHandle, attrType] =
- table::attribute_value::decodeHeader(attrValueEntry);
+ auto [attrHandle,
+ attrType] = table::attribute_value::decodeHeader(attrValueEntry);
switch (attrType)
{
@@ -736,8 +736,8 @@
{
auto value =
table::attribute_value::decodeEnumEntry(attrValueEntry);
- auto [pvHdls, defIndex] =
- table::attribute::decodeEnumEntry(attrEntry);
+ auto [pvHdls,
+ defIndex] = table::attribute::decodeEnumEntry(attrEntry);
if (!(value.size() == 1))
{
return PLDM_ERROR_INVALID_LENGTH;
@@ -755,8 +755,8 @@
{
auto value =
table::attribute_value::decodeIntegerEntry(attrValueEntry);
- auto [lower, upper, scalar, def] =
- table::attribute::decodeIntegerEntry(attrEntry);
+ auto [lower, upper, scalar,
+ def] = table::attribute::decodeIntegerEntry(attrEntry);
if (value < lower || value > upper)
{
@@ -805,8 +805,8 @@
auto attrValHeader = table::attribute_value::decodeHeader(attrValueEntry);
- auto attrEntry =
- table::attribute::findByHandle(*attrTable, attrValHeader.attrHandle);
+ auto attrEntry = table::attribute::findByHandle(*attrTable,
+ attrValHeader.attrHandle);
if (!attrEntry)
{
return PLDM_ERROR;
@@ -818,8 +818,8 @@
return rc;
}
- auto destTable =
- table::attribute_value::updateTable(*attrValueTable, entry, size);
+ auto destTable = table::attribute_value::updateTable(*attrValueTable, entry,
+ size);
if (!destTable)
{
@@ -832,9 +832,10 @@
BIOSStringTable biosStringTable(*stringTable);
auto attrName = biosStringTable.findString(attrHeader.stringHandle);
- auto iter = std::find_if(
- biosAttributes.begin(), biosAttributes.end(),
- [&attrName](const auto& attr) { return attr->name == attrName; });
+ auto iter = std::find_if(biosAttributes.begin(), biosAttributes.end(),
+ [&attrName](const auto& attr) {
+ return attr->name == attrName;
+ });
if (iter == biosAttributes.end())
{
@@ -922,8 +923,8 @@
return;
}
- auto [attrHdl, attrType, stringHdl] =
- table::attribute::decodeHeader(tableEntry);
+ auto [attrHdl, attrType,
+ stringHdl] = table::attribute::decodeHeader(tableEntry);
auto attrValueSrcTable = getBIOSTable(PLDM_BIOS_ATTR_VAL_TABLE);
@@ -993,8 +994,8 @@
auto iter = std::find_if(biosAttributes.begin(), biosAttributes.end(),
[&attributeName](const auto& attr) {
- return attr->name == attributeName;
- });
+ return attr->name == attributeName;
+ });
if (iter == biosAttributes.end())
{
@@ -1021,8 +1022,8 @@
}
const auto [attrType, readonlyStatus, displayName, description,
- menuPath, currentValue, defaultValue, option] =
- baseBIOSTableMaps.at(attributeName);
+ menuPath, currentValue, defaultValue,
+ option] = baseBIOSTableMaps.at(attributeName);
entry->attr_handle = htole16(handler);
@@ -1060,25 +1061,25 @@
pldm::utils::DBusHandler::getBus(),
propertiesChanged(objPath, objInterface),
[this](sdbusplus::message_t& msg) {
- constexpr auto propertyName = "PendingAttributes";
+ constexpr auto propertyName = "PendingAttributes";
- using Value =
- std::variant<std::string, PendingAttributes, BaseBIOSTable>;
- using Properties = std::map<DbusProp, Value>;
+ using Value =
+ std::variant<std::string, PendingAttributes, BaseBIOSTable>;
+ using Properties = std::map<DbusProp, Value>;
- Properties props{};
- std::string intf;
- msg.read(intf, props);
+ Properties props{};
+ std::string intf;
+ msg.read(intf, props);
- auto valPropMap = props.find(propertyName);
- if (valPropMap == props.end())
- {
- return;
- }
+ auto valPropMap = props.find(propertyName);
+ if (valPropMap == props.end())
+ {
+ return;
+ }
- PendingAttributes pendingAttributes =
- std::get<PendingAttributes>(valPropMap->second);
- this->constructPendingAttribute(pendingAttributes);
+ PendingAttributes pendingAttributes =
+ std::get<PendingAttributes>(valPropMap->second);
+ this->constructPendingAttribute(pendingAttributes);
});
biosAttrMatch.emplace_back(std::move(updateBIOSMatch));
diff --git a/libpldmresponder/bios_config.hpp b/libpldmresponder/bios_config.hpp
index 4e69089..2d07593 100644
--- a/libpldmresponder/bios_config.hpp
+++ b/libpldmresponder/bios_config.hpp
@@ -199,11 +199,10 @@
propertiesChanged(dBusMap->objectPath,
dBusMap->interface),
[this, biosAttrIndex](sdbusplus::message_t& msg) {
- DbusChObjProperties props;
- std::string iface;
- msg.read(iface, props);
- processBiosAttrChangeNotification(props,
- biosAttrIndex);
+ DbusChObjProperties props;
+ std::string iface;
+ msg.read(iface, props);
+ processBiosAttrChangeNotification(props, biosAttrIndex);
}));
biosAttrMatch.push_back(
@@ -212,16 +211,16 @@
interfacesAdded() + argNpath(0, dBusMap->objectPath),
[this, biosAttrIndex, interface = dBusMap->interface](
sdbusplus::message_t& msg) {
- sdbusplus::message::object_path path;
- DbusIfacesAdded interfaces;
+ sdbusplus::message::object_path path;
+ DbusIfacesAdded interfaces;
- msg.read(path, interfaces);
- auto ifaceIt = interfaces.find(interface);
- if (ifaceIt != interfaces.end())
- {
- processBiosAttrChangeNotification(
- ifaceIt->second, biosAttrIndex);
- }
+ msg.read(path, interfaces);
+ auto ifaceIt = interfaces.find(interface);
+ if (ifaceIt != interfaces.end())
+ {
+ processBiosAttrChangeNotification(ifaceIt->second,
+ biosAttrIndex);
+ }
}));
}
}
diff --git a/libpldmresponder/bios_enum_attribute.cpp b/libpldmresponder/bios_enum_attribute.cpp
index 7197553..ef03749 100644
--- a/libpldmresponder/bios_enum_attribute.cpp
+++ b/libpldmresponder/bios_enum_attribute.cpp
@@ -181,8 +181,8 @@
auto it = std::find_if(valMap.begin(), valMap.end(),
[&valueString](const auto& typePair) {
- return typePair.second == valueString;
- });
+ return typePair.second == valueString;
+ });
if (it == valMap.end())
{
return;
@@ -195,8 +195,8 @@
const BIOSStringTable& stringTable, Table& attrTable, Table& attrValueTable,
std::optional<std::variant<int64_t, std::string>> optAttributeValue)
{
- auto possibleValuesHandle =
- getPossibleValuesHandle(stringTable, possibleValues);
+ auto possibleValuesHandle = getPossibleValuesHandle(stringTable,
+ possibleValues);
std::vector<uint8_t> defaultIndices(1, 0);
defaultIndices[0] = getValueIndex(defaultValue, possibleValues);
@@ -206,10 +206,10 @@
(uint8_t)defaultIndices.size(), defaultIndices.data(),
};
- auto attrTableEntry =
- table::attribute::constructEnumEntry(attrTable, &info);
- auto [attrHandle, attrType, _] =
- table::attribute::decodeHeader(attrTableEntry);
+ auto attrTableEntry = table::attribute::constructEnumEntry(attrTable,
+ &info);
+ auto [attrHandle, attrType,
+ _] = table::attribute::decodeHeader(attrTableEntry);
std::vector<uint8_t> currValueIndices(1, 0);
diff --git a/libpldmresponder/bios_integer_attribute.cpp b/libpldmresponder/bios_integer_attribute.cpp
index bf5c7a6..6611389 100644
--- a/libpldmresponder/bios_integer_attribute.cpp
+++ b/libpldmresponder/bios_integer_attribute.cpp
@@ -112,11 +112,11 @@
integerInfo.scalarIncrement, integerInfo.defaultValue,
};
- auto attrTableEntry =
- table::attribute::constructIntegerEntry(attrTable, &info);
+ auto attrTableEntry = table::attribute::constructIntegerEntry(attrTable,
+ &info);
- auto [attrHandle, attrType, _] =
- table::attribute::decodeHeader(attrTableEntry);
+ auto [attrHandle, attrType,
+ _] = table::attribute::decodeHeader(attrTableEntry);
int64_t currentValue{};
if (optAttributeValue.has_value())
diff --git a/libpldmresponder/bios_string_attribute.cpp b/libpldmresponder/bios_string_attribute.cpp
index 273cf48..d37da46 100644
--- a/libpldmresponder/bios_string_attribute.cpp
+++ b/libpldmresponder/bios_string_attribute.cpp
@@ -106,10 +106,10 @@
stringInfo.defString.data(),
};
- auto attrTableEntry =
- table::attribute::constructStringEntry(attrTable, &info);
- auto [attrHandle, attrType, _] =
- table::attribute::decodeHeader(attrTableEntry);
+ auto attrTableEntry = table::attribute::constructStringEntry(attrTable,
+ &info);
+ auto [attrHandle, attrType,
+ _] = table::attribute::decodeHeader(attrTableEntry);
std::string currStr{};
if (optAttributeValue.has_value())
diff --git a/libpldmresponder/bios_table.cpp b/libpldmresponder/bios_table.cpp
index f933c49..5cfd372 100644
--- a/libpldmresponder/bios_table.cpp
+++ b/libpldmresponder/bios_table.cpp
@@ -12,8 +12,7 @@
{
namespace bios
{
-BIOSTable::BIOSTable(const char* filePath) : filePath(filePath)
-{}
+BIOSTable::BIOSTable(const char* filePath) : filePath(filePath) {}
bool BIOSTable::isEmpty() const noexcept
{
diff --git a/libpldmresponder/event_parser.hpp b/libpldmresponder/event_parser.hpp
index 57d0ae1..4d95e3a 100644
--- a/libpldmresponder/event_parser.hpp
+++ b/libpldmresponder/event_parser.hpp
@@ -118,4 +118,4 @@
std::string_view type);
};
-} // namespace pldm::responder::events
\ No newline at end of file
+} // namespace pldm::responder::events
diff --git a/libpldmresponder/fru.cpp b/libpldmresponder/fru.cpp
index 9b0389b..7ccc4a9 100644
--- a/libpldmresponder/fru.cpp
+++ b/libpldmresponder/fru.cpp
@@ -138,9 +138,9 @@
std::string currentBmcVersion;
try
{
- auto method =
- bus.new_method_call(pldm::utils::mapperService, fwFunctionalObjPath,
- pldm::utils::dbusProperties, "Get");
+ auto method = bus.new_method_call(pldm::utils::mapperService,
+ fwFunctionalObjPath,
+ pldm::utils::dbusProperties, "Get");
method.append("xyz.openbmc_project.Association", "endpoints");
std::variant<std::vector<std::string>> paths;
auto reply = bus.call(method);
@@ -169,11 +169,11 @@
auto numRecsCount = numRecs;
static uint32_t bmc_record_handle = 0;
- for (auto const& [recType, encType, fieldInfos] : recordInfos)
+ for (const auto& [recType, encType, fieldInfos] : recordInfos)
{
std::vector<uint8_t> tlvs;
uint8_t numFRUFields = 0;
- for (auto const& [intf, prop, propType, fieldTypeNum] : fieldInfos)
+ for (const auto& [intf, prop, propType, fieldTypeNum] : fieldInfos)
{
try
{
@@ -340,9 +340,9 @@
sizeof(pldm_msg_hdr) + PLDM_GET_FRU_RECORD_TABLE_MIN_RESP_BYTES, 0);
auto responsePtr = reinterpret_cast<pldm_msg*>(response.data());
- auto rc =
- encode_get_fru_record_table_resp(request->hdr.instance_id, PLDM_SUCCESS,
- 0, PLDM_START_AND_END, responsePtr);
+ auto rc = encode_get_fru_record_table_resp(request->hdr.instance_id,
+ PLDM_SUCCESS, 0,
+ PLDM_START_AND_END, responsePtr);
if (rc != PLDM_SUCCESS)
{
return ccOnlyResponse(request, rc);
@@ -387,8 +387,8 @@
return ccOnlyResponse(request, rc);
}
- auto respPayloadLength =
- PLDM_GET_FRU_RECORD_BY_OPTION_MIN_RESP_BYTES + fruData.size();
+ auto respPayloadLength = PLDM_GET_FRU_RECORD_BY_OPTION_MIN_RESP_BYTES +
+ fruData.size();
Response response(sizeof(pldm_msg_hdr) + respPayloadLength, 0);
auto responsePtr = reinterpret_cast<pldm_msg*>(response.data());
diff --git a/libpldmresponder/fru.hpp b/libpldmresponder/fru.hpp
index 2f867fe..0f0ae93 100644
--- a/libpldmresponder/fru.hpp
+++ b/libpldmresponder/fru.hpp
@@ -206,20 +206,17 @@
{
handlers.emplace(PLDM_GET_FRU_RECORD_TABLE_METADATA,
[this](const pldm_msg* request, size_t payloadLength) {
- return this->getFRURecordTableMetadata(
- request, payloadLength);
- });
+ return this->getFRURecordTableMetadata(request, payloadLength);
+ });
handlers.emplace(PLDM_GET_FRU_RECORD_TABLE,
[this](const pldm_msg* request, size_t payloadLength) {
- return this->getFRURecordTable(request,
- payloadLength);
- });
+ return this->getFRURecordTable(request, payloadLength);
+ });
handlers.emplace(PLDM_GET_FRU_RECORD_BY_OPTION,
[this](const pldm_msg* request, size_t payloadLength) {
- return this->getFRURecordByOption(request,
- payloadLength);
- });
+ return this->getFRURecordByOption(request, payloadLength);
+ });
}
/** @brief Handler for Get FRURecordTableMetadata
diff --git a/libpldmresponder/fru_parser.cpp b/libpldmresponder/fru_parser.cpp
index 13f740e..b9d09bc 100644
--- a/libpldmresponder/fru_parser.cpp
+++ b/libpldmresponder/fru_parser.cpp
@@ -149,8 +149,8 @@
}
FruRecordInfo fruInfo;
- fruInfo =
- std::make_tuple(recordType, encType, std::move(fieldInfo));
+ fruInfo = std::make_tuple(recordType, encType,
+ std::move(fieldInfo));
auto search = recordMap.find(dbusIntfName);
diff --git a/libpldmresponder/oem_handler.hpp b/libpldmresponder/oem_handler.hpp
index 7d3a87e..3e3742d 100644
--- a/libpldmresponder/oem_handler.hpp
+++ b/libpldmresponder/oem_handler.hpp
@@ -13,8 +13,7 @@
class Handler : public CmdHandler
{
public:
- Handler(const pldm::utils::DBusHandler* dBusIntf) : dBusIntf(dBusIntf)
- {}
+ Handler(const pldm::utils::DBusHandler* dBusIntf) : dBusIntf(dBusIntf) {}
/** @brief Interface to get the state sensor readings requested by pldm
* requester for OEM types. Each specific type should implement a handler
diff --git a/libpldmresponder/pdr.cpp b/libpldmresponder/pdr.cpp
index 44a07e6..aa05303 100644
--- a/libpldmresponder/pdr.cpp
+++ b/libpldmresponder/pdr.cpp
@@ -38,9 +38,9 @@
PdrEntry& pdrEntry)
{
uint8_t* pdrData = nullptr;
- auto record =
- pldm_pdr_find_record(pdrRepo.getPdr(), recordHandle, &pdrData,
- &pdrEntry.size, &pdrEntry.handle.nextRecordHandle);
+ auto record = pldm_pdr_find_record(pdrRepo.getPdr(), recordHandle, &pdrData,
+ &pdrEntry.size,
+ &pdrEntry.handle.nextRecordHandle);
if (record)
{
pdrEntry.data = pdrData;
diff --git a/libpldmresponder/pdr_numeric_effecter.hpp b/libpldmresponder/pdr_numeric_effecter.hpp
index d342636..0347af4 100644
--- a/libpldmresponder/pdr_numeric_effecter.hpp
+++ b/libpldmresponder/pdr_numeric_effecter.hpp
@@ -48,8 +48,8 @@
pdr->hdr.version = 1;
pdr->hdr.type = PLDM_NUMERIC_EFFECTER_PDR;
pdr->hdr.record_change_num = 0;
- pdr->hdr.length =
- sizeof(pldm_numeric_effecter_value_pdr) - sizeof(pldm_pdr_hdr);
+ pdr->hdr.length = sizeof(pldm_numeric_effecter_value_pdr) -
+ sizeof(pldm_pdr_hdr);
pdr->terminus_handle = e.value("terminus_handle", 0);
pdr->effecter_id = handler.getNextEffecterId();
@@ -103,15 +103,15 @@
pdr->aux_oem_unit_handle = e.value("aux_oem_unit_handle", 0);
pdr->aux_rate_unit = e.value("aux_rate_unit", 0);
pdr->is_linear = e.value("is_linear", true);
- pdr->effecter_data_size =
- e.value("effecter_data_size", PLDM_EFFECTER_DATA_SIZE_UINT8);
+ pdr->effecter_data_size = e.value("effecter_data_size",
+ PLDM_EFFECTER_DATA_SIZE_UINT8);
pdr->resolution = e.value("effecter_resolution_init", 1.00);
pdr->offset = e.value("offset", 0.00);
pdr->accuracy = e.value("accuracy", 0);
pdr->plus_tolerance = e.value("plus_tolerance", 0);
pdr->minus_tolerance = e.value("minus_tolerance", 0);
- pdr->state_transition_interval =
- e.value("state_transition_interval", 0.00);
+ pdr->state_transition_interval = e.value("state_transition_interval",
+ 0.00);
pdr->transition_interval = e.value("transition_interval", 0.00);
switch (pdr->effecter_data_size)
{
@@ -143,8 +143,8 @@
break;
}
- pdr->range_field_format =
- e.value("range_field_format", PLDM_RANGE_FIELD_FORMAT_UINT8);
+ pdr->range_field_format = e.value("range_field_format",
+ PLDM_RANGE_FIELD_FORMAT_UINT8);
pdr->range_field_support.byte = e.value("range_field_support", 0);
switch (pdr->range_field_format)
{
@@ -212,8 +212,8 @@
pldm::utils::DBusMapping dbusMapping{};
try
{
- auto service =
- dBusIntf.getService(objectPath.c_str(), interface.c_str());
+ auto service = dBusIntf.getService(objectPath.c_str(),
+ interface.c_str());
dbusMapping = pldm::utils::DBusMapping{objectPath, interface,
propertyName, propertyType};
diff --git a/libpldmresponder/pdr_state_effecter.hpp b/libpldmresponder/pdr_state_effecter.hpp
index db76086..94a8932 100644
--- a/libpldmresponder/pdr_state_effecter.hpp
+++ b/libpldmresponder/pdr_state_effecter.hpp
@@ -117,8 +117,8 @@
pldm::responder::pdr_utils::DbusMappings dbusMappings{};
pldm::responder::pdr_utils::DbusValMaps dbusValMaps{};
- uint8_t* start =
- entry.data() + sizeof(pldm_state_effecter_pdr) - sizeof(uint8_t);
+ uint8_t* start = entry.data() + sizeof(pldm_state_effecter_pdr) -
+ sizeof(uint8_t);
for (const auto& effecter : effecters)
{
auto set = effecter.value("set", empty);
@@ -152,8 +152,8 @@
pldm::utils::DBusMapping dbusMapping{};
try
{
- auto service =
- dBusIntf.getService(objectPath.c_str(), interface.c_str());
+ auto service = dBusIntf.getService(objectPath.c_str(),
+ interface.c_str());
dbusMapping = pldm::utils::DBusMapping{
objectPath, interface, propertyName, propertyType};
diff --git a/libpldmresponder/pdr_state_sensor.hpp b/libpldmresponder/pdr_state_sensor.hpp
index 838f6e7..bda3964 100644
--- a/libpldmresponder/pdr_state_sensor.hpp
+++ b/libpldmresponder/pdr_state_sensor.hpp
@@ -128,8 +128,8 @@
pldm::responder::pdr_utils::DbusMappings dbusMappings{};
pldm::responder::pdr_utils::DbusValMaps dbusValMaps{};
- uint8_t* start =
- entry.data() + sizeof(pldm_state_sensor_pdr) - sizeof(uint8_t);
+ uint8_t* start = entry.data() + sizeof(pldm_state_sensor_pdr) -
+ sizeof(uint8_t);
for (const auto& sensor : sensors)
{
auto set = sensor.value("set", empty);
@@ -163,8 +163,8 @@
pldm::utils::DBusMapping dbusMapping{};
try
{
- auto service =
- dBusIntf.getService(objectPath.c_str(), interface.c_str());
+ auto service = dBusIntf.getService(objectPath.c_str(),
+ interface.c_str());
dbusMapping = pldm::utils::DBusMapping{
objectPath, interface, propertyName, propertyType};
diff --git a/libpldmresponder/pdr_utils.cpp b/libpldmresponder/pdr_utils.cpp
index 89bcba8..2e65316 100644
--- a/libpldmresponder/pdr_utils.cpp
+++ b/libpldmresponder/pdr_utils.cpp
@@ -32,9 +32,9 @@
{
constexpr uint32_t firstNum = 0;
uint8_t* pdrData = nullptr;
- auto record =
- pldm_pdr_find_record(getPdr(), firstNum, &pdrData, &pdrEntry.size,
- &pdrEntry.handle.nextRecordHandle);
+ auto record = pldm_pdr_find_record(getPdr(), firstNum, &pdrData,
+ &pdrEntry.size,
+ &pdrEntry.handle.nextRecordHandle);
if (record)
{
pdrEntry.data = pdrData;
@@ -47,9 +47,9 @@
PdrEntry& pdrEntry)
{
uint8_t* pdrData = nullptr;
- auto record =
- pldm_pdr_get_next_record(getPdr(), currRecord, &pdrData, &pdrEntry.size,
- &pdrEntry.handle.nextRecordHandle);
+ auto record = pldm_pdr_get_next_record(getPdr(), currRecord, &pdrData,
+ &pdrEntry.size,
+ &pdrEntry.handle.nextRecordHandle);
if (record)
{
pdrEntry.data = pdrData;
@@ -157,8 +157,8 @@
reinterpret_cast<const state_sensor_possible_states*>(statesPtr);
PossibleStates possibleStates{};
uint8_t possibleStatesPos{};
- auto updateStates = [&possibleStates,
- &possibleStatesPos](const bitfield8_t& val) {
+ auto updateStates =
+ [&possibleStates, &possibleStatesPos](const bitfield8_t& val) {
for (int i = 0; i < CHAR_BIT; i++)
{
if (val.byte & (1 << i))
@@ -184,8 +184,8 @@
std::make_tuple(static_cast<ContainerID>(pdr->container_id),
static_cast<EntityType>(pdr->entity_type),
static_cast<EntityInstance>(pdr->entity_instance));
- auto sensorInfo =
- std::make_tuple(std::move(entityInfo), std::move(sensors));
+ auto sensorInfo = std::make_tuple(std::move(entityInfo),
+ std::move(sensors));
return std::make_tuple(pdr->terminus_handle, pdr->sensor_id,
std::move(sensorInfo));
}
diff --git a/libpldmresponder/pdr_utils.hpp b/libpldmresponder/pdr_utils.hpp
index 6c1264a..739058e 100644
--- a/libpldmresponder/pdr_utils.hpp
+++ b/libpldmresponder/pdr_utils.hpp
@@ -110,8 +110,7 @@
class RepoInterface
{
public:
- RepoInterface(pldm_pdr* repo) : repo(repo)
- {}
+ RepoInterface(pldm_pdr* repo) : repo(repo) {}
virtual ~RepoInterface() = default;
@@ -185,8 +184,7 @@
class Repo : public RepoInterface
{
public:
- Repo(pldm_pdr* repo) : RepoInterface(repo)
- {}
+ Repo(pldm_pdr* repo) : RepoInterface(repo) {}
pldm_pdr* getPdr() const override;
diff --git a/libpldmresponder/platform.cpp b/libpldmresponder/platform.cpp
index 38dc9df..679f3b5 100644
--- a/libpldmresponder/platform.cpp
+++ b/libpldmresponder/platform.cpp
@@ -76,21 +76,20 @@
// generate the PDR structures. This function iterates through the map to
// invoke all lambdas, so that all PDR types can be created.
- const std::map<Type, generatePDR> generateHandlers = {
- {PLDM_STATE_EFFECTER_PDR,
- [this](const DBusHandler& dBusIntf, const auto& json,
- RepoInterface& repo) {
- pdr_state_effecter::generateStateEffecterPDR<
- pldm::utils::DBusHandler, Handler>(dBusIntf, json, *this,
- repo);
- }},
- {PLDM_NUMERIC_EFFECTER_PDR,
- [this](const DBusHandler& dBusIntf, const auto& json,
- RepoInterface& repo) {
- pdr_numeric_effecter::generateNumericEffecterPDR<
- pldm::utils::DBusHandler, Handler>(dBusIntf, json, *this,
- repo);
- }},
+ const std::map<Type, generatePDR>
+ generateHandlers = {{PLDM_STATE_EFFECTER_PDR,
+ [this](const DBusHandler& dBusIntf,
+ const auto& json, RepoInterface& repo) {
+ pdr_state_effecter::generateStateEffecterPDR<pldm::utils::DBusHandler,
+ Handler>(dBusIntf, json,
+ *this, repo);
+ }},
+ {PLDM_NUMERIC_EFFECTER_PDR,
+ [this](const DBusHandler& dBusIntf,
+ const auto& json, RepoInterface& repo) {
+ pdr_numeric_effecter::generateNumericEffecterPDR<
+ pldm::utils::DBusHandler, Handler>(dBusIntf, json, *this, repo);
+ }},
{PLDM_STATE_SENSOR_PDR, [this](const DBusHandler& dBusIntf,
const auto& json, RepoInterface& repo) {
pdr_state_sensor::generateStateSensorPDR<pldm::utils::DBusHandler,
@@ -346,8 +345,8 @@
const auto& handlers = eventHandlers.at(eventClass);
for (const auto& handler : handlers)
{
- auto rc =
- handler(request, payloadLength, formatVersion, tid, offset);
+ auto rc = handler(request, payloadLength, formatVersion, tid,
+ offset);
if (rc != PLDM_SUCCESS)
{
return CmdHandler::ccOnlyResponse(request, rc);
@@ -380,8 +379,8 @@
uint16_t sensorId{};
uint8_t eventClass{};
size_t eventClassDataOffset{};
- auto eventData =
- reinterpret_cast<const uint8_t*>(request->payload) + eventDataOffset;
+ auto eventData = reinterpret_cast<const uint8_t*>(request->payload) +
+ eventDataOffset;
auto eventDataSize = payloadLength - eventDataOffset;
auto rc = decode_sensor_event_data(eventData, eventDataSize, &sensorId,
@@ -393,8 +392,8 @@
auto eventClassData = reinterpret_cast<const uint8_t*>(request->payload) +
eventDataOffset + eventClassDataOffset;
- auto eventClassDataSize =
- payloadLength - eventDataOffset - eventClassDataOffset;
+ auto eventClassDataSize = payloadLength - eventDataOffset -
+ eventClassDataOffset;
if (eventClass == PLDM_STATE_SENSOR_STATE)
{
@@ -483,8 +482,8 @@
uint8_t numberOfChangeRecords{};
size_t dataOffset{};
- auto eventData =
- reinterpret_cast<const uint8_t*>(request->payload) + eventDataOffset;
+ auto eventData = reinterpret_cast<const uint8_t*>(request->payload) +
+ eventDataOffset;
auto eventDataSize = payloadLength - eventDataOffset;
auto rc = decode_pldm_pdr_repository_chg_event_data(
@@ -542,8 +541,8 @@
}
}
- changeRecordData +=
- dataOffset + (numberOfChangeEntries * sizeof(ChangeEntry));
+ changeRecordData += dataOffset +
+ (numberOfChangeEntries * sizeof(ChangeEntry));
changeRecordDataSize -=
dataOffset + (numberOfChangeEntries * sizeof(ChangeEntry));
}
diff --git a/libpldmresponder/platform.hpp b/libpldmresponder/platform.hpp
index 74153ac..19f2a78 100644
--- a/libpldmresponder/platform.hpp
+++ b/libpldmresponder/platform.hpp
@@ -73,43 +73,38 @@
handlers.emplace(PLDM_GET_PDR,
[this](const pldm_msg* request, size_t payloadLength) {
- return this->getPDR(request, payloadLength);
- });
+ return this->getPDR(request, payloadLength);
+ });
handlers.emplace(PLDM_SET_NUMERIC_EFFECTER_VALUE,
[this](const pldm_msg* request, size_t payloadLength) {
- return this->setNumericEffecterValue(
- request, payloadLength);
- });
+ return this->setNumericEffecterValue(request, payloadLength);
+ });
handlers.emplace(PLDM_SET_STATE_EFFECTER_STATES,
[this](const pldm_msg* request, size_t payloadLength) {
- return this->setStateEffecterStates(request,
- payloadLength);
- });
+ return this->setStateEffecterStates(request, payloadLength);
+ });
handlers.emplace(PLDM_PLATFORM_EVENT_MESSAGE,
[this](const pldm_msg* request, size_t payloadLength) {
- return this->platformEventMessage(request,
- payloadLength);
- });
+ return this->platformEventMessage(request, payloadLength);
+ });
handlers.emplace(PLDM_GET_STATE_SENSOR_READINGS,
[this](const pldm_msg* request, size_t payloadLength) {
- return this->getStateSensorReadings(request,
- payloadLength);
- });
+ return this->getStateSensorReadings(request, payloadLength);
+ });
// Default handler for PLDM Events
eventHandlers[PLDM_SENSOR_EVENT].emplace_back(
[this](const pldm_msg* request, size_t payloadLength,
uint8_t formatVersion, uint8_t tid, size_t eventDataOffset) {
- return this->sensorEvent(request, payloadLength, formatVersion,
- tid, eventDataOffset);
- });
+ return this->sensorEvent(request, payloadLength, formatVersion, tid,
+ eventDataOffset);
+ });
eventHandlers[PLDM_PDR_REPOSITORY_CHG_EVENT].emplace_back(
[this](const pldm_msg* request, size_t payloadLength,
uint8_t formatVersion, uint8_t tid, size_t eventDataOffset) {
- return this->pldmPDRRepositoryChgEvent(request, payloadLength,
- formatVersion, tid,
- eventDataOffset);
- });
+ return this->pldmPDRRepositoryChgEvent(
+ request, payloadLength, formatVersion, tid, eventDataOffset);
+ });
// Additional OEM event handlers for PLDM events, append it to the
// standard handlers
@@ -328,8 +323,8 @@
if (pdr->effecter_id != effecterId)
{
pdr = nullptr;
- pdrRecord =
- stateEffecterPDRs.getNextRecord(pdrRecord, pdrEntry);
+ pdrRecord = stateEffecterPDRs.getNextRecord(pdrRecord,
+ pdrEntry);
continue;
}
@@ -354,17 +349,17 @@
int rc = PLDM_SUCCESS;
try
{
- const auto& [dbusMappings, dbusValMaps] =
- effecterDbusObjMaps.at(effecterId);
+ const auto& [dbusMappings,
+ dbusValMaps] = effecterDbusObjMaps.at(effecterId);
for (uint8_t currState = 0; currState < compEffecterCnt;
++currState)
{
std::vector<StateSetNum> allowed{};
// computation is based on table 79 from DSP0248 v1.1.1
- uint8_t bitfieldIndex =
- stateField[currState].effecter_state / 8;
- uint8_t bit =
- stateField[currState].effecter_state - (8 * bitfieldIndex);
+ uint8_t bitfieldIndex = stateField[currState].effecter_state /
+ 8;
+ uint8_t bit = stateField[currState].effecter_state -
+ (8 * bitfieldIndex);
if (states->possible_states_size < bitfieldIndex ||
!(states->states[bitfieldIndex].byte & (1 << bit)))
{
diff --git a/libpldmresponder/platform_numeric_effecter.hpp b/libpldmresponder/platform_numeric_effecter.hpp
index b01d6b0..5e74c1c 100644
--- a/libpldmresponder/platform_numeric_effecter.hpp
+++ b/libpldmresponder/platform_numeric_effecter.hpp
@@ -298,8 +298,8 @@
try
{
- const auto& [dbusMappings, dbusValMaps] =
- handler.getDbusObjMaps(effecterId);
+ const auto& [dbusMappings,
+ dbusValMaps] = handler.getDbusObjMaps(effecterId);
pldm::utils::DBusMapping dbusMapping{
dbusMappings[0].objectPath, dbusMappings[0].interface,
dbusMappings[0].propertyName, dbusMappings[0].propertyType};
diff --git a/libpldmresponder/platform_state_effecter.hpp b/libpldmresponder/platform_state_effecter.hpp
index 3586d60..b44d446 100644
--- a/libpldmresponder/platform_state_effecter.hpp
+++ b/libpldmresponder/platform_state_effecter.hpp
@@ -93,15 +93,15 @@
int rc = PLDM_SUCCESS;
try
{
- const auto& [dbusMappings, dbusValMaps] =
- handler.getDbusObjMaps(effecterId);
+ const auto& [dbusMappings,
+ dbusValMaps] = handler.getDbusObjMaps(effecterId);
for (uint8_t currState = 0; currState < compEffecterCnt; ++currState)
{
std::vector<StateSetNum> allowed{};
// computation is based on table 79 from DSP0248 v1.1.1
uint8_t bitfieldIndex = stateField[currState].effecter_state / 8;
- uint8_t bit =
- stateField[currState].effecter_state - (8 * bitfieldIndex);
+ uint8_t bit = stateField[currState].effecter_state -
+ (8 * bitfieldIndex);
if (states->possible_states_size < bitfieldIndex ||
!(states->states[bitfieldIndex].byte & (1 << bit)))
{
diff --git a/libpldmresponder/test/libpldmresponder_base_test.cpp b/libpldmresponder/test/libpldmresponder_base_test.cpp
index 16c06dc..60edae3 100644
--- a/libpldmresponder/test/libpldmresponder_base_test.cpp
+++ b/libpldmresponder/test/libpldmresponder_base_test.cpp
@@ -85,8 +85,8 @@
uint8_t retFlag = PLDM_START_AND_END;
ver32_t version = {0x00, 0xF0, 0xF0, 0xF1};
- auto rc =
- encode_get_version_req(0, transferHandle, flag, pldmType, request);
+ auto rc = encode_get_version_req(0, transferHandle, flag, pldmType,
+ request);
ASSERT_EQ(0, rc);
@@ -116,8 +116,8 @@
uint32_t transferHandle = 0x0;
uint8_t flag = PLDM_GET_FIRSTPART;
- auto rc =
- encode_get_version_req(0, transferHandle, flag, pldmType, request);
+ auto rc = encode_get_version_req(0, transferHandle, flag, pldmType,
+ request);
ASSERT_EQ(0, rc);
diff --git a/libpldmresponder/test/libpldmresponder_bios_config_test.cpp b/libpldmresponder/test/libpldmresponder_bios_config_test.cpp
index 4d4b843..4990f5a 100644
--- a/libpldmresponder/test/libpldmresponder_bios_config_test.cpp
+++ b/libpldmresponder/test/libpldmresponder_bios_config_test.cpp
@@ -171,8 +171,8 @@
case PLDM_BIOS_ENUMERATION:
case PLDM_BIOS_ENUMERATION_READ_ONLY:
{
- auto [pvHdls, defInds] =
- table::attribute::decodeEnumEntry(entry);
+ auto [pvHdls,
+ defInds] = table::attribute::decodeEnumEntry(entry);
auto possibleValues = jsonEntry->at("possible_values")
.get<std::vector<std::string>>();
std::vector<std::string> strings;
@@ -201,8 +201,8 @@
attrValueTable->data(), attrValueTable->size()))
{
auto header = table::attribute_value::decodeHeader(entry);
- auto attrEntry =
- table::attribute::findByHandle(*attrTable, header.attrHandle);
+ auto attrEntry = table::attribute::findByHandle(*attrTable,
+ header.attrHandle);
auto attrHeader = table::attribute::decodeHeader(attrEntry);
auto attrName = biosStringTable.findString(attrHeader.stringHandle);
auto jsonEntry = findJsonEntry(attrName);
diff --git a/libpldmresponder/test/libpldmresponder_bios_test.cpp b/libpldmresponder/test/libpldmresponder_bios_test.cpp
index a8d31b2..2b9e49a 100644
--- a/libpldmresponder/test/libpldmresponder_bios_test.cpp
+++ b/libpldmresponder/test/libpldmresponder_bios_test.cpp
@@ -62,4 +62,4 @@
timeSec = timeToEpoch(sec, min, hours, day, month, year);
EXPECT_EQ(ret, timeSec);
-}
\ No newline at end of file
+}
diff --git a/libpldmresponder/test/libpldmresponder_pdr_effecter_test.cpp b/libpldmresponder/test/libpldmresponder_pdr_effecter_test.cpp
index 39f3739..0c2b02a 100644
--- a/libpldmresponder/test/libpldmresponder_pdr_effecter_test.cpp
+++ b/libpldmresponder/test/libpldmresponder_pdr_effecter_test.cpp
@@ -68,8 +68,8 @@
bf1.byte = 2;
ASSERT_EQ(states->states[0].byte, bf1.byte);
- const auto& [dbusMappings1, dbusValMaps1] =
- handler.getDbusObjMaps(pdr->effecter_id);
+ const auto& [dbusMappings1,
+ dbusValMaps1] = handler.getDbusObjMaps(pdr->effecter_id);
ASSERT_EQ(dbusMappings1[0].objectPath, "/foo/bar");
// Check second PDR
@@ -108,8 +108,8 @@
ASSERT_EQ(states->states[0].byte, bf2[0].byte);
ASSERT_EQ(states->states[1].byte, bf2[1].byte);
- const auto& [dbusMappings2, dbusValMaps2] =
- handler.getDbusObjMaps(pdr->effecter_id);
+ const auto& [dbusMappings2,
+ dbusValMaps2] = handler.getDbusObjMaps(pdr->effecter_id);
ASSERT_EQ(dbusMappings2[0].objectPath, "/foo/bar");
ASSERT_EQ(dbusMappings2[1].objectPath, "/foo/bar");
@@ -155,8 +155,8 @@
EXPECT_EQ(pdr->effecter_id, 3);
EXPECT_EQ(pdr->effecter_data_size, 4);
- const auto& [dbusMappings, dbusValMaps] =
- handler.getDbusObjMaps(pdr->effecter_id);
+ const auto& [dbusMappings,
+ dbusValMaps] = handler.getDbusObjMaps(pdr->effecter_id);
EXPECT_EQ(dbusMappings[0].objectPath, "/foo/bar");
EXPECT_EQ(dbusMappings[0].interface, "xyz.openbmc_project.Foo.Bar");
EXPECT_EQ(dbusMappings[0].propertyName, "propertyName");
diff --git a/libpldmresponder/test/libpldmresponder_platform_test.cpp b/libpldmresponder/test/libpldmresponder_platform_test.cpp
index 10082a6..0c9b324 100644
--- a/libpldmresponder/test/libpldmresponder_platform_test.cpp
+++ b/libpldmresponder/test/libpldmresponder_platform_test.cpp
@@ -407,10 +407,10 @@
0x43, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
0x00, 0x01, 0x0b, 0x00, 0x01, 0x18};
- const auto& [terminusHandle1, sensorID1, sensorInfo1] =
- parseStateSensorPDR(sample1PDR);
- const auto& [containerID1, entityType1, entityInstance1] =
- std::get<0>(sensorInfo1);
+ const auto& [terminusHandle1, sensorID1,
+ sensorInfo1] = parseStateSensorPDR(sample1PDR);
+ const auto& [containerID1, entityType1,
+ entityInstance1] = std::get<0>(sensorInfo1);
const auto& states1 = std::get<1>(sensorInfo1);
CompositeSensorStates statesCmp1{{3u, 4u}};
@@ -428,10 +428,10 @@
0x1F, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
0x00, 0x01, 0x02, 0x00, 0x02, 0x18, 0x2E};
- const auto& [terminusHandle2, sensorID2, sensorInfo2] =
- parseStateSensorPDR(sample2PDR);
- const auto& [containerID2, entityType2, entityInstance2] =
- std::get<0>(sensorInfo2);
+ const auto& [terminusHandle2, sensorID2,
+ sensorInfo2] = parseStateSensorPDR(sample2PDR);
+ const auto& [containerID2, entityType2,
+ entityInstance2] = std::get<0>(sensorInfo2);
const auto& states2 = std::get<1>(sensorInfo2);
CompositeSensorStates statesCmp2{{3u, 4u, 9u, 10u, 11u, 13u}};
@@ -451,10 +451,10 @@
0x00, 0x03, 0x00, 0x21, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00,
0x02, 0x21, 0x00, 0x01, 0x06, 0x0F, 0x00, 0x01, 0x1E};
- const auto& [terminusHandle3, sensorID3, sensorInfo3] =
- parseStateSensorPDR(sample3PDR);
- const auto& [containerID3, entityType3, entityInstance3] =
- std::get<0>(sensorInfo3);
+ const auto& [terminusHandle3, sensorID3,
+ sensorInfo3] = parseStateSensorPDR(sample3PDR);
+ const auto& [containerID3, entityType3,
+ entityInstance3] = std::get<0>(sensorInfo3);
const auto& states3 = std::get<1>(sensorInfo3);
CompositeSensorStates statesCmp3{{1u, 2u}, {1u, 2u, 3u, 4u}};
diff --git a/libpldmresponder/test/mocked_bios.hpp b/libpldmresponder/test/mocked_bios.hpp
index c93d788..8a01cb3 100644
--- a/libpldmresponder/test/mocked_bios.hpp
+++ b/libpldmresponder/test/mocked_bios.hpp
@@ -8,8 +8,7 @@
class MockBIOSStringTable : public pldm::responder::bios::BIOSStringTable
{
public:
- MockBIOSStringTable() : BIOSStringTable({})
- {}
+ MockBIOSStringTable() : BIOSStringTable({}) {}
MOCK_METHOD(uint16_t, findHandle, (const std::string&), (const override));
@@ -58,4 +57,4 @@
checkHeader(attrEntry, attrValueEntry);
checkEntry(attrEntry, expectedAttrEntry);
checkEntry(attrValueEntry, expectedAttrValueEntry);
-}
\ No newline at end of file
+}
diff --git a/oem/ibm/libpldmresponder/file_io.cpp b/oem/ibm/libpldmresponder/file_io.cpp
index 96a1c71..7abd620 100644
--- a/oem/ibm/libpldmresponder/file_io.cpp
+++ b/oem/ibm/libpldmresponder/file_io.cpp
@@ -80,8 +80,8 @@
pldm::utils::CustomFD xdmaFd(dmaFd);
void* vgaMem;
- vgaMem =
- mmap(nullptr, pageAlignedLength, PROT_READ, MAP_SHARED, xdmaFd(), 0);
+ vgaMem = mmap(nullptr, pageAlignedLength, PROT_READ, MAP_SHARED, xdmaFd(),
+ 0);
if (MAP_FAILED == vgaMem)
{
rc = -errno;
@@ -614,8 +614,8 @@
return response;
}
- auto fileDataPos =
- reinterpret_cast<const char*>(request->payload) + fileDataOffset;
+ auto fileDataPos = reinterpret_cast<const char*>(request->payload) +
+ fileDataOffset;
std::ofstream stream(value.fsPath,
std::ios::in | std::ios::out | std::ios::binary);
diff --git a/oem/ibm/libpldmresponder/file_io.hpp b/oem/ibm/libpldmresponder/file_io.hpp
index ddde7f8..4e2af4f 100644
--- a/oem/ibm/libpldmresponder/file_io.hpp
+++ b/oem/ibm/libpldmresponder/file_io.hpp
@@ -178,59 +178,52 @@
{
handlers.emplace(PLDM_READ_FILE_INTO_MEMORY,
[this](const pldm_msg* request, size_t payloadLength) {
- return this->readFileIntoMemory(request,
- payloadLength);
- });
+ return this->readFileIntoMemory(request, payloadLength);
+ });
handlers.emplace(PLDM_WRITE_FILE_FROM_MEMORY,
[this](const pldm_msg* request, size_t payloadLength) {
- return this->writeFileFromMemory(request,
- payloadLength);
- });
+ return this->writeFileFromMemory(request, payloadLength);
+ });
handlers.emplace(PLDM_WRITE_FILE_BY_TYPE_FROM_MEMORY,
[this](const pldm_msg* request, size_t payloadLength) {
- return this->writeFileByTypeFromMemory(
- request, payloadLength);
- });
+ return this->writeFileByTypeFromMemory(request, payloadLength);
+ });
handlers.emplace(PLDM_READ_FILE_BY_TYPE_INTO_MEMORY,
[this](const pldm_msg* request, size_t payloadLength) {
- return this->readFileByTypeIntoMemory(
- request, payloadLength);
- });
- handlers.emplace(PLDM_READ_FILE_BY_TYPE, [this](const pldm_msg* request,
- size_t payloadLength) {
+ return this->readFileByTypeIntoMemory(request, payloadLength);
+ });
+ handlers.emplace(PLDM_READ_FILE_BY_TYPE,
+ [this](const pldm_msg* request, size_t payloadLength) {
return this->readFileByType(request, payloadLength);
});
handlers.emplace(PLDM_WRITE_FILE_BY_TYPE,
[this](const pldm_msg* request, size_t payloadLength) {
- return this->writeFileByType(request,
- payloadLength);
- });
+ return this->writeFileByType(request, payloadLength);
+ });
handlers.emplace(PLDM_GET_FILE_TABLE,
[this](const pldm_msg* request, size_t payloadLength) {
- return this->getFileTable(request, payloadLength);
- });
+ return this->getFileTable(request, payloadLength);
+ });
handlers.emplace(PLDM_READ_FILE,
[this](const pldm_msg* request, size_t payloadLength) {
- return this->readFile(request, payloadLength);
- });
+ return this->readFile(request, payloadLength);
+ });
handlers.emplace(PLDM_WRITE_FILE,
[this](const pldm_msg* request, size_t payloadLength) {
- return this->writeFile(request, payloadLength);
- });
+ return this->writeFile(request, payloadLength);
+ });
handlers.emplace(PLDM_FILE_ACK,
[this](const pldm_msg* request, size_t payloadLength) {
- return this->fileAck(request, payloadLength);
- });
+ return this->fileAck(request, payloadLength);
+ });
handlers.emplace(PLDM_HOST_GET_ALERT_STATUS,
[this](const pldm_msg* request, size_t payloadLength) {
- return this->getAlertStatus(request,
- payloadLength);
- });
+ return this->getAlertStatus(request, payloadLength);
+ });
handlers.emplace(PLDM_NEW_FILE_AVAILABLE,
[this](const pldm_msg* request, size_t payloadLength) {
- return this->newFileAvailable(request,
- payloadLength);
- });
+ return this->newFileAvailable(request, payloadLength);
+ });
resDumpMatcher = std::make_unique<sdbusplus::bus::match_t>(
pldm::utils::DBusHandler::getBus(),
@@ -238,42 +231,39 @@
sdbusplus::bus::match::rules::argNpath(0, dumpObjPath),
[this, hostSockFd, hostEid, dbusImplReqester,
handler](sdbusplus::message_t& msg) {
- std::map<
- std::string,
- std::map<std::string, std::variant<std::string, uint32_t>>>
- interfaces;
- sdbusplus::message::object_path path;
- msg.read(path, interfaces);
- std::string vspstring;
- std::string password;
+ std::map<std::string,
+ std::map<std::string, std::variant<std::string, uint32_t>>>
+ interfaces;
+ sdbusplus::message::object_path path;
+ msg.read(path, interfaces);
+ std::string vspstring;
+ std::string password;
- for (auto& interface : interfaces)
+ for (auto& interface : interfaces)
+ {
+ if (interface.first == resDumpEntry)
{
- if (interface.first == resDumpEntry)
+ for (const auto& property : interface.second)
{
- for (const auto& property : interface.second)
+ if (property.first == "VSPString")
{
- if (property.first == "VSPString")
- {
- vspstring =
- std::get<std::string>(property.second);
- }
- else if (property.first == "Password")
- {
- password =
- std::get<std::string>(property.second);
- }
+ vspstring = std::get<std::string>(property.second);
}
- dbusToFileHandlers
- .emplace_back(
- std::make_unique<pldm::requester::oem_ibm::
- DbusToFileHandler>(
- hostSockFd, hostEid, dbusImplReqester, path,
- handler))
- ->processNewResourceDump(vspstring, password);
- break;
+ else if (property.first == "Password")
+ {
+ password = std::get<std::string>(property.second);
+ }
}
+ dbusToFileHandlers
+ .emplace_back(
+ std::make_unique<
+ pldm::requester::oem_ibm::DbusToFileHandler>(
+ hostSockFd, hostEid, dbusImplReqester, path,
+ handler))
+ ->processNewResourceDump(vspstring, password);
+ break;
}
+ }
});
vmiCertMatcher = std::make_unique<sdbusplus::bus::match_t>(
pldm::utils::DBusHandler::getBus(),
@@ -281,40 +271,39 @@
sdbusplus::bus::match::rules::argNpath(0, certObjPath),
[this, hostSockFd, hostEid, dbusImplReqester,
handler](sdbusplus::message_t& msg) {
- std::map<
- std::string,
- std::map<std::string, std::variant<std::string, uint32_t>>>
- interfaces;
- sdbusplus::message::object_path path;
- msg.read(path, interfaces);
- std::string csr;
+ std::map<std::string,
+ std::map<std::string, std::variant<std::string, uint32_t>>>
+ interfaces;
+ sdbusplus::message::object_path path;
+ msg.read(path, interfaces);
+ std::string csr;
- for (auto& interface : interfaces)
+ for (auto& interface : interfaces)
+ {
+ if (interface.first == certAuthority)
{
- if (interface.first == certAuthority)
+ for (const auto& property : interface.second)
{
- for (const auto& property : interface.second)
+ if (property.first == "CSR")
{
- if (property.first == "CSR")
- {
- csr = std::get<std::string>(property.second);
- auto fileHandle =
- sdbusplus::message::object_path(path)
- .filename();
+ csr = std::get<std::string>(property.second);
+ auto fileHandle =
+ sdbusplus::message::object_path(path)
+ .filename();
- dbusToFileHandlers
- .emplace_back(std::make_unique<
- pldm::requester::oem_ibm::
- DbusToFileHandler>(
+ dbusToFileHandlers
+ .emplace_back(
+ std::make_unique<pldm::requester::oem_ibm::
+ DbusToFileHandler>(
hostSockFd, hostEid, dbusImplReqester,
path, handler))
- ->newCsrFileAvailable(csr, fileHandle);
- break;
- }
+ ->newCsrFileAvailable(csr, fileHandle);
+ break;
}
- break;
}
+ break;
}
+ }
});
}
@@ -426,11 +415,11 @@
std::unique_ptr<pldm::requester::oem_ibm::DbusToFileHandler>
dbusToFileHandler; //!< pointer to send request to Host
std::unique_ptr<sdbusplus::bus::match_t>
- resDumpMatcher; //!< Pointer to capture the interface added signal
- //!< for new resource dump
+ resDumpMatcher; //!< Pointer to capture the interface added signal
+ //!< for new resource dump
std::unique_ptr<sdbusplus::bus::match_t>
- vmiCertMatcher; //!< Pointer to capture the interface added signal
- //!< for new csr string
+ vmiCertMatcher; //!< Pointer to capture the interface added signal
+ //!< for new csr string
/** @brief PLDM request handler */
pldm::requester::Handler<pldm::requester::Request>* handler;
std::vector<std::unique_ptr<pldm::requester::oem_ibm::DbusToFileHandler>>
diff --git a/oem/ibm/libpldmresponder/file_io_by_type.cpp b/oem/ibm/libpldmresponder/file_io_by_type.cpp
index ec001fa..0f93efb 100644
--- a/oem/ibm/libpldmresponder/file_io_by_type.cpp
+++ b/oem/ibm/libpldmresponder/file_io_by_type.cpp
@@ -48,8 +48,8 @@
length -= dma::maxSize;
address += dma::maxSize;
}
- auto rc =
- xdmaInterface.transferDataHost(fd, offset, length, address, upstream);
+ auto rc = xdmaInterface.transferDataHost(fd, offset, length, address,
+ upstream);
return rc < 0 ? PLDM_ERROR : PLDM_SUCCESS;
}
@@ -59,8 +59,8 @@
dma::DMA xdmaInterface;
while (length > dma::maxSize)
{
- auto rc =
- xdmaInterface.transferHostDataToSocket(fd, dma::maxSize, address);
+ auto rc = xdmaInterface.transferHostDataToSocket(fd, dma::maxSize,
+ address);
if (rc < 0)
{
return PLDM_ERROR;
diff --git a/oem/ibm/libpldmresponder/file_io_by_type.hpp b/oem/ibm/libpldmresponder/file_io_by_type.hpp
index 1aed02b..1665221 100644
--- a/oem/ibm/libpldmresponder/file_io_by_type.hpp
+++ b/oem/ibm/libpldmresponder/file_io_by_type.hpp
@@ -114,13 +114,11 @@
/** @brief Constructor to create a FileHandler object
*/
- FileHandler(uint32_t fileHandle) : fileHandle(fileHandle)
- {}
+ FileHandler(uint32_t fileHandle) : fileHandle(fileHandle) {}
/** FileHandler destructor
*/
- virtual ~FileHandler()
- {}
+ virtual ~FileHandler() {}
protected:
uint32_t fileHandle; //!< file handle indicating name of file or invalid
diff --git a/oem/ibm/libpldmresponder/file_io_type_cert.cpp b/oem/ibm/libpldmresponder/file_io_type_cert.cpp
index 8d9b73e..af5c585 100644
--- a/oem/ibm/libpldmresponder/file_io_type_cert.cpp
+++ b/oem/ibm/libpldmresponder/file_io_type_cert.cpp
@@ -231,8 +231,8 @@
}
else if (certType == PLDM_FILE_TYPE_ROOT_CERT)
{
- fileFd =
- open((filePath + "RootCert").c_str(), flags, S_IRUSR | S_IWUSR);
+ fileFd = open((filePath + "RootCert").c_str(), flags,
+ S_IRUSR | S_IWUSR);
}
if (fileFd == -1)
{
@@ -297,8 +297,8 @@
}
else if (certType == PLDM_FILE_TYPE_ROOT_CERT)
{
- fileFd =
- open((filePath + "RootCert").c_str(), flags, S_IRUSR | S_IWUSR);
+ fileFd = open((filePath + "RootCert").c_str(), flags,
+ S_IRUSR | S_IWUSR);
}
if (fileFd == -1)
{
diff --git a/oem/ibm/libpldmresponder/file_io_type_cert.hpp b/oem/ibm/libpldmresponder/file_io_type_cert.hpp
index 4e4ad6b..f1f4cd7 100644
--- a/oem/ibm/libpldmresponder/file_io_type_cert.hpp
+++ b/oem/ibm/libpldmresponder/file_io_type_cert.hpp
@@ -61,8 +61,7 @@
/** @brief CertHandler destructor
*/
- ~CertHandler()
- {}
+ ~CertHandler() {}
private:
uint16_t certType; //!< type of the certificate
diff --git a/oem/ibm/libpldmresponder/file_io_type_dump.cpp b/oem/ibm/libpldmresponder/file_io_type_dump.cpp
index 0a0e041..2c6b02a 100644
--- a/oem/ibm/libpldmresponder/file_io_type_dump.cpp
+++ b/oem/ibm/libpldmresponder/file_io_type_dump.cpp
@@ -131,8 +131,8 @@
try
{
- auto service =
- pldm::utils::DBusHandler().getService(notifyObjPath, dumpInterface);
+ auto service = pldm::utils::DBusHandler().getService(notifyObjPath,
+ dumpInterface);
using namespace sdbusplus::xyz::openbmc_project::Dump::server;
auto method = bus.new_method_call(service.c_str(), notifyObjPath,
dumpInterface, "Notify");
diff --git a/oem/ibm/libpldmresponder/file_io_type_dump.hpp b/oem/ibm/libpldmresponder/file_io_type_dump.hpp
index 2e35428..dbb5ba7 100644
--- a/oem/ibm/libpldmresponder/file_io_type_dump.hpp
+++ b/oem/ibm/libpldmresponder/file_io_type_dump.hpp
@@ -45,8 +45,7 @@
/** @brief DumpHandler destructor
*/
- ~DumpHandler()
- {}
+ ~DumpHandler() {}
private:
static int fd; //!< fd to manage the dump offload to bmc
diff --git a/oem/ibm/libpldmresponder/file_io_type_lid.hpp b/oem/ibm/libpldmresponder/file_io_type_lid.hpp
index dbb4fc7..382dbaf 100644
--- a/oem/ibm/libpldmresponder/file_io_type_lid.hpp
+++ b/oem/ibm/libpldmresponder/file_io_type_lid.hpp
@@ -40,8 +40,8 @@
std::stringstream stream;
stream << std::hex << fileHandle;
auto lidName = stream.str() + ".lid";
- std::string patchDir =
- permSide ? LID_ALTERNATE_PATCH_DIR : LID_RUNNING_PATCH_DIR;
+ std::string patchDir = permSide ? LID_ALTERNATE_PATCH_DIR
+ : LID_RUNNING_PATCH_DIR;
auto patch = fs::path(patchDir) / lidName;
if (fs::is_regular_file(patch))
{
@@ -309,8 +309,7 @@
/** @brief LidHandler destructor
*/
- ~LidHandler()
- {}
+ ~LidHandler() {}
protected:
std::string lidPath;
diff --git a/oem/ibm/libpldmresponder/file_io_type_pel.cpp b/oem/ibm/libpldmresponder/file_io_type_pel.cpp
index 2bbb5af..c329bac 100644
--- a/oem/ibm/libpldmresponder/file_io_type_pel.cpp
+++ b/oem/ibm/libpldmresponder/file_io_type_pel.cpp
@@ -103,8 +103,8 @@
try
{
- auto service =
- pldm::utils::DBusHandler().getService(logObjPath, logInterface);
+ auto service = pldm::utils::DBusHandler().getService(logObjPath,
+ logInterface);
auto method = bus.new_method_call(service.c_str(), logObjPath,
logInterface, "GetPEL");
method.append(fileHandle);
@@ -134,8 +134,8 @@
try
{
- auto service =
- pldm::utils::DBusHandler().getService(logObjPath, logInterface);
+ auto service = pldm::utils::DBusHandler().getService(logObjPath,
+ logInterface);
auto method = bus.new_method_call(service.c_str(), logObjPath,
logInterface, "GetPEL");
method.append(fileHandle);
@@ -224,8 +224,8 @@
try
{
- auto service =
- pldm::utils::DBusHandler().getService(logObjPath, logInterface);
+ auto service = pldm::utils::DBusHandler().getService(logObjPath,
+ logInterface);
auto method = bus.new_method_call(service.c_str(), logObjPath,
logInterface, "HostAck");
method.append(fileHandle);
@@ -251,8 +251,8 @@
try
{
- auto service =
- pldm::utils::DBusHandler().getService(logObjPath, logInterface);
+ auto service = pldm::utils::DBusHandler().getService(logObjPath,
+ logInterface);
using namespace sdbusplus::xyz::openbmc_project::Logging::server;
std::map<std::string, std::string> addlData{};
auto severity =
diff --git a/oem/ibm/libpldmresponder/file_io_type_pel.hpp b/oem/ibm/libpldmresponder/file_io_type_pel.hpp
index 043454d..b7a43b1 100644
--- a/oem/ibm/libpldmresponder/file_io_type_pel.hpp
+++ b/oem/ibm/libpldmresponder/file_io_type_pel.hpp
@@ -17,8 +17,7 @@
public:
/** @brief PelHandler constructor
*/
- PelHandler(uint32_t fileHandle) : FileHandler(fileHandle)
- {}
+ PelHandler(uint32_t fileHandle) : FileHandler(fileHandle) {}
virtual int writeFromMemory(uint32_t offset, uint32_t length,
uint64_t address,
@@ -51,8 +50,7 @@
/** @brief PelHandler destructor
*/
- ~PelHandler()
- {}
+ ~PelHandler() {}
};
} // namespace responder
diff --git a/oem/ibm/libpldmresponder/file_io_type_progress_src.cpp b/oem/ibm/libpldmresponder/file_io_type_progress_src.cpp
index 93a6680..ed4bcc6 100644
--- a/oem/ibm/libpldmresponder/file_io_type_progress_src.cpp
+++ b/oem/ibm/libpldmresponder/file_io_type_progress_src.cpp
@@ -27,8 +27,8 @@
try
{
- auto service =
- pldm::utils::DBusHandler().getService(RawObjectPath, RawInterface);
+ auto service = pldm::utils::DBusHandler().getService(RawObjectPath,
+ RawInterface);
auto method = bus.new_method_call(service.c_str(), RawObjectPath,
FreedesktopInterface, SetMethod);
method.append(RawInterface, RawProperty,
diff --git a/oem/ibm/libpldmresponder/file_io_type_progress_src.hpp b/oem/ibm/libpldmresponder/file_io_type_progress_src.hpp
index a223f1a..36f7ccb 100644
--- a/oem/ibm/libpldmresponder/file_io_type_progress_src.hpp
+++ b/oem/ibm/libpldmresponder/file_io_type_progress_src.hpp
@@ -18,8 +18,7 @@
public:
/** @brief ProgressCodeHandler constructor
*/
- ProgressCodeHandler(uint32_t fileHandle) : FileHandler(fileHandle)
- {}
+ ProgressCodeHandler(uint32_t fileHandle) : FileHandler(fileHandle) {}
int writeFromMemory(uint32_t /*offset*/, uint32_t /*length*/,
uint64_t /*address*/,
@@ -65,8 +64,7 @@
/** @brief ProgressCodeHandler destructor
*/
- ~ProgressCodeHandler()
- {}
+ ~ProgressCodeHandler() {}
};
} // namespace responder
diff --git a/oem/ibm/libpldmresponder/inband_code_update.cpp b/oem/ibm/libpldmresponder/inband_code_update.cpp
index c995fc1..c69c1bc 100644
--- a/oem/ibm/libpldmresponder/inband_code_update.cpp
+++ b/oem/ibm/libpldmresponder/inband_code_update.cpp
@@ -169,8 +169,8 @@
runningVersion = std::get<std::vector<std::string>>(paths)[0];
- auto method1 =
- bus.new_method_call(mapperService, activeObjPath, propIntf, "Get");
+ auto method1 = bus.new_method_call(mapperService, activeObjPath,
+ propIntf, "Get");
method1.append("xyz.openbmc_project.Association", "endpoints");
auto reply1 = bus.call(method1);
@@ -198,126 +198,116 @@
pldm::utils::DBusHandler::getBus(),
propertiesChanged(runningVersion, redundancyIntf),
[this](sdbusplus::message_t& msg) {
- DbusChangedProps props;
- std::string iface;
- msg.read(iface, props);
- processPriorityChangeNotification(props);
+ DbusChangedProps props;
+ std::string iface;
+ msg.read(iface, props);
+ processPriorityChangeNotification(props);
}));
fwUpdateMatcher.push_back(std::make_unique<sdbusplus::bus::match_t>(
pldm::utils::DBusHandler::getBus(),
"interface='org.freedesktop.DBus.ObjectManager',type='signal',"
"member='InterfacesAdded',path='/xyz/openbmc_project/software'",
[this](sdbusplus::message_t& msg) {
- DBusInterfaceAdded interfaces;
- sdbusplus::message::object_path path;
- msg.read(path, interfaces);
+ DBusInterfaceAdded interfaces;
+ sdbusplus::message::object_path path;
+ msg.read(path, interfaces);
- for (auto& interface : interfaces)
+ for (auto& interface : interfaces)
+ {
+ if (interface.first == "xyz.openbmc_project.Software.Activation")
{
- if (interface.first ==
- "xyz.openbmc_project.Software.Activation")
- {
- auto imageInterface =
- "xyz.openbmc_project.Software.Activation";
- auto imageObjPath = path.str.c_str();
+ auto imageInterface = "xyz.openbmc_project.Software.Activation";
+ auto imageObjPath = path.str.c_str();
- try
+ try
+ {
+ auto propVal = dBusIntf->getDbusPropertyVariant(
+ imageObjPath, "Activation", imageInterface);
+ const auto& imageProp = std::get<std::string>(propVal);
+ if (imageProp == "xyz.openbmc_project.Software."
+ "Activation.Activations.Ready" &&
+ isCodeUpdateInProgress())
{
- auto propVal = dBusIntf->getDbusPropertyVariant(
- imageObjPath, "Activation", imageInterface);
- const auto& imageProp = std::get<std::string>(propVal);
- if (imageProp == "xyz.openbmc_project.Software."
- "Activation.Activations.Ready" &&
- isCodeUpdateInProgress())
+ newImageId = path.str;
+ if (!imageActivationMatch)
{
- newImageId = path.str;
- if (!imageActivationMatch)
- {
- imageActivationMatch = std::make_unique<
- sdbusplus::bus::match_t>(
+ imageActivationMatch =
+ std::make_unique<sdbusplus::bus::match_t>(
pldm::utils::DBusHandler::getBus(),
propertiesChanged(newImageId,
"xyz.openbmc_project."
"Software.Activation"),
[this](sdbusplus::message_t& msg) {
- DbusChangedProps props;
- std::string iface;
- msg.read(iface, props);
- const auto itr =
- props.find("Activation");
- if (itr != props.end())
- {
- PropertyValue value = itr->second;
- auto propVal =
- std::get<std::string>(value);
- if (propVal ==
- "xyz.openbmc_project.Software."
- "Activation.Activations.Active")
- {
- CodeUpdateState state =
- CodeUpdateState::END;
- setCodeUpdateProgress(false);
- auto sensorId =
- getFirmwareUpdateSensor();
- sendStateSensorEvent(
- sensorId,
- PLDM_STATE_SENSOR_STATE, 0,
- uint8_t(state),
- uint8_t(CodeUpdateState::
- START));
- newImageId.clear();
- }
- else if (propVal ==
- "xyz.openbmc_project."
- "Software.Activation."
- "Activations.Failed" ||
- propVal ==
- "xyz.openbmc_"
- "project.Software."
- "Activation."
- "Activations."
- "Invalid")
- {
- CodeUpdateState state =
- CodeUpdateState::FAIL;
- setCodeUpdateProgress(false);
- auto sensorId =
- getFirmwareUpdateSensor();
- sendStateSensorEvent(
- sensorId,
- PLDM_STATE_SENSOR_STATE, 0,
- uint8_t(state),
- uint8_t(CodeUpdateState::
- START));
- newImageId.clear();
- }
- }
+ DbusChangedProps props;
+ std::string iface;
+ msg.read(iface, props);
+ const auto itr = props.find("Activation");
+ if (itr != props.end())
+ {
+ PropertyValue value = itr->second;
+ auto propVal = std::get<std::string>(value);
+ if (propVal ==
+ "xyz.openbmc_project.Software."
+ "Activation.Activations.Active")
+ {
+ CodeUpdateState state =
+ CodeUpdateState::END;
+ setCodeUpdateProgress(false);
+ auto sensorId =
+ getFirmwareUpdateSensor();
+ sendStateSensorEvent(
+ sensorId, PLDM_STATE_SENSOR_STATE,
+ 0, uint8_t(state),
+ uint8_t(CodeUpdateState::START));
+ newImageId.clear();
+ }
+ else if (propVal == "xyz.openbmc_project."
+ "Software.Activation."
+ "Activations.Failed" ||
+ propVal == "xyz.openbmc_"
+ "project.Software."
+ "Activation."
+ "Activations."
+ "Invalid")
+ {
+ CodeUpdateState state =
+ CodeUpdateState::FAIL;
+ setCodeUpdateProgress(false);
+ auto sensorId =
+ getFirmwareUpdateSensor();
+ sendStateSensorEvent(
+ sensorId, PLDM_STATE_SENSOR_STATE,
+ 0, uint8_t(state),
+ uint8_t(CodeUpdateState::START));
+ newImageId.clear();
+ }
+ }
});
- }
- auto rc = setRequestedActivation();
- if (rc != PLDM_SUCCESS)
- {
- CodeUpdateState state = CodeUpdateState::FAIL;
- setCodeUpdateProgress(false);
- auto sensorId = getFirmwareUpdateSensor();
- sendStateSensorEvent(
- sensorId, PLDM_STATE_SENSOR_STATE, 0,
- uint8_t(state),
- uint8_t(CodeUpdateState::START));
- error("could not set RequestedActivation");
- }
- break;
}
- }
- catch (const sdbusplus::exception_t& e)
- {
- error(
- "Error in getting Activation status,ERROR= {ERR_EXCEP}, INTERFACE={IMG_INTERFACE}, OBJECT PATH={OBJ_PATH}",
- "ERR_EXCEP", e.what(), "IMG_INTERFACE",
- imageInterface, "OBJ_PATH", imageObjPath);
+ auto rc = setRequestedActivation();
+ if (rc != PLDM_SUCCESS)
+ {
+ CodeUpdateState state = CodeUpdateState::FAIL;
+ setCodeUpdateProgress(false);
+ auto sensorId = getFirmwareUpdateSensor();
+ sendStateSensorEvent(
+ sensorId, PLDM_STATE_SENSOR_STATE, 0,
+ uint8_t(state),
+ uint8_t(CodeUpdateState::START));
+ error("could not set RequestedActivation");
+ }
+ break;
}
}
+ catch (const sdbusplus::exception_t& e)
+ {
+ error(
+ "Error in getting Activation status,ERROR= {ERR_EXCEP}, INTERFACE={IMG_INTERFACE}, OBJECT PATH={OBJ_PATH}",
+ "ERR_EXCEP", e.what(), "IMG_INTERFACE", imageInterface,
+ "OBJ_PATH", imageObjPath);
+ }
}
+ }
}));
}
@@ -439,7 +429,7 @@
}
template <typename... T>
-int executeCmd(T const&... t)
+int executeCmd(const T&... t)
{
std::stringstream cmd;
((cmd << t << " "), ...) << std::endl;
diff --git a/oem/ibm/libpldmresponder/inband_code_update.hpp b/oem/ibm/libpldmresponder/inband_code_update.hpp
index 9c7f41c..c16ac44 100644
--- a/oem/ibm/libpldmresponder/inband_code_update.hpp
+++ b/oem/ibm/libpldmresponder/inband_code_update.hpp
@@ -174,8 +174,7 @@
*/
int assembleCodeUpdateImage();
- virtual ~CodeUpdate()
- {}
+ virtual ~CodeUpdate() {}
private:
std::string currBootSide; //!< current boot side
@@ -184,7 +183,7 @@
std::string nonRunningVersion; //!< alternate image
std::string newImageId; //!< new image id
bool codeUpdateInProgress =
- false; //!< indicates whether codeupdate is going on
+ false; //!< indicates whether codeupdate is going on
const pldm::utils::DBusHandler* dBusIntf; //!< D-Bus handler
std::vector<std::unique_ptr<sdbusplus::bus::match_t>>
captureNextBootSideChange; //!< vector to catch the D-Bus property
diff --git a/oem/ibm/libpldmresponder/oem_ibm_handler.cpp b/oem/ibm/libpldmresponder/oem_ibm_handler.cpp
index d171173..fd1b0c4 100644
--- a/oem/ibm/libpldmresponder/oem_ibm_handler.cpp
+++ b/oem/ibm/libpldmresponder/oem_ibm_handler.cpp
@@ -211,8 +211,8 @@
uint16_t stateSetID, pdr_utils::Repo& repo)
{
size_t pdrSize = 0;
- pdrSize =
- sizeof(pldm_state_sensor_pdr) + sizeof(state_sensor_possible_states);
+ pdrSize = sizeof(pldm_state_sensor_pdr) +
+ sizeof(state_sensor_possible_states);
std::vector<uint8_t> entry{};
entry.resize(pdrSize);
pldm_state_sensor_pdr* pdr =
@@ -312,9 +312,8 @@
}
std::cout << tempStream.str() << std::endl;
}
- auto oemPlatformEventMessageResponseHandler = [](mctp_eid_t /*eid*/,
- const pldm_msg* response,
- size_t respMsgLen) {
+ auto oemPlatformEventMessageResponseHandler =
+ [](mctp_eid_t /*eid*/, const pldm_msg* response, size_t respMsgLen) {
uint8_t completionCode{};
uint8_t status{};
auto rc = decode_platform_event_message_resp(response, respMsgLen,
@@ -445,51 +444,50 @@
propertiesChanged("/xyz/openbmc_project/state/chassis0",
"xyz.openbmc_project.State.Chassis"),
[this](sdbusplus::message_t& msg) {
- DbusChangedProps props{};
- std::string intf;
- msg.read(intf, props);
- const auto itr = props.find("CurrentPowerState");
- if (itr != props.end())
+ DbusChangedProps props{};
+ std::string intf;
+ msg.read(intf, props);
+ const auto itr = props.find("CurrentPowerState");
+ if (itr != props.end())
+ {
+ PropertyValue value = itr->second;
+ auto propVal = std::get<std::string>(value);
+ if (propVal == "xyz.openbmc_project.State.Chassis.PowerState.Off")
{
- PropertyValue value = itr->second;
- auto propVal = std::get<std::string>(value);
- if (propVal ==
- "xyz.openbmc_project.State.Chassis.PowerState.Off")
+ pldm::utils::DBusMapping dbusMapping{
+ "/xyz/openbmc_project/control/host0/"
+ "power_restore_policy/one_time",
+ "xyz.openbmc_project.Control.Power.RestorePolicy",
+ "PowerRestorePolicy", "string"};
+ value = "xyz.openbmc_project.Control.Power.RestorePolicy."
+ "Policy.AlwaysOn";
+ try
{
- pldm::utils::DBusMapping dbusMapping{
- "/xyz/openbmc_project/control/host0/"
- "power_restore_policy/one_time",
- "xyz.openbmc_project.Control.Power.RestorePolicy",
- "PowerRestorePolicy", "string"};
- value = "xyz.openbmc_project.Control.Power.RestorePolicy."
- "Policy.AlwaysOn";
- try
- {
- dBusIntf->setDbusProperty(dbusMapping, value);
- }
- catch (const std::exception& e)
- {
- error(
- "Setting one-time restore policy failed, unable to set property PowerRestorePolicy ERROR={ERR_EXCEP}",
- "ERR_EXCEP", e.what());
- }
- dbusMapping = pldm::utils::DBusMapping{
- "/xyz/openbmc_project/state/bmc0",
- "xyz.openbmc_project.State.BMC",
- "RequestedBMCTransition", "string"};
- value = "xyz.openbmc_project.State.BMC.Transition.Reboot";
- try
- {
- dBusIntf->setDbusProperty(dbusMapping, value);
- }
- catch (const std::exception& e)
- {
- error(
- "BMC state transition to reboot failed, unable to set property RequestedBMCTransition ERROR={ERR_EXCEP}",
- "ERR_EXCEP", e.what());
- }
+ dBusIntf->setDbusProperty(dbusMapping, value);
+ }
+ catch (const std::exception& e)
+ {
+ error(
+ "Setting one-time restore policy failed, unable to set property PowerRestorePolicy ERROR={ERR_EXCEP}",
+ "ERR_EXCEP", e.what());
+ }
+ dbusMapping = pldm::utils::DBusMapping{
+ "/xyz/openbmc_project/state/bmc0",
+ "xyz.openbmc_project.State.BMC", "RequestedBMCTransition",
+ "string"};
+ value = "xyz.openbmc_project.State.BMC.Transition.Reboot";
+ try
+ {
+ dBusIntf->setDbusProperty(dbusMapping, value);
+ }
+ catch (const std::exception& e)
+ {
+ error(
+ "BMC state transition to reboot failed, unable to set property RequestedBMCTransition ERROR={ERR_EXCEP}",
+ "ERR_EXCEP", e.what());
}
}
+ }
});
}
diff --git a/oem/ibm/libpldmresponder/oem_ibm_handler.hpp b/oem/ibm/libpldmresponder/oem_ibm_handler.hpp
index 7dbd8d8..4de6835 100644
--- a/oem/ibm/libpldmresponder/oem_ibm_handler.hpp
+++ b/oem/ibm/libpldmresponder/oem_ibm_handler.hpp
@@ -47,27 +47,26 @@
propertiesChanged("/xyz/openbmc_project/state/host0",
"xyz.openbmc_project.State.Host"),
[this](sdbusplus::message_t& msg) {
- pldm::utils::DbusChangedProps props{};
- std::string intf;
- msg.read(intf, props);
- const auto itr = props.find("CurrentHostState");
- if (itr != props.end())
+ pldm::utils::DbusChangedProps props{};
+ std::string intf;
+ msg.read(intf, props);
+ const auto itr = props.find("CurrentHostState");
+ if (itr != props.end())
+ {
+ pldm::utils::PropertyValue value = itr->second;
+ auto propVal = std::get<std::string>(value);
+ if (propVal == "xyz.openbmc_project.State.Host.HostState.Off")
{
- pldm::utils::PropertyValue value = itr->second;
- auto propVal = std::get<std::string>(value);
- if (propVal ==
- "xyz.openbmc_project.State.Host.HostState.Off")
- {
- hostOff = true;
- setEventReceiverCnt = 0;
- disableWatchDogTimer();
- }
- else if (propVal ==
- "xyz.openbmc_project.State.Host.HostState.Running")
- {
- hostOff = false;
- }
+ hostOff = true;
+ setEventReceiverCnt = 0;
+ disableWatchDogTimer();
}
+ else if (propVal ==
+ "xyz.openbmc_project.State.Host.HostState.Running")
+ {
+ hostOff = false;
+ }
+ }
});
}
diff --git a/oem/ibm/libpldmresponder/platform_oem_ibm.cpp b/oem/ibm/libpldmresponder/platform_oem_ibm.cpp
index 4b7cec5..e7966a2 100644
--- a/oem/ibm/libpldmresponder/platform_oem_ibm.cpp
+++ b/oem/ibm/libpldmresponder/platform_oem_ibm.cpp
@@ -83,9 +83,8 @@
return rc;
}
- auto platformEventMessageResponseHandler = [](mctp_eid_t /*eid*/,
- const pldm_msg* response,
- size_t respMsgLen) {
+ auto platformEventMessageResponseHandler =
+ [](mctp_eid_t /*eid*/, const pldm_msg* response, size_t respMsgLen) {
if (response == nullptr || !respMsgLen)
{
error("Failed to receive response for platform event message");
diff --git a/oem/ibm/requester/dbus_to_file_handler.cpp b/oem/ibm/requester/dbus_to_file_handler.cpp
index ff632b9..e71116a 100644
--- a/oem/ibm/requester/dbus_to_file_handler.cpp
+++ b/oem/ibm/requester/dbus_to_file_handler.cpp
@@ -52,9 +52,9 @@
// Need to revisit this logic at the time of multiple resource dump support
uint32_t fileHandle = 1;
- auto rc =
- encode_new_file_req(instanceId, PLDM_FILE_TYPE_RESOURCE_DUMP_PARMS,
- fileHandle, fileSize, request);
+ auto rc = encode_new_file_req(instanceId,
+ PLDM_FILE_TYPE_RESOURCE_DUMP_PARMS,
+ fileHandle, fileSize, request);
if (rc != PLDM_SUCCESS)
{
requester->markFree(mctp_eid, instanceId);
@@ -259,17 +259,16 @@
PLDM_NEW_FILE_REQ_BYTES);
auto request = reinterpret_cast<pldm_msg*>(requestMsg.data());
- auto rc =
- encode_new_file_req(instanceId, type, fileHandle, fileSize, request);
+ auto rc = encode_new_file_req(instanceId, type, fileHandle, fileSize,
+ request);
if (rc != PLDM_SUCCESS)
{
requester->markFree(mctp_eid, instanceId);
error("Failed to encode_new_file_req, rc = {RC}", "RC", rc);
return;
}
- auto newFileAvailableRespHandler = [](mctp_eid_t /*eid*/,
- const pldm_msg* response,
- size_t respMsgLen) {
+ auto newFileAvailableRespHandler =
+ [](mctp_eid_t /*eid*/, const pldm_msg* response, size_t respMsgLen) {
if (response == nullptr || !respMsgLen)
{
error(
diff --git a/oem/ibm/test/libpldmresponder_oem_platform_test.cpp b/oem/ibm/test/libpldmresponder_oem_platform_test.cpp
index 592a591..d0881e4 100644
--- a/oem/ibm/test/libpldmresponder_oem_platform_test.cpp
+++ b/oem/ibm/test/libpldmresponder_oem_platform_test.cpp
@@ -145,8 +145,8 @@
PLDM_PLATFORM_EVENT_MESSAGE_MIN_REQ_BYTES +
sensorEventDataVec.size());
- auto rc =
- encodeEventMsg(PLDM_SENSOR_EVENT, sensorEventDataVec, requestMsg, 0x1);
+ auto rc = encodeEventMsg(PLDM_SENSOR_EVENT, sensorEventDataVec, requestMsg,
+ 0x1);
EXPECT_EQ(rc, PLDM_SUCCESS);
}
@@ -156,8 +156,8 @@
std::vector<uint8_t> requestMsg;
std::vector<uint8_t> sensorEventDataVec{};
- auto rc =
- encodeEventMsg(PLDM_SENSOR_EVENT, sensorEventDataVec, requestMsg, 0x1);
+ auto rc = encodeEventMsg(PLDM_SENSOR_EVENT, sensorEventDataVec, requestMsg,
+ 0x1);
EXPECT_EQ(rc, PLDM_ERROR_INVALID_DATA);
}
diff --git a/pldmd/dbus_impl_pdr.cpp b/pldmd/dbus_impl_pdr.cpp
index ae37be2..1516c8d 100644
--- a/pldmd/dbus_impl_pdr.cpp
+++ b/pldmd/dbus_impl_pdr.cpp
@@ -19,8 +19,8 @@
uint16_t entityID,
uint16_t stateSetId)
{
- auto pdrs =
- pldm::utils::findStateEffecterPDR(tid, entityID, stateSetId, pdrRepo);
+ auto pdrs = pldm::utils::findStateEffecterPDR(tid, entityID, stateSetId,
+ pdrRepo);
if (pdrs.empty())
{
@@ -33,8 +33,8 @@
std::vector<std::vector<uint8_t>>
Pdr::findStateSensorPDR(uint8_t tid, uint16_t entityID, uint16_t stateSetId)
{
- auto pdrs =
- pldm::utils::findStateSensorPDR(tid, entityID, stateSetId, pdrRepo);
+ auto pdrs = pldm::utils::findStateSensorPDR(tid, entityID, stateSetId,
+ pdrRepo);
if (pdrs.empty())
{
throw ResourceNotFound();
diff --git a/pldmd/handler.hpp b/pldmd/handler.hpp
index 7622b17..cfa95eb 100644
--- a/pldmd/handler.hpp
+++ b/pldmd/handler.hpp
@@ -48,9 +48,9 @@
{
Response response(sizeof(pldm_msg), 0);
auto ptr = reinterpret_cast<pldm_msg*>(response.data());
- auto rc =
- encode_cc_only_resp(request->hdr.instance_id, request->hdr.type,
- request->hdr.command, cc, ptr);
+ auto rc = encode_cc_only_resp(request->hdr.instance_id,
+ request->hdr.type, request->hdr.command,
+ cc, ptr);
assert(rc == PLDM_SUCCESS);
return response;
}
diff --git a/pldmd/pldmd.cpp b/pldmd/pldmd.cpp
index 191dd11..9f5bbaa 100644
--- a/pldmd/pldmd.cpp
+++ b/pldmd/pldmd.cpp
@@ -104,9 +104,9 @@
{
if (hdrFields.pldm_type != PLDM_FWUP)
{
- response =
- invoker.handle(hdrFields.pldm_type, hdrFields.command,
- request, requestLen);
+ response = invoker.handle(hdrFields.pldm_type,
+ hdrFields.command, request,
+ requestLen);
}
else
{
@@ -376,8 +376,8 @@
}
iov[0].iov_base = &requestMsg[0];
- iov[0].iov_len =
- sizeof(requestMsg[0]) + sizeof(requestMsg[1]);
+ iov[0].iov_len = sizeof(requestMsg[0]) +
+ sizeof(requestMsg[1]);
iov[1].iov_base = (*response).data();
iov[1].iov_len = (*response).size();
diff --git a/pldmtool/oem/ibm/pldm_oem_ibm.cpp b/pldmtool/oem/ibm/pldm_oem_ibm.cpp
index a5eb71a..cdaa2d5 100644
--- a/pldmtool/oem/ibm/pldm_oem_ibm.cpp
+++ b/pldmtool/oem/ibm/pldm_oem_ibm.cpp
@@ -108,8 +108,7 @@
return {PLDM_ERROR, {}};
}
- void parseResponseMsg(pldm_msg*, size_t) override
- {}
+ void parseResponseMsg(pldm_msg*, size_t) override {}
void exec()
{
std::vector<uint8_t> requestMsg(sizeof(pldm_msg_hdr) +
@@ -182,7 +181,7 @@
startptr += sizeof(filetableData->file_name_length);
fdata["FileName"] = (std::string(
- reinterpret_cast<char const*>(startptr), nameLength));
+ reinterpret_cast<const char*>(startptr), nameLength));
startptr += nameLength;
auto fileSize = *(reinterpret_cast<uint32_t*>(startptr));
@@ -209,8 +208,8 @@
commands.push_back(std::make_unique<GetAlertStatus>(
"oem_ibm", "getAlertStatus", getAlertStatus));
- auto getFileTable =
- oem_ibm->add_subcommand("GetFileTable", "get file table");
+ auto getFileTable = oem_ibm->add_subcommand("GetFileTable",
+ "get file table");
commands.push_back(std::make_unique<GetFileTable>("oem_ibm", "getFileTable",
getFileTable));
diff --git a/pldmtool/pldm_base_cmd.cpp b/pldmtool/pldm_base_cmd.cpp
index cbc4d43..ef2a1a5 100644
--- a/pldmtool/pldm_base_cmd.cpp
+++ b/pldmtool/pldm_base_cmd.cpp
@@ -127,9 +127,10 @@
bitfield8_t b = types[i / 8];
if (b.byte & (1 << i % 8))
{
- auto it = std::find_if(
- pldmTypes.begin(), pldmTypes.end(),
- [i](const auto& typePair) { return typePair.second == i; });
+ auto it = std::find_if(pldmTypes.begin(), pldmTypes.end(),
+ [i](const auto& typePair) {
+ return typePair.second == i;
+ });
if (it != pldmTypes.end())
{
jarray["PLDM Type"] = it->first;
@@ -175,9 +176,9 @@
uint8_t cc = 0, transferFlag = 0;
uint32_t transferHandle = 0;
ver32_t version;
- auto rc =
- decode_get_version_resp(responsePtr, payloadLength, &cc,
- &transferHandle, &transferFlag, &version);
+ auto rc = decode_get_version_resp(responsePtr, payloadLength, &cc,
+ &transferHandle, &transferFlag,
+ &version);
if (rc != PLDM_SUCCESS || cc != PLDM_SUCCESS)
{
std::cerr << "Response Message Error: "
@@ -187,9 +188,10 @@
char buffer[16] = {0};
ver2str(&version, buffer, sizeof(buffer));
ordered_json data;
- auto it = std::find_if(
- pldmTypes.begin(), pldmTypes.end(),
- [&](const auto& typePair) { return typePair.second == pldmType; });
+ auto it = std::find_if(pldmTypes.begin(), pldmTypes.end(),
+ [&](const auto& typePair) {
+ return typePair.second == pldmType;
+ });
if (it != pldmTypes.end())
{
@@ -265,8 +267,8 @@
PLDM_GET_COMMANDS_REQ_BYTES);
auto request = reinterpret_cast<pldm_msg*>(requestMsg.data());
ver32_t version{0xFF, 0xFF, 0xFF, 0xFF};
- auto rc =
- encode_get_commands_req(instanceId, pldmType, version, request);
+ auto rc = encode_get_commands_req(instanceId, pldmType, version,
+ request);
return {rc, requestMsg};
}
@@ -291,9 +293,10 @@
template <typename CommandMap>
void printCommand(CommandMap& commandMap, int i, ordered_json& jarray)
{
- auto it = std::find_if(
- commandMap.begin(), commandMap.end(),
- [i](const auto& typePair) { return typePair.second == i; });
+ auto it = std::find_if(commandMap.begin(), commandMap.end(),
+ [i](const auto& typePair) {
+ return typePair.second == i;
+ });
if (it != commandMap.end())
{
jarray["PLDM Command Code"] = i;
@@ -346,13 +349,13 @@
auto base = app.add_subcommand("base", "base type command");
base->require_subcommand(1);
- auto getPLDMTypes =
- base->add_subcommand("GetPLDMTypes", "get pldm supported types");
+ auto getPLDMTypes = base->add_subcommand("GetPLDMTypes",
+ "get pldm supported types");
commands.push_back(
std::make_unique<GetPLDMTypes>("base", "GetPLDMTypes", getPLDMTypes));
- auto getPLDMVersion =
- base->add_subcommand("GetPLDMVersion", "get version of a certain type");
+ auto getPLDMVersion = base->add_subcommand("GetPLDMVersion",
+ "get version of a certain type");
commands.push_back(std::make_unique<GetPLDMVersion>(
"base", "GetPLDMVersion", getPLDMVersion));
diff --git a/pldmtool/pldm_bios_cmd.cpp b/pldmtool/pldm_bios_cmd.cpp
index bea7690..7c0adc5 100644
--- a/pldmtool/pldm_bios_cmd.cpp
+++ b/pldmtool/pldm_bios_cmd.cpp
@@ -60,9 +60,9 @@
uint8_t seconds, minutes, hours, day, month;
uint16_t year;
- auto rc =
- decode_get_date_time_resp(responsePtr, payloadLength, &cc, &seconds,
- &minutes, &hours, &day, &month, &year);
+ auto rc = decode_get_date_time_resp(responsePtr, payloadLength, &cc,
+ &seconds, &minutes, &hours, &day,
+ &month, &year);
if (rc != PLDM_SUCCESS || cc != PLDM_SUCCESS)
{
std::cerr << "Response Message Error: "
@@ -191,8 +191,7 @@
return {PLDM_ERROR, {}};
}
- void parseResponseMsg(pldm_msg*, size_t) override
- {}
+ void parseResponseMsg(pldm_msg*, size_t) override {}
std::optional<Table> getBIOSTable(pldm_bios_table_types tableType)
{
@@ -786,8 +785,8 @@
return;
}
- auto attrEntry =
- findAttrEntryByName(attrName, *attrTable, *stringTable);
+ auto attrEntry = findAttrEntryByName(attrName, *attrTable,
+ *stringTable);
if (attrEntry == nullptr)
{
std::cout << "Could not find attribute :" << attrName << std::endl;
@@ -929,8 +928,8 @@
commands.push_back(
std::make_unique<GetDateTime>("bios", "GetDateTime", getDateTime));
- auto setDateTime =
- bios->add_subcommand("SetDateTime", "set host date time");
+ auto setDateTime = bios->add_subcommand("SetDateTime",
+ "set host date time");
commands.push_back(
std::make_unique<SetDateTime>("bios", "setDateTime", setDateTime));
diff --git a/pldmtool/pldm_cmd_helper.cpp b/pldmtool/pldm_cmd_helper.cpp
index 1bee118..cfbf5c0 100644
--- a/pldmtool/pldm_cmd_helper.cpp
+++ b/pldmtool/pldm_cmd_helper.cpp
@@ -95,8 +95,8 @@
auto reqhdr = reinterpret_cast<const pldm_msg_hdr*>(&requestMsg[2]);
do
{
- ssize_t peekedLength =
- recv(socketFd(), nullptr, 0, MSG_PEEK | MSG_TRUNC);
+ ssize_t peekedLength = recv(socketFd(), nullptr, 0,
+ MSG_PEEK | MSG_TRUNC);
responseMsg.resize(peekedLength);
auto recvDataLength =
recv(socketFd(), reinterpret_cast<void*>(responseMsg.data()),
@@ -139,8 +139,8 @@
auto& bus = pldm::utils::DBusHandler::getBus();
try
{
- auto service =
- pldm::utils::DBusHandler().getService(pldmObjPath, pldmRequester);
+ auto service = pldm::utils::DBusHandler().getService(pldmObjPath,
+ pldmRequester);
auto method = bus.new_method_call(service.c_str(), pldmObjPath,
pldmRequester, "GetInstanceId");
method.append(mctp_eid);
diff --git a/pldmtool/pldm_fru_cmd.cpp b/pldmtool/pldm_fru_cmd.cpp
index 5d012da..39e7e51 100644
--- a/pldmtool/pldm_fru_cmd.cpp
+++ b/pldmtool/pldm_fru_cmd.cpp
@@ -100,8 +100,8 @@
reinterpret_cast<const pldm_fru_record_data_format*>(p);
output["FRU Record Set Identifier"] =
(int)le16toh(record->record_set_id);
- output["FRU Record Type"] =
- typeToString(fruRecordTypes, record->record_type);
+ output["FRU Record Type"] = typeToString(fruRecordTypes,
+ record->record_type);
output["Number of FRU fields"] = (int)record->num_fru_fields;
output["Encoding Type for FRU fields"] =
typeToString(fruEncodingType, record->encoding_type);
@@ -124,22 +124,22 @@
fruGeneralFieldTypes.end());
if (tlv->type == PLDM_FRU_FIELD_TYPE_IANA)
{
- fruFieldValue =
- fruFieldParserU32(tlv->value, tlv->length);
+ fruFieldValue = fruFieldParserU32(tlv->value,
+ tlv->length);
}
else if (tlv->type == PLDM_FRU_FIELD_TYPE_MANUFAC_DATE)
{
- fruFieldValue =
- fruFieldParserTimestamp(tlv->value, tlv->length);
+ fruFieldValue = fruFieldParserTimestamp(tlv->value,
+ tlv->length);
}
else
{
- fruFieldValue =
- fruFieldValuestring(tlv->value, tlv->length);
+ fruFieldValue = fruFieldValuestring(tlv->value,
+ tlv->length);
}
- frudata["FRU Field Type"] =
- typeToString(FruFieldTypeMap, tlv->type);
+ frudata["FRU Field Type"] = typeToString(FruFieldTypeMap,
+ tlv->type);
frudata["FRU Field Length"] = (int)(tlv->length);
frudata["FRU Field Value"] = fruFieldValue;
frufielddata.emplace_back(frudata);
@@ -149,8 +149,8 @@
#ifdef OEM_IBM
if (tlv->type == PLDM_OEM_FRU_FIELD_TYPE_RT)
{
- auto oemIPZValue =
- fruFieldValuestring(tlv->value, tlv->length);
+ auto oemIPZValue = fruFieldValuestring(tlv->value,
+ tlv->length);
if (populateMaps.find(oemIPZValue) !=
populateMaps.end())
@@ -168,21 +168,21 @@
}
if (tlv->type == PLDM_OEM_FRU_FIELD_TYPE_IANA)
{
- fruFieldValue =
- fruFieldParserU32(tlv->value, tlv->length);
+ fruFieldValue = fruFieldParserU32(tlv->value,
+ tlv->length);
}
else if (tlv->type != 2)
{
- fruFieldValue =
- fruFieldIPZParser(tlv->value, tlv->length);
+ fruFieldValue = fruFieldIPZParser(tlv->value,
+ tlv->length);
}
else
{
- fruFieldValue =
- fruFieldValuestring(tlv->value, tlv->length);
+ fruFieldValue = fruFieldValuestring(tlv->value,
+ tlv->length);
}
- frudata["FRU Field Type"] =
- typeToString(FruFieldTypeMap, tlv->type);
+ frudata["FRU Field Type"] = typeToString(FruFieldTypeMap,
+ tlv->type);
frudata["FRU Field Length"] = (int)(tlv->length);
frudata["FRU Field Value"] = fruFieldValue;
frufielddata.emplace_back(frudata);
@@ -457,13 +457,13 @@
commands.push_back(std::make_unique<GetFruRecordTableMetadata>(
"fru", "GetFruRecordTableMetadata", getFruRecordTableMetadata));
- auto getFRURecordByOption =
- fru->add_subcommand("GetFRURecordByOption", "get FRU Record By Option");
+ auto getFRURecordByOption = fru->add_subcommand("GetFRURecordByOption",
+ "get FRU Record By Option");
commands.push_back(std::make_unique<GetFRURecordByOption>(
"fru", "GetFRURecordByOption", getFRURecordByOption));
- auto getFruRecordTable =
- fru->add_subcommand("GetFruRecordTable", "get FRU Record Table");
+ auto getFruRecordTable = fru->add_subcommand("GetFruRecordTable",
+ "get FRU Record Table");
commands.push_back(std::make_unique<GetFruRecordTable>(
"fru", "GetFruRecordTable", getFruRecordTable));
}
diff --git a/pldmtool/pldm_fw_update_cmd.cpp b/pldmtool/pldm_fw_update_cmd.cpp
index bf03302..87c4d6e 100644
--- a/pldmtool/pldm_fw_update_cmd.cpp
+++ b/pldmtool/pldm_fw_update_cmd.cpp
@@ -613,8 +613,8 @@
void registerCommand(CLI::App& app)
{
- auto fwUpdate =
- app.add_subcommand("fw_update", "firmware update type commands");
+ auto fwUpdate = app.add_subcommand("fw_update",
+ "firmware update type commands");
fwUpdate->require_subcommand(1);
auto getStatus = fwUpdate->add_subcommand("GetStatus", "Status of the FD");
@@ -634,4 +634,4 @@
} // namespace fw_update
-} // namespace pldmtool
\ No newline at end of file
+} // namespace pldmtool
diff --git a/pldmtool/pldm_platform_cmd.cpp b/pldmtool/pldm_platform_cmd.cpp
index 4a78763..259ca40 100644
--- a/pldmtool/pldm_platform_cmd.cpp
+++ b/pldmtool/pldm_platform_cmd.cpp
@@ -115,8 +115,8 @@
}
// check for circular references.
- auto result =
- recordsSeen.emplace(recordHandle, prevRecordHandle);
+ auto result = recordsSeen.emplace(recordHandle,
+ prevRecordHandle);
if (!result.second)
{
std::cerr
@@ -149,9 +149,9 @@
PLDM_GET_PDR_REQ_BYTES);
auto request = reinterpret_cast<pldm_msg*>(requestMsg.data());
- auto rc =
- encode_get_pdr_req(instanceId, recordHandle, 0, PLDM_GET_FIRSTPART,
- UINT16_MAX, 0, request, PLDM_GET_PDR_REQ_BYTES);
+ auto rc = encode_get_pdr_req(instanceId, recordHandle, 0,
+ PLDM_GET_FIRSTPART, UINT16_MAX, 0, request,
+ PLDM_GET_PDR_REQ_BYTES);
return {rc, requestMsg};
}
@@ -927,8 +927,8 @@
output["containerID"] = pdr->container_id;
output["effecterSemanticID"] = pdr->effecter_semantic_id;
output["effecterInit"] = effecterInit[pdr->effecter_init];
- output["effecterDescriptionPDR"] =
- (pdr->has_description_pdr ? true : false);
+ output["effecterDescriptionPDR"] = (pdr->has_description_pdr ? true
+ : false);
output["compositeEffecterCount"] =
unsigned(pdr->composite_effecter_count);
@@ -1336,8 +1336,8 @@
auto platform = app.add_subcommand("platform", "platform type command");
platform->require_subcommand(1);
- auto getPDR =
- platform->add_subcommand("GetPDR", "get platform descriptor records");
+ auto getPDR = platform->add_subcommand("GetPDR",
+ "get platform descriptor records");
commands.push_back(std::make_unique<GetPDR>("platform", "getPDR", getPDR));
auto setStateEffecterStates = platform->add_subcommand(
diff --git a/pldmtool/pldmtool.cpp b/pldmtool/pldmtool.cpp
index 5456221..dcd4640 100644
--- a/pldmtool/pldmtool.cpp
+++ b/pldmtool/pldmtool.cpp
@@ -54,8 +54,8 @@
void registerCommand(CLI::App& app)
{
- auto raw =
- app.add_subcommand("raw", "send a raw request and print response");
+ auto raw = app.add_subcommand("raw",
+ "send a raw request and print response");
commands.push_back(std::make_unique<RawOp>("raw", "raw", raw));
}
diff --git a/requester/handler.hpp b/requester/handler.hpp
index bdcd7ee..ece1382 100644
--- a/requester/handler.hpp
+++ b/requester/handler.hpp
@@ -138,8 +138,8 @@
"EID", (unsigned)key.eid, "INST_ID",
(unsigned)key.instanceId, "REQ_KEY_TYPE",
(unsigned)key.type, "REQ_KEY_CMD", (unsigned)key.command);
- auto& [request, responseHandler, timerInstance] =
- this->handlers[key];
+ auto& [request, responseHandler,
+ timerInstance] = this->handlers[key];
request->stop();
auto rc = timerInstance->stop();
if (rc)
@@ -244,10 +244,10 @@
int currentSendbuffSize; //!< current Send Buffer size
bool verbose; //!< verbose tracing flag
std::chrono::seconds
- instanceIdExpiryInterval; //!< Instance ID expiration interval
- uint8_t numRetries; //!< number of request retries
+ instanceIdExpiryInterval; //!< Instance ID expiration interval
+ uint8_t numRetries; //!< number of request retries
std::chrono::milliseconds
- responseTimeOut; //!< time to wait between each retry
+ responseTimeOut; //!< time to wait between each retry
/** @brief Container for storing the details of the PLDM request
* message, handler for the corresponding PLDM response and the
diff --git a/requester/mctp_endpoint_discovery.hpp b/requester/mctp_endpoint_discovery.hpp
index 8f7e7eb..7fbe069 100644
--- a/requester/mctp_endpoint_discovery.hpp
+++ b/requester/mctp_endpoint_discovery.hpp
@@ -43,4 +43,4 @@
"xyz.openbmc_project.MCTP.Endpoint"};
};
-} // namespace pldm
\ No newline at end of file
+} // namespace pldm
diff --git a/requester/request.hpp b/requester/request.hpp
index 25e0030..2c216da 100644
--- a/requester/request.hpp
+++ b/requester/request.hpp
@@ -182,9 +182,9 @@
{
int oldSendbuffSize = currentSendbuffSize;
currentSendbuffSize = requestMsg.size();
- int res =
- setsockopt(fd, SOL_SOCKET, SO_SNDBUF, ¤tSendbuffSize,
- sizeof(currentSendbuffSize));
+ int res = setsockopt(fd, SOL_SOCKET, SO_SNDBUF,
+ ¤tSendbuffSize,
+ sizeof(currentSendbuffSize));
if (res == -1)
{
error(
diff --git a/requester/test/request_test.cpp b/requester/test/request_test.cpp
index 392b9ec..2e3060d 100644
--- a/requester/test/request_test.cpp
+++ b/requester/test/request_test.cpp
@@ -18,8 +18,7 @@
class RequestIntfTest : public testing::Test
{
protected:
- RequestIntfTest() : event(sdeventplus::Event::get_default())
- {}
+ RequestIntfTest() : event(sdeventplus::Event::get_default()) {}
/** @brief This function runs the sd_event_run in a loop till all the events
* in the testcase are dispatched and exits when there are no events
diff --git a/softoff/softoff.cpp b/softoff/softoff.cpp
index 7d83cb6..a5c7a19 100644
--- a/softoff/softoff.cpp
+++ b/softoff/softoff.cpp
@@ -275,8 +275,8 @@
sensorOffset = offset;
break;
}
- possibleStatesStart +=
- possibleStateSize + sizeof(setId) + sizeof(possibleStateSize);
+ possibleStatesStart += possibleStateSize + sizeof(setId) +
+ sizeof(possibleStateSize);
}
}
catch (const sdbusplus::exception_t& e)
@@ -342,8 +342,8 @@
}
// Add a timer to the event loop, default 30s.
- auto timerCallback = [=, this](Timer& /*source*/,
- Timer::TimePoint /*time*/) {
+ auto timerCallback =
+ [=, this](Timer& /*source*/, Timer::TimePoint /*time*/) {
if (!responseReceived)
{
error(
diff --git a/test/pldmd_registration_test.cpp b/test/pldmd_registration_test.cpp
index 8ed37a7..4f50ae0 100644
--- a/test/pldmd_registration_test.cpp
+++ b/test/pldmd_registration_test.cpp
@@ -18,8 +18,8 @@
{
handlers.emplace(testCmd,
[this](const pldm_msg* request, size_t payloadLength) {
- return this->handle(request, payloadLength);
- });
+ return this->handle(request, payloadLength);
+ });
}
Response handle(const pldm_msg* /*request*/, size_t /*payloadLength*/)