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/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
+}