clang-format: copy latest and re-format
clang-format-17 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: Ib459ac591ed3031de84d0239948d8daa583ef8a5
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/extensions/openpower-pels/data_interface.cpp b/extensions/openpower-pels/data_interface.cpp
index 2325182..eaedcff 100644
--- a/extensions/openpower-pels/data_interface.cpp
+++ b/extensions/openpower-pels/data_interface.cpp
@@ -140,20 +140,20 @@
_properties.emplace_back(std::make_unique<PropertyWatcher<DataInterface>>(
bus, object_path::hostState, interface::bootProgress, "BootProgress",
*this, [this](const auto& value) {
- this->_bootState = std::get<std::string>(value);
- auto status = Progress::convertProgressStagesFromString(
- std::get<std::string>(value));
+ this->_bootState = std::get<std::string>(value);
+ auto status = Progress::convertProgressStagesFromString(
+ std::get<std::string>(value));
- if ((status == Progress::ProgressStages::SystemInitComplete) ||
- (status == Progress::ProgressStages::OSRunning))
- {
- setHostUp(true);
- }
- else
- {
- setHostUp(false);
- }
- }));
+ if ((status == Progress::ProgressStages::SystemInitComplete) ||
+ (status == Progress::ProgressStages::OSRunning))
+ {
+ setHostUp(true);
+ }
+ else
+ {
+ setHostUp(false);
+ }
+ }));
// Watch the host PEL enable property
_properties.emplace_back(std::make_unique<PropertyWatcher<DataInterface>>(
@@ -165,22 +165,22 @@
std::get<bool>(value));
}
this->_sendPELsToHost = std::get<bool>(value);
- }));
+ }));
// Watch the BMCState property
_properties.emplace_back(std::make_unique<PropertyWatcher<DataInterface>>(
bus, object_path::bmcState, interface::bmcState, "CurrentBMCState",
*this, [this](const auto& value) {
- const auto& state = std::get<std::string>(value);
- this->_bmcState = state;
+ const auto& state = std::get<std::string>(value);
+ this->_bmcState = state;
- // Wait for BMC ready to start watching for
- // plugs so things calm down first.
- if (BMC::convertBMCStateFromString(state) == BMC::BMCState::Ready)
- {
- startFruPlugWatch();
- }
- }));
+ // Wait for BMC ready to start watching for
+ // plugs so things calm down first.
+ if (BMC::convertBMCStateFromString(state) == BMC::BMCState::Ready)
+ {
+ startFruPlugWatch();
+ }
+ }));
// Watch the chassis current and requested power state properties
_properties.emplace_back(std::make_unique<InterfaceWatcher<DataInterface>>(
@@ -197,14 +197,14 @@
{
this->_chassisTransition = std::get<std::string>(trans->second);
}
- }));
+ }));
// Watch the CurrentHostState property
_properties.emplace_back(std::make_unique<PropertyWatcher<DataInterface>>(
bus, object_path::hostState, interface::hostState, "CurrentHostState",
*this, [this](const auto& value) {
- this->_hostState = std::get<std::string>(value);
- }));
+ this->_hostState = std::get<std::string>(value);
+ }));
// Watch the BaseBIOSTable property for the hmc managed attribute
_properties.emplace_back(std::make_unique<PropertyWatcher<DataInterface>>(
@@ -223,7 +223,7 @@
this->_hmcManaged = (*currentVal == "Enabled") ? true : false;
}
}
- }));
+ }));
}
DBusPropertyMap
@@ -924,7 +924,7 @@
[](const auto& interfacePair) {
return std::find(hotplugInterfaces.begin(), hotplugInterfaces.end(),
interfacePair.first) != hotplugInterfaces.end();
- }) == interfaces.end())
+ }) == interfaces.end())
{
return;
}
diff --git a/extensions/openpower-pels/fapi_data_process.cpp b/extensions/openpower-pels/fapi_data_process.cpp
index 13416ae..b809725 100644
--- a/extensions/openpower-pels/fapi_data_process.cpp
+++ b/extensions/openpower-pels/fapi_data_process.cpp
@@ -275,11 +275,11 @@
ffdc.hwp_errorinfo.ffdcs_data.cend(),
[&ffdcUserData](
const std::pair<std::string, std::string>& ele) -> void {
- std::string keyWithPrefix("HWP_FFDC_");
- keyWithPrefix.append(ele.first);
+ std::string keyWithPrefix("HWP_FFDC_");
+ keyWithPrefix.append(ele.first);
- ffdcUserData.emplace_back(keyWithPrefix, ele.second);
- });
+ ffdcUserData.emplace_back(keyWithPrefix, ele.second);
+ });
// get clock position information
auto clk_pos = 0xFF; // Invalid position.
for (auto& hwCallout : ffdc.hwp_errorinfo.hwcallouts)
@@ -296,15 +296,14 @@
ffdc.hwp_errorinfo.cdg_targets.end(),
[&ffdcUserData, &pelJSONFmtCalloutDataList,
clk_pos](const CDG_Target& cdg_tgt) -> void {
- json jsonCalloutData;
- std::string pelPriority = "H";
- jsonCalloutData["Priority"] = pelPriority; // Not used
- jsonCalloutData["SymbolicFRU"] = "REFCLK" +
- std::to_string(clk_pos);
- jsonCalloutData["Deconfigured"] = cdg_tgt.deconfigure;
- jsonCalloutData["EntityPath"] = cdg_tgt.target_entity_path;
- pelJSONFmtCalloutDataList.emplace_back(jsonCalloutData);
- });
+ json jsonCalloutData;
+ std::string pelPriority = "H";
+ jsonCalloutData["Priority"] = pelPriority; // Not used
+ jsonCalloutData["SymbolicFRU"] = "REFCLK" + std::to_string(clk_pos);
+ jsonCalloutData["Deconfigured"] = cdg_tgt.deconfigure;
+ jsonCalloutData["EntityPath"] = cdg_tgt.target_entity_path;
+ pelJSONFmtCalloutDataList.emplace_back(jsonCalloutData);
+ });
}
void convertFAPItoPELformat(FFDC& ffdc, json& pelJSONFmtCalloutDataList,
@@ -328,126 +327,119 @@
ffdc.hwp_errorinfo.ffdcs_data.begin(),
ffdc.hwp_errorinfo.ffdcs_data.end(),
[&ffdcUserData](std::pair<std::string, std::string>& ele) -> void {
- std::string keyWithPrefix("HWP_FFDC_");
- keyWithPrefix.append(ele.first);
+ std::string keyWithPrefix("HWP_FFDC_");
+ keyWithPrefix.append(ele.first);
- ffdcUserData.emplace_back(keyWithPrefix, ele.second);
- });
+ ffdcUserData.emplace_back(keyWithPrefix, ele.second);
+ });
// Adding hardware callout details
int calloutCount = 0;
- for_each(
- ffdc.hwp_errorinfo.hwcallouts.begin(),
- ffdc.hwp_errorinfo.hwcallouts.end(),
- [&ffdcUserData, &calloutCount,
- &pelJSONFmtCalloutDataList](const HWCallout& hwCallout) -> void {
- calloutCount++;
- std::stringstream keyPrefix;
- keyPrefix << "HWP_HW_CO_" << std::setfill('0') << std::setw(2)
- << calloutCount << "_";
+ for_each(ffdc.hwp_errorinfo.hwcallouts.begin(),
+ ffdc.hwp_errorinfo.hwcallouts.end(),
+ [&ffdcUserData, &calloutCount, &pelJSONFmtCalloutDataList](
+ const HWCallout& hwCallout) -> void {
+ calloutCount++;
+ std::stringstream keyPrefix;
+ keyPrefix << "HWP_HW_CO_" << std::setfill('0') << std::setw(2)
+ << calloutCount << "_";
- ffdcUserData.emplace_back(
- std::string(keyPrefix.str()).append("HW_ID"),
- hwCallout.hwid);
+ ffdcUserData.emplace_back(
+ std::string(keyPrefix.str()).append("HW_ID"), hwCallout.hwid);
- ffdcUserData.emplace_back(
- std::string(keyPrefix.str()).append("PRIORITY"),
- hwCallout.callout_priority);
+ ffdcUserData.emplace_back(
+ std::string(keyPrefix.str()).append("PRIORITY"),
+ hwCallout.callout_priority);
- phal::TargetInfo targetInfo;
- phal::getTgtReqAttrsVal(hwCallout.target_entity_path,
- targetInfo);
+ phal::TargetInfo targetInfo;
+ phal::getTgtReqAttrsVal(hwCallout.target_entity_path, targetInfo);
- std::string locationCode = std::string(targetInfo.locationCode);
- ffdcUserData.emplace_back(
- std::string(keyPrefix.str()).append("LOC_CODE"),
- locationCode);
+ std::string locationCode = std::string(targetInfo.locationCode);
+ ffdcUserData.emplace_back(
+ std::string(keyPrefix.str()).append("LOC_CODE"), locationCode);
- std::string physPath = std::string(targetInfo.physDevPath);
- ffdcUserData.emplace_back(
- std::string(keyPrefix.str()).append("PHYS_PATH"), physPath);
+ std::string physPath = std::string(targetInfo.physDevPath);
+ ffdcUserData.emplace_back(
+ std::string(keyPrefix.str()).append("PHYS_PATH"), physPath);
- ffdcUserData.emplace_back(
- std::string(keyPrefix.str()).append("CLK_POS"),
- std::to_string(hwCallout.clkPos));
+ ffdcUserData.emplace_back(
+ std::string(keyPrefix.str()).append("CLK_POS"),
+ std::to_string(hwCallout.clkPos));
- ffdcUserData.emplace_back(
- std::string(keyPrefix.str()).append("CALLOUT_PLANAR"),
- (hwCallout.isPlanarCallout == true ? "true" : "false"));
+ ffdcUserData.emplace_back(
+ std::string(keyPrefix.str()).append("CALLOUT_PLANAR"),
+ (hwCallout.isPlanarCallout == true ? "true" : "false"));
- std::string pelPriority =
- getPelPriority(hwCallout.callout_priority);
+ std::string pelPriority =
+ getPelPriority(hwCallout.callout_priority);
- if (hwCallout.isPlanarCallout)
- {
- addPlanarCallout(pelJSONFmtCalloutDataList, pelPriority);
- }
- });
+ if (hwCallout.isPlanarCallout)
+ {
+ addPlanarCallout(pelJSONFmtCalloutDataList, pelPriority);
+ }
+ });
// Adding CDG (callout, deconfigure and guard) targets details
calloutCount = 0;
- for_each(
- ffdc.hwp_errorinfo.cdg_targets.begin(),
- ffdc.hwp_errorinfo.cdg_targets.end(),
- [&ffdcUserData, &calloutCount,
- &pelJSONFmtCalloutDataList](const CDG_Target& cdg_tgt) -> void {
- calloutCount++;
- std::stringstream keyPrefix;
- keyPrefix << "HWP_CDG_TGT_" << std::setfill('0') << std::setw(2)
- << calloutCount << "_";
+ for_each(ffdc.hwp_errorinfo.cdg_targets.begin(),
+ ffdc.hwp_errorinfo.cdg_targets.end(),
+ [&ffdcUserData, &calloutCount, &pelJSONFmtCalloutDataList](
+ const CDG_Target& cdg_tgt) -> void {
+ calloutCount++;
+ std::stringstream keyPrefix;
+ keyPrefix << "HWP_CDG_TGT_" << std::setfill('0') << std::setw(2)
+ << calloutCount << "_";
- phal::TargetInfo targetInfo;
- targetInfo.deconfigure = cdg_tgt.deconfigure;
+ phal::TargetInfo targetInfo;
+ targetInfo.deconfigure = cdg_tgt.deconfigure;
- phal::getTgtReqAttrsVal(cdg_tgt.target_entity_path, targetInfo);
+ phal::getTgtReqAttrsVal(cdg_tgt.target_entity_path, targetInfo);
- std::string locationCode = std::string(targetInfo.locationCode);
- ffdcUserData.emplace_back(
- std::string(keyPrefix.str()).append("LOC_CODE"),
- locationCode);
- std::string physPath = std::string(targetInfo.physDevPath);
- ffdcUserData.emplace_back(
- std::string(keyPrefix.str()).append("PHYS_PATH"), physPath);
+ std::string locationCode = std::string(targetInfo.locationCode);
+ ffdcUserData.emplace_back(
+ std::string(keyPrefix.str()).append("LOC_CODE"), locationCode);
+ std::string physPath = std::string(targetInfo.physDevPath);
+ ffdcUserData.emplace_back(
+ std::string(keyPrefix.str()).append("PHYS_PATH"), physPath);
- ffdcUserData.emplace_back(
- std::string(keyPrefix.str()).append("CO_REQ"),
- (cdg_tgt.callout == true ? "true" : "false"));
+ ffdcUserData.emplace_back(
+ std::string(keyPrefix.str()).append("CO_REQ"),
+ (cdg_tgt.callout == true ? "true" : "false"));
- ffdcUserData.emplace_back(
- std::string(keyPrefix.str()).append("CO_PRIORITY"),
- cdg_tgt.callout_priority);
+ ffdcUserData.emplace_back(
+ std::string(keyPrefix.str()).append("CO_PRIORITY"),
+ cdg_tgt.callout_priority);
- ffdcUserData.emplace_back(
- std::string(keyPrefix.str()).append("DECONF_REQ"),
- (cdg_tgt.deconfigure == true ? "true" : "false"));
+ ffdcUserData.emplace_back(
+ std::string(keyPrefix.str()).append("DECONF_REQ"),
+ (cdg_tgt.deconfigure == true ? "true" : "false"));
- ffdcUserData.emplace_back(
- std::string(keyPrefix.str()).append("GUARD_REQ"),
- (cdg_tgt.guard == true ? "true" : "false"));
+ ffdcUserData.emplace_back(
+ std::string(keyPrefix.str()).append("GUARD_REQ"),
+ (cdg_tgt.guard == true ? "true" : "false"));
- ffdcUserData.emplace_back(
- std::string(keyPrefix.str()).append("GUARD_TYPE"),
- cdg_tgt.guard_type);
+ ffdcUserData.emplace_back(
+ std::string(keyPrefix.str()).append("GUARD_TYPE"),
+ cdg_tgt.guard_type);
- json jsonCalloutData;
- jsonCalloutData["LocationCode"] = locationCode;
- std::string pelPriority =
- getPelPriority(cdg_tgt.callout_priority);
- jsonCalloutData["Priority"] = pelPriority;
+ json jsonCalloutData;
+ jsonCalloutData["LocationCode"] = locationCode;
+ std::string pelPriority = getPelPriority(cdg_tgt.callout_priority);
+ jsonCalloutData["Priority"] = pelPriority;
- if (targetInfo.mruId != 0)
- {
- jsonCalloutData["MRUs"] = json::array({
- {{"ID", targetInfo.mruId}, {"Priority", pelPriority}},
- });
- }
- jsonCalloutData["Deconfigured"] = cdg_tgt.deconfigure;
- jsonCalloutData["Guarded"] = cdg_tgt.guard;
- jsonCalloutData["GuardType"] = cdg_tgt.guard_type;
- jsonCalloutData["EntityPath"] = cdg_tgt.target_entity_path;
+ if (targetInfo.mruId != 0)
+ {
+ jsonCalloutData["MRUs"] = json::array({
+ {{"ID", targetInfo.mruId}, {"Priority", pelPriority}},
+ });
+ }
+ jsonCalloutData["Deconfigured"] = cdg_tgt.deconfigure;
+ jsonCalloutData["Guarded"] = cdg_tgt.guard;
+ jsonCalloutData["GuardType"] = cdg_tgt.guard_type;
+ jsonCalloutData["EntityPath"] = cdg_tgt.target_entity_path;
- pelJSONFmtCalloutDataList.emplace_back(jsonCalloutData);
- });
+ pelJSONFmtCalloutDataList.emplace_back(jsonCalloutData);
+ });
// Adding procedure callout
calloutCount = 0;
@@ -455,23 +447,23 @@
ffdc.hwp_errorinfo.procedures_callout.end(),
[&ffdcUserData, &calloutCount, &pelJSONFmtCalloutDataList](
const ProcedureCallout& procCallout) -> void {
- calloutCount++;
- std::stringstream keyPrefix;
- keyPrefix << "HWP_PROC_CO_" << std::setfill('0')
- << std::setw(2) << calloutCount << "_";
- ffdcUserData.emplace_back(
- std::string(keyPrefix.str()).append("PRIORITY"),
- procCallout.callout_priority);
- ffdcUserData.emplace_back(
- std::string(keyPrefix.str()).append("MAINT_PROCEDURE"),
- procCallout.proc_callout);
- json jsonCalloutData;
- jsonCalloutData["Procedure"] = procCallout.proc_callout;
- std::string pelPriority =
- getPelPriority(procCallout.callout_priority);
- jsonCalloutData["Priority"] = pelPriority;
- pelJSONFmtCalloutDataList.emplace_back(jsonCalloutData);
- });
+ calloutCount++;
+ std::stringstream keyPrefix;
+ keyPrefix << "HWP_PROC_CO_" << std::setfill('0') << std::setw(2)
+ << calloutCount << "_";
+ ffdcUserData.emplace_back(
+ std::string(keyPrefix.str()).append("PRIORITY"),
+ procCallout.callout_priority);
+ ffdcUserData.emplace_back(
+ std::string(keyPrefix.str()).append("MAINT_PROCEDURE"),
+ procCallout.proc_callout);
+ json jsonCalloutData;
+ jsonCalloutData["Procedure"] = procCallout.proc_callout;
+ std::string pelPriority =
+ getPelPriority(procCallout.callout_priority);
+ jsonCalloutData["Priority"] = pelPriority;
+ pelJSONFmtCalloutDataList.emplace_back(jsonCalloutData);
+ });
}
else if ((ffdc.ffdc_type != FFDC_TYPE_NONE) &&
(ffdc.ffdc_type != FFDC_TYPE_UNSUPPORTED))
diff --git a/extensions/openpower-pels/pel.cpp b/extensions/openpower-pels/pel.cpp
index ecd6f3b..1f0ab67 100644
--- a/extensions/openpower-pels/pel.cpp
+++ b/extensions/openpower-pels/pel.cpp
@@ -553,8 +553,7 @@
{
// Get the ED section from PEL
auto op = std::find_if(_optionalSections.begin(),
- _optionalSections.end(),
- [](auto& section) {
+ _optionalSections.end(), [](auto& section) {
return section->header().id ==
static_cast<uint16_t>(SectionID::extUserData);
});
diff --git a/extensions/openpower-pels/repository.cpp b/extensions/openpower-pels/repository.cpp
index 1860154..70738b0 100644
--- a/extensions/openpower-pels/repository.cpp
+++ b/extensions/openpower-pels/repository.cpp
@@ -593,10 +593,9 @@
{
std::vector<Repository::AttributesReference> attributes;
- std::for_each(_pelAttributes.begin(), _pelAttributes.end(),
- [&attributes](auto& pelEntry) {
- attributes.push_back(pelEntry);
- });
+ std::for_each(
+ _pelAttributes.begin(), _pelAttributes.end(),
+ [&attributes](auto& pelEntry) { attributes.push_back(pelEntry); });
std::sort(attributes.begin(), attributes.end(),
[order](const auto& left, const auto& right) {
@@ -723,17 +722,17 @@
static const std::vector<std::function<bool(const PELAttributes& pel)>>
stateChecks{[](const auto& pel) {
return pel.hmcState == TransmissionState::acked;
- },
+ },
[](const auto& pel) {
return pel.hostState == TransmissionState::acked;
- },
+ },
- [](const auto& pel) {
+ [](const auto& pel) {
return pel.hostState == TransmissionState::sent;
- },
+ },
- [](const auto& /*pel*/) { return true; }};
+ [](const auto& /*pel*/) { return true; }};
for (const auto& stateCheck : stateChecks)
{
diff --git a/extensions/openpower-pels/sbe_ffdc_handler.hpp b/extensions/openpower-pels/sbe_ffdc_handler.hpp
index ad2309e..d6ed502 100644
--- a/extensions/openpower-pels/sbe_ffdc_handler.hpp
+++ b/extensions/openpower-pels/sbe_ffdc_handler.hpp
@@ -50,11 +50,11 @@
typedef struct
{
- uint32_t magic_bytes : 16;
- uint32_t lengthinWords : 16;
- uint32_t seqId : 16;
- uint32_t cmdClass : 8;
- uint32_t cmd : 8;
+ uint32_t magic_bytes:16;
+ uint32_t lengthinWords:16;
+ uint32_t seqId:16;
+ uint32_t cmdClass:8;
+ uint32_t cmd:8;
uint32_t fapiRc;
} __attribute__((packed)) fapiFfdcBufType;
diff --git a/extensions/openpower-pels/src.cpp b/extensions/openpower-pels/src.cpp
index 3260f20..af25c50 100644
--- a/extensions/openpower-pels/src.cpp
+++ b/extensions/openpower-pels/src.cpp
@@ -1567,7 +1567,7 @@
if (std::all_of(progressCodeString.begin(), progressCodeString.end(),
[](char c) {
return std::isxdigit(static_cast<unsigned char>(c));
- }))
+ }))
{
progressCode = std::stoul(progressCodeString, nullptr, 16);
}