clang-format: re-format for clang-18
clang-format-18 isn't compatible with the clang-format-17 output, so we
need to reformat the code with the latest version. The way clang-18
handles lambda formatting also changed, so we have made changes to the
organization default style format to better handle lambda formatting.
See I5e08687e696dd240402a2780158664b7113def0e for updated style.
See Iea0776aaa7edd483fa395e23de25ebf5a6288f71 for clang-18 enablement.
Change-Id: I8c84201cb2343a8c8a5507a49de0721a1bee7063
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/libpldmresponder/base.hpp b/libpldmresponder/base.hpp
index ad41299..b0829c4 100644
--- a/libpldmresponder/base.hpp
+++ b/libpldmresponder/base.hpp
@@ -25,23 +25,23 @@
handlers.emplace(
PLDM_GET_PLDM_TYPES,
[this](pldm_tid_t, const pldm_msg* request, size_t payloadLength) {
- return this->getPLDMTypes(request, payloadLength);
- });
+ return this->getPLDMTypes(request, payloadLength);
+ });
handlers.emplace(
PLDM_GET_PLDM_COMMANDS,
[this](pldm_tid_t, const pldm_msg* request, size_t payloadLength) {
- return this->getPLDMCommands(request, payloadLength);
- });
+ return this->getPLDMCommands(request, payloadLength);
+ });
handlers.emplace(
PLDM_GET_PLDM_VERSION,
[this](pldm_tid_t, const pldm_msg* request, size_t payloadLength) {
- return this->getPLDMVersion(request, payloadLength);
- });
+ return this->getPLDMVersion(request, payloadLength);
+ });
handlers.emplace(
PLDM_GET_TID,
[this](pldm_tid_t, 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 d97229d..1f3d536 100644
--- a/libpldmresponder/bios.cpp
+++ b/libpldmresponder/bios.cpp
@@ -35,11 +35,11 @@
minutes = pldm::utils::decimalToBcd(time->tm_min);
hours = pldm::utils::decimalToBcd(time->tm_hour);
day = pldm::utils::decimalToBcd(time->tm_mday);
- month = pldm::utils::decimalToBcd(time->tm_mon +
- 1); // The number of months in the range
- // 0 to 11.PLDM expects range 1 to 12
- year = pldm::utils::decimalToBcd(time->tm_year +
- 1900); // The number of years since 1900
+ month = pldm::utils::decimalToBcd(
+ time->tm_mon + 1); // The number of months in the range
+ // 0 to 11.PLDM expects range 1 to 12
+ year = pldm::utils::decimalToBcd(
+ time->tm_year + 1900); // The number of years since 1900
}
std::time_t timeToEpoch(uint8_t seconds, uint8_t minutes, uint8_t hours,
@@ -80,34 +80,34 @@
handlers.emplace(
PLDM_SET_DATE_TIME,
[this](pldm_tid_t, const pldm_msg* request, size_t payloadLength) {
- return this->setDateTime(request, payloadLength);
- });
+ return this->setDateTime(request, payloadLength);
+ });
handlers.emplace(
PLDM_GET_DATE_TIME,
[this](pldm_tid_t, const pldm_msg* request, size_t payloadLength) {
- return this->getDateTime(request, payloadLength);
- });
+ return this->getDateTime(request, payloadLength);
+ });
handlers.emplace(
PLDM_GET_BIOS_TABLE,
[this](pldm_tid_t, const pldm_msg* request, size_t payloadLength) {
- return this->getBIOSTable(request, payloadLength);
- });
+ return this->getBIOSTable(request, payloadLength);
+ });
handlers.emplace(
PLDM_SET_BIOS_TABLE,
[this](pldm_tid_t, 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](pldm_tid_t, 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](pldm_tid_t, 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_attribute.cpp b/libpldmresponder/bios_attribute.cpp
index 7ae6af7..d169b14 100644
--- a/libpldmresponder/bios_attribute.cpp
+++ b/libpldmresponder/bios_attribute.cpp
@@ -16,9 +16,9 @@
BIOSAttribute::BIOSAttribute(const Json& entry,
DBusHandler* const dbusHandler) :
- name(entry.at("attribute_name")),
- readOnly(false), displayName(entry.at("display_name")),
- helpText(entry.at("help_text")), dbusHandler(dbusHandler)
+ name(entry.at("attribute_name")), readOnly(false),
+ displayName(entry.at("display_name")), helpText(entry.at("help_text")),
+ dbusHandler(dbusHandler)
{
try
{
diff --git a/libpldmresponder/bios_config.cpp b/libpldmresponder/bios_config.cpp
index 712555d..f58e7de 100644
--- a/libpldmresponder/bios_config.cpp
+++ b/libpldmresponder/bios_config.cpp
@@ -45,8 +45,7 @@
pldm::requester::Handler<pldm::requester::Request>* handler,
pldm::responder::platform_config::Handler* platformConfigHandler,
pldm::responder::bios::Callback requestPLDMServiceName) :
- jsonDir(jsonDir),
- tableDir(tableDir), dbusHandler(dbusHandler), eid(eid),
+ jsonDir(jsonDir), tableDir(tableDir), dbusHandler(dbusHandler), eid(eid),
instanceIdDb(instanceIdDb), handler(handler),
platformConfigHandler(platformConfigHandler),
requestPLDMServiceName(requestPLDMServiceName)
@@ -350,8 +349,8 @@
valueDisplayNames.insert(valueDisplayNames.end(),
vdn.begin(), vdn.end());
}
- auto getValue = [](uint16_t handle,
- const Table& table) -> std::string {
+ auto getValue =
+ [](uint16_t handle, const Table& table) -> std::string {
auto stringEntry = pldm_bios_table_string_find_by_handle(
table.data(), table.size(), handle);
@@ -414,8 +413,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;
@@ -518,8 +517,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;
@@ -571,9 +570,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, dbusTimeout);
std::variant<BaseBIOSTable> varBiosTable{};
@@ -722,10 +721,9 @@
return std::string(buffer.data(), buffer.data() + strLength);
}
-std::string
- BIOSConfig::displayStringHandle(uint16_t handle, uint8_t index,
- const std::optional<Table>& attrTable,
- const std::optional<Table>& stringTable)
+std::string BIOSConfig::displayStringHandle(
+ uint16_t handle, uint8_t index, const std::optional<Table>& attrTable,
+ const std::optional<Table>& stringTable)
{
auto attrEntry = pldm_bios_table_attr_find_by_handle(
attrTable->data(), attrTable->size(), handle);
@@ -905,8 +903,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;
@@ -918,8 +916,8 @@
return rc;
}
- auto destTable = table::attribute_value::updateTable(*attrValueTable, entry,
- size);
+ auto destTable =
+ table::attribute_value::updateTable(*attrValueTable, entry, size);
if (!destTable)
{
@@ -1095,8 +1093,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())
{
@@ -1161,26 +1159,26 @@
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 5812e3b..05f960d 100644
--- a/libpldmresponder/bios_config.hpp
+++ b/libpldmresponder/bios_config.hpp
@@ -232,11 +232,12 @@
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(
std::make_unique<sdbusplus::bus::match_t>(
@@ -244,17 +245,17 @@
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);
+ }
+ }));
}
}
catch (const std::exception& e)
diff --git a/libpldmresponder/bios_enum_attribute.cpp b/libpldmresponder/bios_enum_attribute.cpp
index 5d436c1..2434c79 100644
--- a/libpldmresponder/bios_enum_attribute.cpp
+++ b/libpldmresponder/bios_enum_attribute.cpp
@@ -49,8 +49,9 @@
uint8_t BIOSEnumAttribute::getValueIndex(const std::string& value,
const std::vector<std::string>& pVs)
{
- auto iter = std::find_if(pVs.begin(), pVs.end(),
- [&value](const auto& v) { return v == value; });
+ auto iter = std::find_if(pVs.begin(), pVs.end(), [&value](const auto& v) {
+ return v == value;
+ });
if (iter == pVs.end())
{
throw std::invalid_argument("value must be one of possible value");
@@ -183,8 +184,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;
@@ -205,8 +206,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);
@@ -215,8 +216,8 @@
(uint8_t)possibleValuesHandle.size(), possibleValuesHandle.data(),
(uint8_t)defaultIndices.size(), defaultIndices.data()};
- auto attrTableEntry = table::attribute::constructEnumEntry(attrTable,
- &info);
+ auto attrTableEntry =
+ table::attribute::constructEnumEntry(attrTable, &info);
auto [attrHandle, attrType,
_] = table::attribute::decodeHeader(attrTableEntry);
diff --git a/libpldmresponder/bios_integer_attribute.cpp b/libpldmresponder/bios_integer_attribute.cpp
index 058df1b..fd578a6 100644
--- a/libpldmresponder/bios_integer_attribute.cpp
+++ b/libpldmresponder/bios_integer_attribute.cpp
@@ -112,8 +112,8 @@
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);
@@ -223,8 +223,8 @@
const std::variant<int64_t, std::string>& attributevalue,
Table& attrValueEntry)
{
- attrValueEntry.resize(sizeof(pldm_bios_attr_val_table_entry) +
- sizeof(int64_t) - 1);
+ attrValueEntry.resize(
+ sizeof(pldm_bios_attr_val_table_entry) + sizeof(int64_t) - 1);
auto entry = reinterpret_cast<pldm_bios_attr_val_table_entry*>(
attrValueEntry.data());
diff --git a/libpldmresponder/bios_string_attribute.cpp b/libpldmresponder/bios_string_attribute.cpp
index d55c99a..4b4bf3d 100644
--- a/libpldmresponder/bios_string_attribute.cpp
+++ b/libpldmresponder/bios_string_attribute.cpp
@@ -108,8 +108,8 @@
stringInfo.defString.data(),
};
- auto attrTableEntry = table::attribute::constructStringEntry(attrTable,
- &info);
+ auto attrTableEntry =
+ table::attribute::constructStringEntry(attrTable, &info);
auto [attrHandle, attrType,
_] = table::attribute::decodeHeader(attrTableEntry);
@@ -160,8 +160,8 @@
std::string value = std::get<std::string>(attributevalue);
uint16_t len = value.size();
- attrValueEntry.resize(sizeof(pldm_bios_attr_val_table_entry) +
- sizeof(uint16_t) + len - 1);
+ attrValueEntry.resize(
+ sizeof(pldm_bios_attr_val_table_entry) + sizeof(uint16_t) + len - 1);
auto entry = reinterpret_cast<pldm_bios_attr_val_table_entry*>(
attrValueEntry.data());
diff --git a/libpldmresponder/bios_table.cpp b/libpldmresponder/bios_table.cpp
index d7e3e39..17bb79b 100644
--- a/libpldmresponder/bios_table.cpp
+++ b/libpldmresponder/bios_table.cpp
@@ -106,8 +106,8 @@
buffer.size());
return std::string(buffer.data(), buffer.data() + strLength);
}
-const pldm_bios_string_table_entry* constructEntry(Table& table,
- const std::string& str)
+const pldm_bios_string_table_entry*
+ constructEntry(Table& table, const std::string& str)
{
auto tableSize = table.size();
auto entryLength = pldm_bios_table_string_entry_encode_length(str.length());
@@ -115,8 +115,8 @@
// Preconditions are upheld therefore no error check necessary
pldm_bios_table_string_entry_encode(table.data() + tableSize, entryLength,
str.c_str(), str.length());
- return reinterpret_cast<pldm_bios_string_table_entry*>(table.data() +
- tableSize);
+ return reinterpret_cast<pldm_bios_string_table_entry*>(
+ table.data() + tableSize);
}
} // namespace string
@@ -131,23 +131,22 @@
return {attrHandle, attrType, stringHandle};
}
-const pldm_bios_attr_table_entry* findByHandle(const Table& table,
- uint16_t handle)
+const pldm_bios_attr_table_entry*
+ findByHandle(const Table& table, uint16_t handle)
{
return pldm_bios_table_attr_find_by_handle(table.data(), table.size(),
handle);
}
-const pldm_bios_attr_table_entry* findByStringHandle(const Table& table,
- uint16_t handle)
+const pldm_bios_attr_table_entry*
+ findByStringHandle(const Table& table, uint16_t handle)
{
return pldm_bios_table_attr_find_by_string_handle(table.data(),
table.size(), handle);
}
-const pldm_bios_attr_table_entry*
- constructStringEntry(Table& table,
- pldm_bios_table_attr_entry_string_info* info)
+const pldm_bios_attr_table_entry* constructStringEntry(
+ Table& table, pldm_bios_table_attr_entry_string_info* info)
{
auto entryLength =
pldm_bios_table_attr_entry_string_encode_length(info->def_length);
@@ -162,13 +161,12 @@
"RC", rc);
throw std::runtime_error("Failed to encode BIOS table string entry");
}
- return reinterpret_cast<pldm_bios_attr_table_entry*>(table.data() +
- tableSize);
+ return reinterpret_cast<pldm_bios_attr_table_entry*>(
+ table.data() + tableSize);
}
-const pldm_bios_attr_table_entry*
- constructIntegerEntry(Table& table,
- pldm_bios_table_attr_entry_integer_info* info)
+const pldm_bios_attr_table_entry* constructIntegerEntry(
+ Table& table, pldm_bios_table_attr_entry_integer_info* info)
{
auto entryLength = pldm_bios_table_attr_entry_integer_encode_length();
auto tableSize = table.size();
@@ -183,8 +181,8 @@
throw std::runtime_error(
"Failed to encode BIOS attribute table integer entry");
}
- return reinterpret_cast<pldm_bios_attr_table_entry*>(table.data() +
- tableSize);
+ return reinterpret_cast<pldm_bios_attr_table_entry*>(
+ table.data() + tableSize);
}
StringField decodeStringEntry(const pldm_bios_attr_table_entry* entry)
@@ -233,8 +231,8 @@
pldm_bios_table_attr_entry_enum_encode(table.data() + tableSize,
entryLength, info);
- return reinterpret_cast<pldm_bios_attr_table_entry*>(table.data() +
- tableSize);
+ return reinterpret_cast<pldm_bios_attr_table_entry*>(
+ table.data() + tableSize);
}
EnumField decodeEnumEntry(const pldm_bios_attr_table_entry* entry)
@@ -276,8 +274,8 @@
std::string decodeStringEntry(const pldm_bios_attr_val_table_entry* entry)
{
variable_field currentString{};
- pldm_bios_table_attr_value_entry_string_decode_string(entry,
- ¤tString);
+ pldm_bios_table_attr_value_entry_string_decode_string(
+ entry, ¤tString);
return std::string(currentString.ptr,
currentString.ptr + currentString.length);
}
@@ -297,9 +295,8 @@
return currHdls;
}
-const pldm_bios_attr_val_table_entry*
- constructStringEntry(Table& table, uint16_t attrHandle, uint8_t attrType,
- const std::string& str)
+const pldm_bios_attr_val_table_entry* constructStringEntry(
+ Table& table, uint16_t attrHandle, uint8_t attrType, const std::string& str)
{
auto strLen = str.size();
auto entryLength =
@@ -317,14 +314,12 @@
throw std::runtime_error(
"Failed to encode BIOS attribute table string entry");
}
- return reinterpret_cast<pldm_bios_attr_val_table_entry*>(table.data() +
- tableSize);
+ return reinterpret_cast<pldm_bios_attr_val_table_entry*>(
+ table.data() + tableSize);
}
-const pldm_bios_attr_val_table_entry* constructIntegerEntry(Table& table,
- uint16_t attrHandle,
- uint8_t attrType,
- uint64_t value)
+const pldm_bios_attr_val_table_entry* constructIntegerEntry(
+ Table& table, uint16_t attrHandle, uint8_t attrType, uint64_t value)
{
auto entryLength = pldm_bios_table_attr_value_entry_encode_integer_length();
@@ -340,8 +335,8 @@
throw std::runtime_error(
"Failed to encode BIOS attribute table integery entry");
}
- return reinterpret_cast<pldm_bios_attr_val_table_entry*>(table.data() +
- tableSize);
+ return reinterpret_cast<pldm_bios_attr_val_table_entry*>(
+ table.data() + tableSize);
}
const pldm_bios_attr_val_table_entry*
@@ -363,8 +358,8 @@
throw std::runtime_error(
"Failed to encode BIOS attribute table enum entry");
}
- return reinterpret_cast<pldm_bios_attr_val_table_entry*>(table.data() +
- tableSize);
+ return reinterpret_cast<pldm_bios_attr_val_table_entry*>(
+ table.data() + tableSize);
}
std::optional<Table> updateTable(const Table& table, const void* entry,
diff --git a/libpldmresponder/bios_table.hpp b/libpldmresponder/bios_table.hpp
index 5959c7c..8b5f8bc 100644
--- a/libpldmresponder/bios_table.hpp
+++ b/libpldmresponder/bios_table.hpp
@@ -164,8 +164,8 @@
* @param[in] str - string itself
* @return pointer to the constructed entry
*/
-const pldm_bios_string_table_entry* constructEntry(Table& table,
- const std::string& str);
+const pldm_bios_string_table_entry*
+ constructEntry(Table& table, const std::string& str);
} // namespace string
@@ -193,16 +193,16 @@
* @param[in] handle - attribute handle
* @return Pointer to the attribute table entry
*/
-const pldm_bios_attr_table_entry* findByHandle(const Table& table,
- uint16_t handle);
+const pldm_bios_attr_table_entry*
+ findByHandle(const Table& table, uint16_t handle);
/** @brief Find attribute entry by string handle
* @param[in] table - attribute table
* @param[in] handle - string handle
* @return Pointer to the attribute table entry
*/
-const pldm_bios_attr_table_entry* findByStringHandle(const Table& table,
- uint16_t handle);
+const pldm_bios_attr_table_entry*
+ findByStringHandle(const Table& table, uint16_t handle);
/** @struct StringField
* @brief String field of attribute table
@@ -228,9 +228,8 @@
* @param[in] info - string info
* @return pointer to the constructed entry
*/
-const pldm_bios_attr_table_entry*
- constructStringEntry(Table& table,
- pldm_bios_table_attr_entry_string_info* info);
+const pldm_bios_attr_table_entry* constructStringEntry(
+ Table& table, pldm_bios_table_attr_entry_string_info* info);
/** @struct IntegerField
* @brief Integer field of attribute table
@@ -249,9 +248,8 @@
* @param[in] info - integer info
* @return pointer to the constructed entry
*/
-const pldm_bios_attr_table_entry*
- constructIntegerEntry(Table& table,
- pldm_bios_table_attr_entry_integer_info* info);
+const pldm_bios_attr_table_entry* constructIntegerEntry(
+ Table& table, pldm_bios_table_attr_entry_integer_info* info);
/** @brief decode integer entry of attribute table
* @param[in] entry - Pointer to an attribute table entry
@@ -280,9 +278,8 @@
* @param[in] info - enum info
* @return pointer to the constructed entry
*/
-const pldm_bios_attr_table_entry*
- constructEnumEntry(Table& table,
- pldm_bios_table_attr_entry_enum_info* info);
+const pldm_bios_attr_table_entry* constructEnumEntry(
+ Table& table, pldm_bios_table_attr_entry_enum_info* info);
} // namespace attribute
@@ -343,10 +340,8 @@
* @param[in] value - The integer
* @return Pointer to the constructed entry
*/
-const pldm_bios_attr_val_table_entry* constructIntegerEntry(Table& table,
- uint16_t attrHandle,
- uint8_t attrType,
- uint64_t value);
+const pldm_bios_attr_val_table_entry* constructIntegerEntry(
+ Table& table, uint16_t attrHandle, uint8_t attrType, uint64_t value);
/** @brief Construct enum entry of attribute value table at the end of
* the given table
diff --git a/libpldmresponder/fru.cpp b/libpldmresponder/fru.cpp
index a126a62..5a7368e 100644
--- a/libpldmresponder/fru.cpp
+++ b/libpldmresponder/fru.cpp
@@ -105,8 +105,8 @@
pldm_entity node = pldm_entity_extract(it.second);
if (node.entity_type == entity.entity_type)
{
- entity.entity_instance_num = node.entity_instance_num +
- 1;
+ entity.entity_instance_num =
+ node.entity_instance_num + 1;
break;
}
}
@@ -230,9 +230,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, dbusTimeout);
@@ -385,10 +385,9 @@
}
}
-int FruImpl::getFRURecordByOption(std::vector<uint8_t>& fruData,
- uint16_t /* fruTableHandle */,
- uint16_t recordSetIdentifer,
- uint8_t recordType, uint8_t fieldType)
+int FruImpl::getFRURecordByOption(
+ std::vector<uint8_t>& fruData, uint16_t /* fruTableHandle */,
+ uint16_t recordSetIdentifer, uint8_t recordType, uint8_t fieldType)
{
using sum = uint32_t;
@@ -487,9 +486,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);
@@ -534,8 +533,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());
@@ -573,8 +572,8 @@
return ccOnlyResponse(request, rc);
}
- Response response(sizeof(pldm_msg_hdr) +
- PLDM_SET_FRU_RECORD_TABLE_RESP_BYTES);
+ Response response(
+ sizeof(pldm_msg_hdr) + PLDM_SET_FRU_RECORD_TABLE_RESP_BYTES);
struct pldm_msg* responsePtr = reinterpret_cast<pldm_msg*>(response.data());
rc = encode_set_fru_record_table_resp(
diff --git a/libpldmresponder/fru.hpp b/libpldmresponder/fru.hpp
index a0757e6..af55f92 100644
--- a/libpldmresponder/fru.hpp
+++ b/libpldmresponder/fru.hpp
@@ -67,8 +67,8 @@
const std::filesystem::path& fruMasterJsonPath, pldm_pdr* pdrRepo,
pldm_entity_association_tree* entityTree,
pldm_entity_association_tree* bmcEntityTree) :
- parser(configPath, fruMasterJsonPath),
- pdrRepo(pdrRepo), entityTree(entityTree), bmcEntityTree(bmcEntityTree)
+ parser(configPath, fruMasterJsonPath), pdrRepo(pdrRepo),
+ entityTree(entityTree), bmcEntityTree(bmcEntityTree)
{}
/** @brief Total length of the FRU table in bytes, this includes the pad
@@ -268,23 +268,23 @@
handlers.emplace(
PLDM_GET_FRU_RECORD_TABLE_METADATA,
[this](pldm_tid_t, 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](pldm_tid_t, 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](pldm_tid_t, const pldm_msg* request, size_t payloadLength) {
- return this->getFRURecordByOption(request, payloadLength);
- });
+ return this->getFRURecordByOption(request, payloadLength);
+ });
handlers.emplace(
PLDM_SET_FRU_RECORD_TABLE,
[this](pldm_tid_t, const pldm_msg* request, size_t payloadLength) {
- return this->setFRURecordTable(request, payloadLength);
- });
+ return this->setFRURecordTable(request, payloadLength);
+ });
}
/** @brief Handler for Get FRURecordTableMetadata
diff --git a/libpldmresponder/fru_parser.cpp b/libpldmresponder/fru_parser.cpp
index c5ea3ea..bc04f56 100644
--- a/libpldmresponder/fru_parser.cpp
+++ b/libpldmresponder/fru_parser.cpp
@@ -147,8 +147,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/pdr.cpp b/libpldmresponder/pdr.cpp
index aa05303..9a149f7 100644
--- a/libpldmresponder/pdr.cpp
+++ b/libpldmresponder/pdr.cpp
@@ -33,14 +33,13 @@
}
}
-const pldm_pdr_record* getRecordByHandle(const RepoInterface& pdrRepo,
- RecordHandle recordHandle,
- PdrEntry& pdrEntry)
+const pldm_pdr_record* getRecordByHandle(
+ const RepoInterface& pdrRepo, RecordHandle recordHandle, 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 a425da3..362b10d 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);
@@ -99,15 +99,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)
{
@@ -139,8 +139,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)
{
@@ -208,8 +208,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 42af4ad..d431b0b 100644
--- a/libpldmresponder/pdr_state_effecter.hpp
+++ b/libpldmresponder/pdr_state_effecter.hpp
@@ -111,8 +111,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);
@@ -146,8 +146,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 58236da..03bac20 100644
--- a/libpldmresponder/pdr_state_sensor.hpp
+++ b/libpldmresponder/pdr_state_sensor.hpp
@@ -122,8 +122,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);
@@ -157,8 +157,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 c15e282..7d87c67 100644
--- a/libpldmresponder/pdr_utils.cpp
+++ b/libpldmresponder/pdr_utils.cpp
@@ -48,9 +48,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;
@@ -63,9 +63,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;
@@ -209,8 +209,8 @@
std::move(sensorInfo));
}
-std::vector<FruRecordDataFormat> parseFruRecordTable(const uint8_t* fruData,
- size_t fruLen)
+std::vector<FruRecordDataFormat>
+ parseFruRecordTable(const uint8_t* fruData, size_t fruLen)
{
// Refer: DSP0257_1.0.0 Table 2
// 7: uint16_t(FRU Record Set Identifier), uint8_t(FRU Record Type),
@@ -239,23 +239,24 @@
index += 5;
- std::ranges::for_each(std::views::iota(0, (int)record->num_fru_fields),
- [fruData, &fru, &index](int) {
- auto tlv =
- reinterpret_cast<const pldm_fru_record_tlv*>(fruData + index);
- FruTLV frutlv;
- frutlv.fruFieldType = tlv->type;
- frutlv.fruFieldLen = tlv->length;
- frutlv.fruFieldValue.resize(tlv->length);
- for (const auto& i : std::views::iota(0, (int)tlv->length))
- {
- memcpy(frutlv.fruFieldValue.data() + i, tlv->value + i, 1);
- }
- fru.fruTLV.push_back(frutlv);
+ std::ranges::for_each(
+ std::views::iota(0, (int)record->num_fru_fields),
+ [fruData, &fru, &index](int) {
+ auto tlv = reinterpret_cast<const pldm_fru_record_tlv*>(
+ fruData + index);
+ FruTLV frutlv;
+ frutlv.fruFieldType = tlv->type;
+ frutlv.fruFieldLen = tlv->length;
+ frutlv.fruFieldValue.resize(tlv->length);
+ for (const auto& i : std::views::iota(0, (int)tlv->length))
+ {
+ memcpy(frutlv.fruFieldValue.data() + i, tlv->value + i, 1);
+ }
+ fru.fruTLV.push_back(frutlv);
- // 2: 1byte FRU Field Type, 1byte FRU Field Length
- index += fruFieldTypeLength + (unsigned)tlv->length;
- });
+ // 2: 1byte FRU Field Type, 1byte FRU Field Length
+ index += fruFieldTypeLength + (unsigned)tlv->length;
+ });
frus.push_back(fru);
}
diff --git a/libpldmresponder/pdr_utils.hpp b/libpldmresponder/pdr_utils.hpp
index 01fe223..a5374aa 100644
--- a/libpldmresponder/pdr_utils.hpp
+++ b/libpldmresponder/pdr_utils.hpp
@@ -161,9 +161,8 @@
* @return opaque pointer acting as PDR record handle, will be NULL if
* record was not found
*/
- virtual const pldm_pdr_record*
- getNextRecord(const pldm_pdr_record* currRecord,
- PdrEntry& pdrEntry) = 0;
+ virtual const pldm_pdr_record* getNextRecord(
+ const pldm_pdr_record* currRecord, PdrEntry& pdrEntry) = 0;
/** @brief Get record handle of a PDR record
*
@@ -239,8 +238,8 @@
* @return std::vector<FruRecordDataFormat> - the vector of the FRU record data
* format structure
*/
-std::vector<FruRecordDataFormat> parseFruRecordTable(const uint8_t* fruData,
- size_t fruLen);
+std::vector<FruRecordDataFormat>
+ parseFruRecordTable(const uint8_t* fruData, size_t fruLen);
/** @brief Return the size of data type based on the effecterDataSize enum value
*
diff --git a/libpldmresponder/platform.cpp b/libpldmresponder/platform.cpp
index 1e0955a..522899c 100644
--- a/libpldmresponder/platform.cpp
+++ b/libpldmresponder/platform.cpp
@@ -87,22 +87,23 @@
{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);
- }},
+ 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);
- }},
+ 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,
- Handler>(dBusIntf, json, *this,
- repo);
- }}};
+ pdr_state_sensor::generateStateSensorPDR<pldm::utils::DBusHandler,
+ Handler>(dBusIntf, json,
+ *this, repo);
+ }}};
Type pdrType{};
for (const auto& directory : dir)
@@ -120,16 +121,16 @@
for (const auto& effecter : effecterPDRs)
{
pdrType = effecter.value("pdrType", 0);
- generateHandlers.at(pdrType)(dBusIntf, effecter,
- repo);
+ generateHandlers.at(
+ pdrType)(dBusIntf, effecter, repo);
}
auto sensorPDRs = json.value("sensorPDRs", empty);
for (const auto& sensor : sensorPDRs)
{
pdrType = sensor.value("pdrType", 0);
- generateHandlers.at(pdrType)(dBusIntf, sensor,
- repo);
+ generateHandlers.at(
+ pdrType)(dBusIntf, sensor, repo);
}
}
}
@@ -296,9 +297,9 @@
return CmdHandler::ccOnlyResponse(request, PLDM_ERROR_INVALID_LENGTH);
}
- int rc = decode_set_state_effecter_states_req(request, payloadLength,
- &effecterId, &compEffecterCnt,
- stateField.data());
+ int rc = decode_set_state_effecter_states_req(
+ request, payloadLength, &effecterId, &compEffecterCnt,
+ stateField.data());
if (rc != PLDM_SUCCESS)
{
@@ -378,8 +379,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);
@@ -414,8 +415,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,
@@ -427,8 +428,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)
{
@@ -496,12 +497,13 @@
}
const auto& [containerId, entityType, entityInstance] = entityInfo;
- events::StateSensorEntry stateSensorEntry{containerId,
- entityType,
- entityInstance,
- sensorOffset,
- stateSetIds[sensorOffset],
- false};
+ events::StateSensorEntry stateSensorEntry{
+ containerId,
+ entityType,
+ entityInstance,
+ sensorOffset,
+ stateSetIds[sensorOffset],
+ false};
return hostPDRHandler->handleStateSensorEvent(stateSensorEntry,
eventState);
}
@@ -513,17 +515,16 @@
return PLDM_SUCCESS;
}
-int Handler::pldmPDRRepositoryChgEvent(const pldm_msg* request,
- size_t payloadLength,
- uint8_t /*formatVersion*/, uint8_t tid,
- size_t eventDataOffset)
+int Handler::pldmPDRRepositoryChgEvent(
+ const pldm_msg* request, size_t payloadLength, uint8_t /*formatVersion*/,
+ uint8_t tid, size_t eventDataOffset)
{
uint8_t eventDataFormat{};
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(
@@ -569,8 +570,8 @@
}
rc = getPDRRecordHandles(
- reinterpret_cast<const ChangeEntry*>(changeRecordData +
- dataOffset),
+ reinterpret_cast<const ChangeEntry*>(
+ changeRecordData + dataOffset),
changeRecordDataSize - dataOffset,
static_cast<size_t>(numberOfChangeEntries),
pdrRecordHandles);
@@ -581,8 +582,8 @@
}
}
- changeRecordData += dataOffset +
- (numberOfChangeEntries * sizeof(ChangeEntry));
+ changeRecordData +=
+ dataOffset + (numberOfChangeEntries * sizeof(ChangeEntry));
changeRecordDataSize -=
dataOffset + (numberOfChangeEntries * sizeof(ChangeEntry));
}
@@ -618,10 +619,9 @@
return PLDM_SUCCESS;
}
-int Handler::getPDRRecordHandles(const ChangeEntry* changeEntryData,
- size_t changeEntryDataSize,
- size_t numberOfChangeEntries,
- PDRRecordHandles& pdrRecordHandles)
+int Handler::getPDRRecordHandles(
+ const ChangeEntry* changeEntryData, size_t changeEntryDataSize,
+ size_t numberOfChangeEntries, PDRRecordHandles& pdrRecordHandles)
{
if (numberOfChangeEntries > (changeEntryDataSize / sizeof(ChangeEntry)))
{
@@ -672,11 +672,11 @@
// PresentValue (uint8|sint8|uint16|sint16|uint32|sint32 )
// Size of PendingValue and PresentValue calculated based on size is
// provided in effecter data size
- size_t responsePayloadLength = sizeof(completionCode) +
- sizeof(effecterDataSize) +
- sizeof(effecterOperationalState) +
- getEffecterDataSize(effecterDataSize) +
- getEffecterDataSize(effecterDataSize);
+ size_t responsePayloadLength =
+ sizeof(completionCode) + sizeof(effecterDataSize) +
+ sizeof(effecterOperationalState) +
+ getEffecterDataSize(effecterDataSize) +
+ getEffecterDataSize(effecterDataSize);
Response response(responsePayloadLength + sizeof(pldm_msg_hdr));
auto responsePtr = reinterpret_cast<pldm_msg*>(response.data());
@@ -698,8 +698,8 @@
Response Handler::setNumericEffecterValue(const pldm_msg* request,
size_t payloadLength)
{
- Response response(sizeof(pldm_msg_hdr) +
- PLDM_SET_NUMERIC_EFFECTER_VALUE_RESP_BYTES);
+ Response response(
+ sizeof(pldm_msg_hdr) + PLDM_SET_NUMERIC_EFFECTER_VALUE_RESP_BYTES);
uint16_t effecterId{};
uint8_t effecterDataSize{};
uint8_t effecterValue[4] = {};
@@ -718,9 +718,9 @@
{
const pldm::utils::DBusHandler dBusIntf;
rc = platform_numeric_effecter::setNumericEffecterValueHandler<
- pldm::utils::DBusHandler, Handler>(dBusIntf, *this, effecterId,
- effecterDataSize, effecterValue,
- sizeof(effecterValue));
+ pldm::utils::DBusHandler, Handler>(
+ dBusIntf, *this, effecterId, effecterDataSize, effecterValue,
+ sizeof(effecterValue));
}
return ccOnlyResponse(request, rc);
@@ -810,13 +810,13 @@
return ccOnlyResponse(request, rc);
}
- Response response(sizeof(pldm_msg_hdr) +
- PLDM_GET_STATE_SENSOR_READINGS_MIN_RESP_BYTES +
- sizeof(get_sensor_state_field) * comSensorCnt);
+ Response response(
+ sizeof(pldm_msg_hdr) + PLDM_GET_STATE_SENSOR_READINGS_MIN_RESP_BYTES +
+ sizeof(get_sensor_state_field) * comSensorCnt);
auto responsePtr = reinterpret_cast<pldm_msg*>(response.data());
- rc = encode_get_state_sensor_readings_resp(request->hdr.instance_id, rc,
- comSensorCnt, stateField.data(),
- responsePtr);
+ rc = encode_get_state_sensor_readings_resp(
+ request->hdr.instance_id, rc, comSensorCnt, stateField.data(),
+ responsePtr);
if (rc != PLDM_SUCCESS)
{
return ccOnlyResponse(request, rc);
@@ -973,8 +973,8 @@
void Handler::setEventReceiver()
{
- std::vector<uint8_t> requestMsg(sizeof(pldm_msg_hdr) +
- PLDM_SET_EVENT_RECEIVER_REQ_BYTES);
+ std::vector<uint8_t> requestMsg(
+ sizeof(pldm_msg_hdr) + PLDM_SET_EVENT_RECEIVER_REQ_BYTES);
auto request = reinterpret_cast<pldm_msg*>(requestMsg.data());
auto instanceId = instanceIdDb->next(eid);
uint8_t eventMessageGlobalEnable =
@@ -995,8 +995,9 @@
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/platform.hpp b/libpldmresponder/platform.hpp
index e43058e..47c9ecf 100644
--- a/libpldmresponder/platform.hpp
+++ b/libpldmresponder/platform.hpp
@@ -28,9 +28,9 @@
{
namespace platform
{
-using generatePDR = std::function<void(const pldm::utils::DBusHandler& dBusIntf,
- const pldm::utils::Json& json,
- pdr_utils::RepoInterface& repo)>;
+using generatePDR = std::function<void(
+ const pldm::utils::DBusHandler& dBusIntf, const pldm::utils::Json& json,
+ pdr_utils::RepoInterface& repo)>;
using EffecterId = uint16_t;
using DbusObjMaps =
@@ -58,8 +58,7 @@
pldm::requester::Handler<pldm::requester::Request>* handler,
sdeventplus::Event& event, bool buildPDRLazily = false,
const std::optional<EventMap>& addOnHandlersMap = std::nullopt) :
- eid(eid),
- instanceIdDb(instanceIdDb), pdrRepo(repo),
+ eid(eid), instanceIdDb(instanceIdDb), pdrRepo(repo),
hostPDRHandler(hostPDRHandler),
dbusToPLDMEventHandler(dbusToPLDMEventHandler), fruHandler(fruHandler),
dBusIntf(dBusIntf), platformConfigHandler(platformConfigHandler),
@@ -76,47 +75,48 @@
handlers.emplace(
PLDM_GET_PDR,
[this](pldm_tid_t, 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](pldm_tid_t, const pldm_msg* request, size_t payloadLength) {
- return this->setNumericEffecterValue(request, payloadLength);
- });
+ return this->setNumericEffecterValue(request, payloadLength);
+ });
handlers.emplace(
PLDM_GET_NUMERIC_EFFECTER_VALUE,
[this](pldm_tid_t, const pldm_msg* request, size_t payloadLength) {
- return this->getNumericEffecterValue(request, payloadLength);
- });
+ return this->getNumericEffecterValue(request, payloadLength);
+ });
handlers.emplace(
PLDM_SET_STATE_EFFECTER_STATES,
[this](pldm_tid_t, const pldm_msg* request, size_t payloadLength) {
- return this->setStateEffecterStates(request, payloadLength);
- });
+ return this->setStateEffecterStates(request, payloadLength);
+ });
handlers.emplace(
PLDM_PLATFORM_EVENT_MESSAGE,
[this](pldm_tid_t, 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](pldm_tid_t, 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
@@ -359,8 +359,8 @@
if (pdr->effecter_id != effecterId)
{
pdr = nullptr;
- pdrRecord = stateEffecterPDRs.getNextRecord(pdrRecord,
- pdrEntry);
+ pdrRecord =
+ stateEffecterPDRs.getNextRecord(pdrRecord, pdrEntry);
continue;
}
@@ -385,15 +385,15 @@
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 bitfieldIndex =
+ stateField[currState].effecter_state / 8;
uint8_t bit = stateField[currState].effecter_state -
(8 * bitfieldIndex);
if (states->possible_states_size < bitfieldIndex ||
diff --git a/libpldmresponder/platform_config.cpp b/libpldmresponder/platform_config.cpp
index 8d7fe79..8f181f1 100644
--- a/libpldmresponder/platform_config.cpp
+++ b/libpldmresponder/platform_config.cpp
@@ -41,8 +41,8 @@
if (!names.empty())
{
- std::optional<std::string> sysType = getSysSpecificJsonDir(sysDirPath,
- names);
+ std::optional<std::string> sysType =
+ getSysSpecificJsonDir(sysDirPath, names);
if (sysType.has_value())
{
systemType = sysType.value();
@@ -136,9 +136,8 @@
return std::nullopt;
}
-std::optional<std::string>
- Handler::getSysSpecificJsonDir(const fs::path& dirPath,
- const std::vector<std::string>& dirNames)
+std::optional<std::string> Handler::getSysSpecificJsonDir(
+ const fs::path& dirPath, const std::vector<std::string>& dirNames)
{
// The current setup assumes that the BIOS and PDR configurations always
// come from the same system type. If, in the future, we need to use BIOS
diff --git a/libpldmresponder/platform_config.hpp b/libpldmresponder/platform_config.hpp
index 578751b..770a2df 100644
--- a/libpldmresponder/platform_config.hpp
+++ b/libpldmresponder/platform_config.hpp
@@ -53,9 +53,8 @@
* @param[in] dirNames - System names retrieved from remote application
* @return - The system type information
*/
- std::optional<std::string>
- getSysSpecificJsonDir(const fs::path& dirPath,
- const std::vector<std::string>& dirNames);
+ std::optional<std::string> getSysSpecificJsonDir(
+ const fs::path& dirPath, const std::vector<std::string>& dirNames);
/** @brief system type/model */
std::string systemType;
diff --git a/libpldmresponder/platform_numeric_effecter.hpp b/libpldmresponder/platform_numeric_effecter.hpp
index 86f72c9..afb24fe 100644
--- a/libpldmresponder/platform_numeric_effecter.hpp
+++ b/libpldmresponder/platform_numeric_effecter.hpp
@@ -184,10 +184,9 @@
* @return std::pair<int, std::optional<PropertyValue>> - rc:Success or
* failure, PropertyValue: The value to be set
*/
-std::pair<int, std::optional<pldm::utils::PropertyValue>>
- convertToDbusValue(const pldm_numeric_effecter_value_pdr* pdr,
- uint8_t effecterDataSize, uint8_t* effecterValue,
- std::string propertyType)
+std::pair<int, std::optional<pldm::utils::PropertyValue>> convertToDbusValue(
+ const pldm_numeric_effecter_value_pdr* pdr, uint8_t effecterDataSize,
+ uint8_t* effecterValue, std::string propertyType)
{
if (effecterDataSize == PLDM_EFFECTER_DATA_SIZE_UINT8)
{
@@ -245,11 +244,10 @@
* terms of PLDM completion codes if at least one state fails to be set
*/
template <class DBusInterface, class Handler>
-int setNumericEffecterValueHandler(const DBusInterface& dBusIntf,
- Handler& handler, uint16_t effecterId,
- uint8_t effecterDataSize,
- uint8_t* effecterValue,
- size_t effecterValueLength)
+int setNumericEffecterValueHandler(
+ const DBusInterface& dBusIntf, Handler& handler, uint16_t effecterId,
+ uint8_t effecterDataSize, uint8_t* effecterValue,
+ size_t effecterValueLength)
{
constexpr auto effecterValueArrayLength = 4;
pldm_numeric_effecter_value_pdr* pdr = nullptr;
@@ -302,8 +300,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};
@@ -432,12 +430,10 @@
*
* @return PLDM_SUCCESS/PLDM_ERROR
*/
-int getNumericEffecterValueHandler(const std::string& propertyType,
- pldm::utils::PropertyValue propertyValue,
- uint8_t effecterDataSize,
- pldm_msg* responsePtr,
- size_t responsePayloadLength,
- uint8_t instanceId)
+int getNumericEffecterValueHandler(
+ const std::string& propertyType, pldm::utils::PropertyValue propertyValue,
+ uint8_t effecterDataSize, pldm_msg* responsePtr,
+ size_t responsePayloadLength, uint8_t instanceId)
{
if (propertyType == "uint8_t")
{
@@ -537,8 +533,8 @@
pldm::utils::DBusMapping dbusMapping{};
try
{
- const auto& [dbusMappings,
- dbusValMaps] = handler.getDbusObjMaps(effecterId);
+ const auto& [dbusMappings, dbusValMaps] =
+ handler.getDbusObjMaps(effecterId);
if (dbusMappings.size() > 0)
{
dbusMapping = {
diff --git a/libpldmresponder/platform_state_effecter.hpp b/libpldmresponder/platform_state_effecter.hpp
index 106cbc1..c6f7432 100644
--- a/libpldmresponder/platform_state_effecter.hpp
+++ b/libpldmresponder/platform_state_effecter.hpp
@@ -97,8 +97,8 @@
int rc = PLDM_SUCCESS;
try
{
- const auto& [dbusMappings,
- dbusValMaps] = handler.getDbusObjMaps(effecterId);
+ const auto& [dbusMappings, dbusValMaps] =
+ handler.getDbusObjMaps(effecterId);
if (dbusMappings.empty() || dbusValMaps.empty())
{
error("DbusMappings for effecter ID '{EFFECTER_ID}' is missing",
diff --git a/libpldmresponder/test/libpldmresponder_base_test.cpp b/libpldmresponder/test/libpldmresponder_base_test.cpp
index 0387209..4656882 100644
--- a/libpldmresponder/test/libpldmresponder_base_test.cpp
+++ b/libpldmresponder/test/libpldmresponder_base_test.cpp
@@ -82,8 +82,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);
@@ -113,8 +113,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 ea29015..9b4f74e 100644
--- a/libpldmresponder/test/libpldmresponder_bios_config_test.cpp
+++ b/libpldmresponder/test/libpldmresponder_bios_config_test.cpp
@@ -98,25 +98,26 @@
EXPECT_TRUE(attrTable);
EXPECT_TRUE(attrValueTable);
- std::set<std::string> expectedStrings = {"HMCManagedState",
- "On",
- "Off",
- "FWBootSide",
- "Perm",
- "Temp",
- "InbandCodeUpdate",
- "Allowed",
- "Allowed",
- "NotAllowed",
- "CodeUpdatePolicy",
- "Concurrent",
- "Disruptive",
- "VDD_AVSBUS_RAIL",
- "SBE_IMAGE_MINIMUM_VALID_ECS",
- "INTEGER_INVALID_CASE",
- "str_example1",
- "str_example2",
- "str_example3"};
+ std::set<std::string> expectedStrings = {
+ "HMCManagedState",
+ "On",
+ "Off",
+ "FWBootSide",
+ "Perm",
+ "Temp",
+ "InbandCodeUpdate",
+ "Allowed",
+ "Allowed",
+ "NotAllowed",
+ "CodeUpdatePolicy",
+ "Concurrent",
+ "Disruptive",
+ "VDD_AVSBUS_RAIL",
+ "SBE_IMAGE_MINIMUM_VALID_ECS",
+ "INTEGER_INVALID_CASE",
+ "str_example1",
+ "str_example2",
+ "str_example3"};
std::set<std::string> strings;
for (auto entry : BIOSTableIter<PLDM_BIOS_STRING_TABLE>(
stringTable->data(), stringTable->size()))
@@ -206,8 +207,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);
@@ -368,9 +369,8 @@
EXPECT_EQ(rc, PLDM_SUCCESS);
auto attrValueTable = biosConfig.getBIOSTable(PLDM_BIOS_ATTR_VAL_TABLE);
- auto findEntry =
- [&attrValueTable](
- uint16_t handle) -> const pldm_bios_attr_val_table_entry* {
+ auto findEntry = [&attrValueTable](uint16_t handle)
+ -> const pldm_bios_attr_val_table_entry* {
for (auto entry : BIOSTableIter<PLDM_BIOS_ATTR_VAL_TABLE>(
attrValueTable->data(), attrValueTable->size()))
{
diff --git a/libpldmresponder/test/libpldmresponder_fru_test.cpp b/libpldmresponder/test/libpldmresponder_fru_test.cpp
index d654fca..f4a1202 100644
--- a/libpldmresponder/test/libpldmresponder_fru_test.cpp
+++ b/libpldmresponder/test/libpldmresponder_fru_test.cpp
@@ -134,8 +134,8 @@
mockedFruHandler.updateAssociationTree(
objects, "/xyz/openbmc_project/inventory/system/chassis/motherboard");
- pldm_entity_node* node = pldm_entity_association_tree_find(entityTree.get(),
- &systemEntity);
+ pldm_entity_node* node =
+ pldm_entity_association_tree_find(entityTree.get(), &systemEntity);
EXPECT_TRUE(node != NULL);
node = pldm_entity_association_tree_find(entityTree.get(), &chassisEntity);
@@ -143,8 +143,8 @@
test_pldm_entity_node* test_node = (test_pldm_entity_node*)node;
EXPECT_TRUE((test_node->parent).entity_type == systemEntity.entity_type);
- node = pldm_entity_association_tree_find(entityTree.get(),
- &motherboardEntity);
+ node =
+ pldm_entity_association_tree_find(entityTree.get(), &motherboardEntity);
ASSERT_TRUE(node != NULL);
test_node = (test_pldm_entity_node*)node;
EXPECT_TRUE((test_node->parent).entity_type == chassisEntity.entity_type);
diff --git a/libpldmresponder/test/libpldmresponder_pdr_effecter_test.cpp b/libpldmresponder/test/libpldmresponder_pdr_effecter_test.cpp
index 6ef74b7..87ee867 100644
--- a/libpldmresponder/test/libpldmresponder_pdr_effecter_test.cpp
+++ b/libpldmresponder/test/libpldmresponder_pdr_effecter_test.cpp
@@ -69,8 +69,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
@@ -109,8 +109,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");
@@ -157,8 +157,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 63e26e2..d3606f5 100644
--- a/libpldmresponder/test/libpldmresponder_platform_test.cpp
+++ b/libpldmresponder/test/libpldmresponder_platform_test.cpp
@@ -307,15 +307,13 @@
MockdBusHandler, Handler>(mockedUtils, handler, 0x1, stateField);
ASSERT_EQ(rc, PLDM_PLATFORM_SET_EFFECTER_UNSUPPORTED_SENSORSTATE);
- rc = platform_state_effecter::setStateEffecterStatesHandler<MockdBusHandler,
- Handler>(
- mockedUtils, handler, 0x9, stateField);
+ rc = platform_state_effecter::setStateEffecterStatesHandler<
+ MockdBusHandler, Handler>(mockedUtils, handler, 0x9, stateField);
ASSERT_EQ(rc, PLDM_PLATFORM_INVALID_EFFECTER_ID);
stateField.push_back({PLDM_REQUEST_SET, 4});
- rc = platform_state_effecter::setStateEffecterStatesHandler<MockdBusHandler,
- Handler>(
- mockedUtils, handler, 0x1, stateField);
+ rc = platform_state_effecter::setStateEffecterStatesHandler<
+ MockdBusHandler, Handler>(mockedUtils, handler, 0x1, stateField);
ASSERT_EQ(rc, PLDM_ERROR_INVALID_DATA);
pldm_pdr_destroy(inPDRRepo);
@@ -444,18 +442,17 @@
StrEq("xyz.openbmc_project.Foo.Bar")))
.WillOnce(Return(PropertyValue(static_cast<uint64_t>(effecterValue))));
- auto rc = platform_numeric_effecter::getNumericEffecterData<MockdBusHandler,
- Handler>(
- mockedUtils, handler, effecterId, effecterDataSize, propertyType,
- dbusValue);
+ auto rc = platform_numeric_effecter::getNumericEffecterData<
+ MockdBusHandler, Handler>(mockedUtils, handler, effecterId,
+ effecterDataSize, propertyType, dbusValue);
ASSERT_EQ(rc, 0);
- size_t responsePayloadLength = sizeof(completionCode) +
- sizeof(effecterDataSize) +
- sizeof(effecterOperationalState) +
- getEffecterDataSize(effecterDataSize) +
- getEffecterDataSize(effecterDataSize);
+ size_t responsePayloadLength =
+ sizeof(completionCode) + sizeof(effecterDataSize) +
+ sizeof(effecterOperationalState) +
+ getEffecterDataSize(effecterDataSize) +
+ getEffecterDataSize(effecterDataSize);
Response response(responsePayloadLength + sizeof(pldm_msg_hdr));
auto responsePtr = reinterpret_cast<pldm_msg*>(response.data());
@@ -511,10 +508,9 @@
pldm::utils::PropertyValue dbusValue;
std::string propertyType;
- auto rc = platform_numeric_effecter::getNumericEffecterData<MockdBusHandler,
- Handler>(
- mockedUtils, handler, effecterId, effecterDataSize, propertyType,
- dbusValue);
+ auto rc = platform_numeric_effecter::getNumericEffecterData<
+ MockdBusHandler, Handler>(mockedUtils, handler, effecterId,
+ effecterDataSize, propertyType, dbusValue);
ASSERT_EQ(rc, 128);
@@ -526,15 +522,15 @@
{
// Sample state sensor with SensorID - 1, EntityType - Processor Module(67)
// State Set ID - Operational Running Status(11), Supported States - 3,4
- std::vector<uint8_t> sample1PDR{0x00, 0x00, 0x00, 0x00, 0x01, 0x04, 0x00,
- 0x00, 0x17, 0x00, 0x00, 0x00, 0x01, 0x00,
- 0x43, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x01, 0x0b, 0x00, 0x01, 0x18};
+ std::vector<uint8_t> sample1PDR{
+ 0x00, 0x00, 0x00, 0x00, 0x01, 0x04, 0x00, 0x00, 0x17,
+ 0x00, 0x00, 0x00, 0x01, 0x00, 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}};
@@ -547,15 +543,15 @@
// Sample state sensor with SensorID - 2, EntityType - System Firmware(31)
// State Set ID - Availability(2), Supported States - 3,4,9,10,11,13
- std::vector<uint8_t> sample2PDR{0x00, 0x00, 0x00, 0x00, 0x01, 0x04, 0x00,
- 0x00, 0x17, 0x00, 0x00, 0x00, 0x02, 0x00,
- 0x1F, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x01, 0x02, 0x00, 0x02, 0x18, 0x2E};
+ std::vector<uint8_t> sample2PDR{
+ 0x00, 0x00, 0x00, 0x00, 0x01, 0x04, 0x00, 0x00, 0x17, 0x00,
+ 0x00, 0x00, 0x02, 0x00, 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}};
@@ -575,10 +571,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/libpldmresponder_systemspecific_bios_test.cpp b/libpldmresponder/test/libpldmresponder_systemspecific_bios_test.cpp
index 0c7cc8c..9b7fe8a 100644
--- a/libpldmresponder/test/libpldmresponder_systemspecific_bios_test.cpp
+++ b/libpldmresponder/test/libpldmresponder_systemspecific_bios_test.cpp
@@ -105,25 +105,26 @@
EXPECT_TRUE(attrTable);
EXPECT_TRUE(attrValueTable);
- std::set<std::string> expectedStrings = {"HMCManagedState",
- "On",
- "Off",
- "FWBootSide",
- "Perm",
- "Temp",
- "InbandCodeUpdate",
- "Allowed",
- "Allowed",
- "NotAllowed",
- "CodeUpdatePolicy",
- "Concurrent",
- "Disruptive",
- "VDD_AVSBUS_RAIL",
- "SBE_IMAGE_MINIMUM_VALID_ECS",
- "INTEGER_INVALID_CASE",
- "str_example1",
- "str_example2",
- "str_example3"};
+ std::set<std::string> expectedStrings = {
+ "HMCManagedState",
+ "On",
+ "Off",
+ "FWBootSide",
+ "Perm",
+ "Temp",
+ "InbandCodeUpdate",
+ "Allowed",
+ "Allowed",
+ "NotAllowed",
+ "CodeUpdatePolicy",
+ "Concurrent",
+ "Disruptive",
+ "VDD_AVSBUS_RAIL",
+ "SBE_IMAGE_MINIMUM_VALID_ECS",
+ "INTEGER_INVALID_CASE",
+ "str_example1",
+ "str_example2",
+ "str_example3"};
std::set<std::string> strings;
for (auto entry : BIOSTableIter<PLDM_BIOS_STRING_TABLE>(
stringTable->data(), stringTable->size()))
@@ -213,8 +214,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);
@@ -453,9 +454,8 @@
EXPECT_EQ(rc, PLDM_SUCCESS);
auto attrValueTable = biosConfig.getBIOSTable(PLDM_BIOS_ATTR_VAL_TABLE);
- auto findEntry =
- [&attrValueTable](
- uint16_t handle) -> const pldm_bios_attr_val_table_entry* {
+ auto findEntry = [&attrValueTable](uint16_t handle)
+ -> const pldm_bios_attr_val_table_entry* {
for (auto entry : BIOSTableIter<PLDM_BIOS_ATTR_VAL_TABLE>(
attrValueTable->data(), attrValueTable->size()))
{