clang-format: update with latest
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I329396457b83bb2eb8740629b4ac1fbe9106bced
diff --git a/extensions/openpower-pels/additional_data.hpp b/extensions/openpower-pels/additional_data.hpp
index ca4a47d..09dbd20 100644
--- a/extensions/openpower-pels/additional_data.hpp
+++ b/extensions/openpower-pels/additional_data.hpp
@@ -1,6 +1,7 @@
#pragma once
-#include <map>
#include <nlohmann/json.hpp>
+
+#include <map>
#include <optional>
#include <string>
#include <vector>
diff --git a/extensions/openpower-pels/bcd_time.hpp b/extensions/openpower-pels/bcd_time.hpp
index 3a805a5..5679a5b 100644
--- a/extensions/openpower-pels/bcd_time.hpp
+++ b/extensions/openpower-pels/bcd_time.hpp
@@ -25,8 +25,7 @@
BCDTime() :
yearMSB(0), yearLSB(0), month(0), day(0), hour(0), minutes(0),
seconds(0), hundredths(0)
- {
- }
+ {}
BCDTime(uint8_t yearMSB, uint8_t yearLSB, uint8_t month, uint8_t day,
uint8_t hour, uint8_t minutes, uint8_t seconds,
@@ -34,8 +33,7 @@
yearMSB(yearMSB),
yearLSB(yearLSB), month(month), day(day), hour(hour), minutes(minutes),
seconds(seconds), hundredths(hundredths)
- {
- }
+ {}
bool operator==(const BCDTime& right) const;
bool operator!=(const BCDTime& right) const;
diff --git a/extensions/openpower-pels/callout.cpp b/extensions/openpower-pels/callout.cpp
index f54d77e..0c45950 100644
--- a/extensions/openpower-pels/callout.cpp
+++ b/extensions/openpower-pels/callout.cpp
@@ -83,8 +83,7 @@
const std::string& serialNumber) :
Callout(priority, locationCode, partNumber, ccin, serialNumber,
std::vector<MRU::MRUCallout>{})
-{
-}
+{}
Callout::Callout(CalloutPriority priority, const std::string& locationCode,
const std::string& partNumber, const std::string& ccin,
@@ -97,8 +96,8 @@
setLocationCode(locationCode);
- _fruIdentity =
- std::make_unique<FRUIdentity>(partNumber, ccin, serialNumber);
+ _fruIdentity = std::make_unique<FRUIdentity>(partNumber, ccin,
+ serialNumber);
if (!mrus.empty())
{
@@ -133,8 +132,8 @@
setLocationCode(locationCode);
- _fruIdentity =
- std::make_unique<FRUIdentity>(symbolicFRU, type, trustedLocationCode);
+ _fruIdentity = std::make_unique<FRUIdentity>(symbolicFRU, type,
+ trustedLocationCode);
_size = flattenedSize();
}
diff --git a/extensions/openpower-pels/callout.hpp b/extensions/openpower-pels/callout.hpp
index 66dcde0..9c99494 100644
--- a/extensions/openpower-pels/callout.hpp
+++ b/extensions/openpower-pels/callout.hpp
@@ -125,8 +125,7 @@
Callout(CalloutPriority priority,
const std::string& procedureFromRegistry) :
Callout(priority, procedureFromRegistry, CalloutValueType::registryName)
- {
- }
+ {}
/**
* @brief Constructor
@@ -162,8 +161,7 @@
Callout(priority, symbolicFRUFromRegistry,
CalloutValueType::registryName, locationCode,
trustedLocationCode)
- {
- }
+ {}
/**
* @brief Returns the size of this object when flattened into a PEL
diff --git a/extensions/openpower-pels/callouts.cpp b/extensions/openpower-pels/callouts.cpp
index 7482aca..3ba3459 100644
--- a/extensions/openpower-pels/callouts.cpp
+++ b/extensions/openpower-pels/callouts.cpp
@@ -15,9 +15,10 @@
*/
#include "callouts.hpp"
+#include <phosphor-logging/log.hpp>
+
#include <algorithm>
#include <map>
-#include <phosphor-logging/log.hpp>
namespace openpower
{
diff --git a/extensions/openpower-pels/callouts.hpp b/extensions/openpower-pels/callouts.hpp
index 4a05306..9f929ab 100644
--- a/extensions/openpower-pels/callouts.hpp
+++ b/extensions/openpower-pels/callouts.hpp
@@ -40,8 +40,7 @@
Callouts() :
_subsectionID(calloutsSubsectionID), _subsectionFlags(0),
_subsectionWordLength(1)
- {
- }
+ {}
/**
* @brief Constructor
diff --git a/extensions/openpower-pels/data_interface.cpp b/extensions/openpower-pels/data_interface.cpp
index 1c33579..e6b95a3 100644
--- a/extensions/openpower-pels/data_interface.cpp
+++ b/extensions/openpower-pels/data_interface.cpp
@@ -21,11 +21,12 @@
#include <fmt/format.h>
-#include <fstream>
-#include <iterator>
#include <phosphor-logging/log.hpp>
#include <xyz/openbmc_project/State/Boot/Progress/server.hpp>
+#include <fstream>
+#include <iterator>
+
// Use a timeout of 10s for D-Bus calls so if there are
// timeouts the callers of the PEL creation method won't
// also timeout.
@@ -206,8 +207,8 @@
auto currentVal = std::get_if<std::string>(¤tValVariant);
if (currentVal)
{
- this->_hmcManaged =
- (*currentVal == "Enabled") ? true : false;
+ this->_hmcManaged = (*currentVal == "Enabled") ? true
+ : false;
}
}
}));
@@ -236,7 +237,6 @@
const std::string& property,
DBusValue& value) const
{
-
auto method = _bus.new_method_call(service.c_str(), objectPath.c_str(),
interface::dbusProperty, "Get");
method.append(interface, property);
@@ -247,7 +247,6 @@
DBusPathList DataInterface::getPaths(const DBusInterfaceList& interfaces) const
{
-
auto method = _bus.new_method_call(
service_name::objectMapper, object_path::objectMapper,
interface::objectMapper, "GetSubTreePaths");
@@ -312,7 +311,6 @@
std::string model;
try
{
-
auto service = getService(object_path::systemInv, interface::invAsset);
if (!service.empty())
{
@@ -339,7 +337,6 @@
std::string sn;
try
{
-
auto service = getService(object_path::systemInv, interface::invAsset);
if (!service.empty())
{
@@ -368,8 +365,8 @@
try
{
- auto service =
- getService(object_path::motherBoardInv, interface::viniRecordVPD);
+ auto service = getService(object_path::motherBoardInv,
+ interface::viniRecordVPD);
if (!service.empty())
{
DBusValue value;
@@ -398,8 +395,8 @@
try
{
- auto service =
- getService(object_path::motherBoardInv, interface::vsbpRecordVPD);
+ auto service = getService(object_path::motherBoardInv,
+ interface::vsbpRecordVPD);
if (!service.empty())
{
DBusValue value;
@@ -435,8 +432,8 @@
auto service = getService(inventoryPath, interface::viniRecordVPD);
- auto properties =
- getAllProperties(service, inventoryPath, interface::viniRecordVPD);
+ auto properties = getAllProperties(service, inventoryPath,
+ interface::viniRecordVPD);
auto value = std::get<std::vector<uint8_t>>(properties["FN"]);
fruPartNumber = std::string{value.begin(), value.end()};
@@ -555,9 +552,9 @@
bool value) const
{
DBusValue variant = value;
- auto method =
- _bus.new_method_call(service_name::ledGroupManager, ledGroup.c_str(),
- interface::dbusProperty, "Set");
+ auto method = _bus.new_method_call(service_name::ledGroupManager,
+ ledGroup.c_str(),
+ interface::dbusProperty, "Set");
method.append(interface::ledGroup, "Asserted", variant);
_bus.call(method, dbusTimeout);
}
@@ -641,8 +638,8 @@
try
{
- auto service =
- getService(object_path::logSetting, interface::logSetting);
+ auto service = getService(object_path::logSetting,
+ interface::logSetting);
if (!service.empty())
{
DBusValue value;
@@ -814,8 +811,8 @@
// If the entry isn't resolved
if (!status)
{
- auto assocService =
- getService(path, interface::association);
+ auto assocService = getService(path,
+ interface::association);
if (!assocService.empty())
{
DBusValue endpoints;
diff --git a/extensions/openpower-pels/data_interface.hpp b/extensions/openpower-pels/data_interface.hpp
index 90f0aa2..e66cd0c 100644
--- a/extensions/openpower-pels/data_interface.hpp
+++ b/extensions/openpower-pels/data_interface.hpp
@@ -3,12 +3,13 @@
#include "dbus_types.hpp"
#include "dbus_watcher.hpp"
-#include <filesystem>
-#include <fstream>
#include <phosphor-logging/log.hpp>
#include <sdbusplus/bus.hpp>
#include <sdbusplus/bus/match.hpp>
+#include <filesystem>
+#include <fstream>
+
namespace openpower
{
namespace pels
diff --git a/extensions/openpower-pels/dbus_watcher.hpp b/extensions/openpower-pels/dbus_watcher.hpp
index dcf2744..fdf71e0 100644
--- a/extensions/openpower-pels/dbus_watcher.hpp
+++ b/extensions/openpower-pels/dbus_watcher.hpp
@@ -32,8 +32,7 @@
*/
DBusWatcher(const std::string& path, const std::string& interface) :
_path(path), _interface(interface)
- {
- }
+ {}
protected:
/**
@@ -147,8 +146,7 @@
const std::string& propertyName, const DataIface& dataIface,
PropertySetFunc func) :
PropertyWatcher(bus, path, interface, propertyName, "", dataIface, func)
- {
- }
+ {}
/**
* @brief Reads the property on D-Bus, and calls
@@ -316,8 +314,8 @@
auto service = dataIface.getService(_path, _interface);
if (!service.empty())
{
- auto properties =
- dataIface.getAllProperties(service, _path, _interface);
+ auto properties = dataIface.getAllProperties(service, _path,
+ _interface);
_setFunc(properties);
}
diff --git a/extensions/openpower-pels/device_callouts.cpp b/extensions/openpower-pels/device_callouts.cpp
index 4b7e590..c446a4f 100644
--- a/extensions/openpower-pels/device_callouts.cpp
+++ b/extensions/openpower-pels/device_callouts.cpp
@@ -17,8 +17,9 @@
#include "paths.hpp"
-#include <fstream>
#include <phosphor-logging/log.hpp>
+
+#include <fstream>
#include <regex>
namespace openpower::pels::device_callouts
@@ -191,7 +192,6 @@
std::tuple<std::string, size_t> getFSISPISearchKeys(const std::string& devPath)
{
-
// Combine the FSI and SPI search keys.
auto links = getFSISearchKeys(devPath);
auto bus = getSPISearchKeys(devPath);
@@ -480,8 +480,8 @@
callouts = calloutFSISPI(path, json);
break;
default:
- std::string msg =
- "Could not get callout type from device path: " + path.string();
+ std::string msg = "Could not get callout type from device path: " +
+ path.string();
throw std::invalid_argument{msg.c_str()};
break;
}
diff --git a/extensions/openpower-pels/device_callouts.hpp b/extensions/openpower-pels/device_callouts.hpp
index 1df504a..c09fc32 100644
--- a/extensions/openpower-pels/device_callouts.hpp
+++ b/extensions/openpower-pels/device_callouts.hpp
@@ -1,7 +1,8 @@
#pragma once
-#include <filesystem>
#include <nlohmann/json.hpp>
+
+#include <filesystem>
#include <string>
#include <tuple>
#include <vector>
diff --git a/extensions/openpower-pels/entry_points.cpp b/extensions/openpower-pels/entry_points.cpp
index 6deef72..156c666 100644
--- a/extensions/openpower-pels/entry_points.cpp
+++ b/extensions/openpower-pels/entry_points.cpp
@@ -48,9 +48,9 @@
std::unique_ptr<HostInterface> hostIface = std::make_unique<PLDMInterface>(
logManager.getBus().get_event(), *(dataIface.get()));
- manager =
- std::make_unique<Manager>(logManager, std::move(dataIface),
- std::move(logger), std::move(hostIface));
+ manager = std::make_unique<Manager>(logManager, std::move(dataIface),
+ std::move(logger),
+ std::move(hostIface));
#else
manager = std::make_unique<Manager>(logManager, std::move(dataIface),
std::move(logger));
diff --git a/extensions/openpower-pels/event_logger.hpp b/extensions/openpower-pels/event_logger.hpp
index 1af8e2e..6cbafde 100644
--- a/extensions/openpower-pels/event_logger.hpp
+++ b/extensions/openpower-pels/event_logger.hpp
@@ -4,9 +4,10 @@
#include "elog_entry.hpp"
#include <phosphor-logging/log.hpp>
-#include <queue>
#include <sdeventplus/event.hpp>
#include <sdeventplus/source/event.hpp>
+
+#include <queue>
#include <tuple>
namespace openpower::pels
@@ -57,8 +58,7 @@
*/
explicit EventLogger(LogFunction creator) :
_event(sdeventplus::Event::get_default()), _creator(creator)
- {
- }
+ {}
/**
* @brief Adds an event to the queue so that it will be created
diff --git a/extensions/openpower-pels/fapi_data_process.cpp b/extensions/openpower-pels/fapi_data_process.cpp
index b975656..8d09ee6 100644
--- a/extensions/openpower-pels/fapi_data_process.cpp
+++ b/extensions/openpower-pels/fapi_data_process.cpp
@@ -1,4 +1,5 @@
-extern "C" {
+extern "C"
+{
#include <libpdbg.h>
}
@@ -9,13 +10,14 @@
#include <libphal.H>
#include <phal_exception.H>
+#include <phosphor-logging/elog.hpp>
+
#include <algorithm>
#include <cstdlib>
#include <cstring>
#include <iomanip>
#include <list>
#include <map>
-#include <phosphor-logging/elog.hpp>
#include <sstream>
#include <string>
@@ -291,8 +293,8 @@
json jsonCalloutData;
std::string pelPriority = "H";
jsonCalloutData["Priority"] = pelPriority; // Not used
- jsonCalloutData["SymbolicFRU"] =
- "REFCLK" + std::to_string(clk_pos);
+ jsonCalloutData["SymbolicFRU"] = "REFCLK" +
+ std::to_string(clk_pos);
jsonCalloutData["Deconfigured"] = cdg_tgt.deconfigure;
jsonCalloutData["EntityPath"] = cdg_tgt.target_entity_path;
pelJSONFmtCalloutDataList.emplace_back(jsonCalloutData);
diff --git a/extensions/openpower-pels/fapi_data_process.hpp b/extensions/openpower-pels/fapi_data_process.hpp
index a9f2f0a..0905184 100644
--- a/extensions/openpower-pels/fapi_data_process.hpp
+++ b/extensions/openpower-pels/fapi_data_process.hpp
@@ -2,9 +2,10 @@
#include <libekb.H>
-#include <cstdarg>
#include <nlohmann/json.hpp>
+#include <cstdarg>
+
namespace openpower
{
namespace pels
diff --git a/extensions/openpower-pels/fru_identity.cpp b/extensions/openpower-pels/fru_identity.cpp
index 4b765fd..2e6ac9c 100644
--- a/extensions/openpower-pels/fru_identity.cpp
+++ b/extensions/openpower-pels/fru_identity.cpp
@@ -274,7 +274,6 @@
void FRUIdentity::setSymbolicFRU(const std::string& symbolicFRU,
CalloutValueType type)
{
-
// Treat this has a HW callout.
_flags |= pnSupplied;
_flags &= ~maintProcSupplied;
diff --git a/extensions/openpower-pels/fru_identity.hpp b/extensions/openpower-pels/fru_identity.hpp
index 993b32b..c6325e7 100644
--- a/extensions/openpower-pels/fru_identity.hpp
+++ b/extensions/openpower-pels/fru_identity.hpp
@@ -105,8 +105,7 @@
*/
explicit FRUIdentity(const std::string& procedureFromRegistry) :
FRUIdentity(procedureFromRegistry, CalloutValueType::registryName)
- {
- }
+ {}
/**
* @brief Constructor
@@ -132,8 +131,7 @@
bool trustedLocationCode) :
FRUIdentity(symbolicFRUFromRegistry, CalloutValueType::registryName,
trustedLocationCode)
- {
- }
+ {}
/**
* @brief Constructor
diff --git a/extensions/openpower-pels/host_interface.hpp b/extensions/openpower-pels/host_interface.hpp
index d19c2cb..ee818f3 100644
--- a/extensions/openpower-pels/host_interface.hpp
+++ b/extensions/openpower-pels/host_interface.hpp
@@ -4,12 +4,13 @@
#include <stdint.h>
-#include <chrono>
-#include <functional>
#include <phosphor-logging/log.hpp>
#include <sdeventplus/event.hpp>
#include <sdeventplus/source/io.hpp>
+#include <chrono>
+#include <functional>
+
namespace openpower
{
namespace pels
@@ -60,8 +61,7 @@
*/
HostInterface(sd_event* event, DataInterfaceBase& dataIface) :
_event(event), _dataIface(dataIface)
- {
- }
+ {}
/**
* @brief Pure virtual function for sending the 'new PEL available'
diff --git a/extensions/openpower-pels/host_notifier.hpp b/extensions/openpower-pels/host_notifier.hpp
index 0c907e0..cef999f 100644
--- a/extensions/openpower-pels/host_notifier.hpp
+++ b/extensions/openpower-pels/host_notifier.hpp
@@ -4,11 +4,12 @@
#include "pel.hpp"
#include "repository.hpp"
-#include <deque>
#include <sdeventplus/clock.hpp>
#include <sdeventplus/source/event.hpp>
#include <sdeventplus/utility/timer.hpp>
+#include <deque>
+
namespace openpower::pels
{
diff --git a/extensions/openpower-pels/json_utils.cpp b/extensions/openpower-pels/json_utils.cpp
index 679ef4e..08c816c 100644
--- a/extensions/openpower-pels/json_utils.cpp
+++ b/extensions/openpower-pels/json_utils.cpp
@@ -169,8 +169,8 @@
void jsonInsert(std::string& jsonStr, const std::string& fieldName,
const std::string& fieldValue, uint8_t indentCount)
{
- const int8_t spacesToAppend =
- colAlign - (indentCount * indentLevel) - fieldName.length() - 3;
+ const int8_t spacesToAppend = colAlign - (indentCount * indentLevel) -
+ fieldName.length() - 3;
const std::string jsonIndent(indentCount * indentLevel, 0x20);
jsonStr.append(jsonIndent + "\"" + fieldName + "\":");
if (spacesToAppend >= 0)
@@ -208,8 +208,8 @@
}
else
{
- const int8_t spacesToAppend =
- colAlign - (indentCount * indentLevel) - fieldName.length() - 3;
+ const int8_t spacesToAppend = colAlign - (indentCount * indentLevel) -
+ fieldName.length() - 3;
jsonStr.append(jsonIndent + "\"" + fieldName + "\":");
if (spacesToAppend > 0)
{
diff --git a/extensions/openpower-pels/log_id.cpp b/extensions/openpower-pels/log_id.cpp
index ee215c2..ea00ef3 100644
--- a/extensions/openpower-pels/log_id.cpp
+++ b/extensions/openpower-pels/log_id.cpp
@@ -17,10 +17,11 @@
#include "paths.hpp"
+#include <phosphor-logging/log.hpp>
+
#include <chrono>
#include <filesystem>
#include <fstream>
-#include <phosphor-logging/log.hpp>
namespace openpower
{
diff --git a/extensions/openpower-pels/manager.cpp b/extensions/openpower-pels/manager.cpp
index e0186bc..68053b0 100644
--- a/extensions/openpower-pels/manager.cpp
+++ b/extensions/openpower-pels/manager.cpp
@@ -26,11 +26,12 @@
#include <sys/inotify.h>
#include <unistd.h>
+#include <xyz/openbmc_project/Common/error.hpp>
+#include <xyz/openbmc_project/Logging/Create/server.hpp>
+
#include <filesystem>
#include <fstream>
#include <locale>
-#include <xyz/openbmc_project/Common/error.hpp>
-#include <xyz/openbmc_project/Logging/Create/server.hpp>
namespace openpower
{
@@ -387,9 +388,9 @@
auto src = pel->primarySRC();
if (src)
{
- auto m =
- fmt::format("Created PEL {:#x} (BMC ID {}) with SRC {}", pel->id(),
- pel->obmcLogID(), (*src)->asciiString());
+ auto m = fmt::format("Created PEL {:#x} (BMC ID {}) with SRC {}",
+ pel->id(), pel->obmcLogID(),
+ (*src)->asciiString());
while (m.back() == ' ')
{
m.pop_back();
@@ -548,8 +549,8 @@
if (-1 == _pelFileDeleteFD)
{
auto e = errno;
- std::string msg =
- "inotify_init1 failed with errno " + std::to_string(e);
+ std::string msg = "inotify_init1 failed with errno " +
+ std::to_string(e);
log<level::ERR>(msg.c_str());
abort();
}
@@ -559,8 +560,8 @@
if (-1 == _pelFileDeleteWatchFD)
{
auto e = errno;
- std::string msg =
- "inotify_add_watch failed with error " + std::to_string(e);
+ std::string msg = "inotify_add_watch failed with error " +
+ std::to_string(e);
log<level::ERR>(msg.c_str());
abort();
}
@@ -784,8 +785,8 @@
resolution += std::to_string(index) + ". ";
// Adding Location code to resolution
if (!entry->locationCode().empty())
- resolution +=
- "Location Code: " + entry->locationCode() + ", ";
+ resolution += "Location Code: " + entry->locationCode() +
+ ", ";
if (entry->fruIdentity())
{
// Get priority and set the resolution string
@@ -857,8 +858,8 @@
auto entryN = _logManager.entries.find(pel.obmcLogID());
if (entryN != _logManager.entries.end())
{
- auto newSeverity =
- fixupLogSeverity(entryN->second->severity(), sevType);
+ auto newSeverity = fixupLogSeverity(entryN->second->severity(),
+ sevType);
if (newSeverity)
{
log<level::INFO>(
@@ -988,8 +989,8 @@
// Read bytes from offset [40-47] e.g. BD8D1001
for (int i = 0; i < 8; i++)
{
- srcRefCode |=
- (static_cast<uint64_t>(asciiSRC[40 + i]) << (8 * i));
+ srcRefCode |= (static_cast<uint64_t>(asciiSRC[40 + i])
+ << (8 * i));
}
try
diff --git a/extensions/openpower-pels/pel.cpp b/extensions/openpower-pels/pel.cpp
index 3de2fa3..f74eaf3 100644
--- a/extensions/openpower-pels/pel.cpp
+++ b/extensions/openpower-pels/pel.cpp
@@ -40,9 +40,10 @@
#include <sys/stat.h>
#include <unistd.h>
-#include <iostream>
#include <phosphor-logging/log.hpp>
+#include <iostream>
+
namespace openpower
{
namespace pels
@@ -73,8 +74,8 @@
std::unique_ptr<sbe::SbeFFDC> sbeFFDCPtr;
if (processReq)
{
- sbeFFDCPtr =
- std::make_unique<sbe::SbeFFDC>(additionalData, ffdcFilesIn);
+ sbeFFDCPtr = std::make_unique<sbe::SbeFFDC>(additionalData,
+ ffdcFilesIn);
const auto& sbeFFDCFiles = sbeFFDCPtr->getSbeFFDC();
ffdcFiles.insert(ffdcFiles.end(), sbeFFDCFiles.begin(),
sbeFFDCFiles.end());
@@ -109,8 +110,8 @@
}
}
- auto src =
- std::make_unique<SRC>(regEntry, additionalData, callouts, dataIface);
+ auto src = std::make_unique<SRC>(regEntry, additionalData, callouts,
+ dataIface);
if (!src->getDebugData().empty())
{
@@ -199,9 +200,7 @@
checkRulesAndFix();
}
-PEL::PEL(std::vector<uint8_t>& data) : PEL(data, 0)
-{
-}
+PEL::PEL(std::vector<uint8_t>& data) : PEL(data, 0) {}
PEL::PEL(std::vector<uint8_t>& data, uint32_t obmcLogID)
{
@@ -328,8 +327,8 @@
// assume the user knows what they are doing.
if (_uh->actionFlags() == actionFlagsDefault)
{
- auto [actionFlags, eventType] =
- pel_rules::check(0, _uh->eventType(), _uh->severity());
+ auto [actionFlags, eventType] = pel_rules::check(0, _uh->eventType(),
+ _uh->severity());
_uh->setActionFlags(actionFlags);
_uh->setEventType(eventType);
@@ -655,8 +654,7 @@
}
}
catch (const std::exception& e)
- {
- }
+ {}
if (pid)
{
diff --git a/extensions/openpower-pels/pel_entry.hpp b/extensions/openpower-pels/pel_entry.hpp
index be8360e..f42fc3b 100644
--- a/extensions/openpower-pels/pel_entry.hpp
+++ b/extensions/openpower-pels/pel_entry.hpp
@@ -11,7 +11,6 @@
class PELEntry : public PELEntryIface
{
-
public:
PELEntry() = delete;
PELEntry(const PELEntry&) = delete;
@@ -35,8 +34,7 @@
Repository* repo) :
PELEntryIface(bus, path.c_str(), prop, true),
_obmcId(id), _repo(repo)
- {
- }
+ {}
/** @brief Update managementSystemAck flag.
* @param[in] value - A true value says HMC acknowledged the PEL.
diff --git a/extensions/openpower-pels/pel_values.cpp b/extensions/openpower-pels/pel_values.cpp
index 6ccce2d..19b5210 100644
--- a/extensions/openpower-pels/pel_values.cpp
+++ b/extensions/openpower-pels/pel_values.cpp
@@ -330,7 +330,6 @@
std::string getValue(const uint8_t field, const pel_values::PELValues& values,
const uint8_t position)
{
-
auto tmp = pel_values::findByValue(field, values);
if (tmp != values.end())
{
diff --git a/extensions/openpower-pels/pldm_interface.cpp b/extensions/openpower-pels/pldm_interface.cpp
index c891a4a..dca8a2d 100644
--- a/extensions/openpower-pels/pldm_interface.cpp
+++ b/extensions/openpower-pels/pldm_interface.cpp
@@ -20,9 +20,10 @@
#include <systemd/sd-bus.h>
#include <unistd.h>
-#include <fstream>
#include <phosphor-logging/log.hpp>
+#include <fstream>
+
namespace openpower::pels
{
diff --git a/extensions/openpower-pels/pldm_interface.hpp b/extensions/openpower-pels/pldm_interface.hpp
index 61bb2a4..b6dae3c 100644
--- a/extensions/openpower-pels/pldm_interface.hpp
+++ b/extensions/openpower-pels/pldm_interface.hpp
@@ -4,12 +4,13 @@
#include <libpldm/pldm.h>
-#include <chrono>
-#include <memory>
#include <sdeventplus/clock.hpp>
#include <sdeventplus/source/io.hpp>
#include <sdeventplus/utility/timer.hpp>
+#include <chrono>
+#include <memory>
+
namespace openpower::pels
{
diff --git a/extensions/openpower-pels/registry.cpp b/extensions/openpower-pels/registry.cpp
index 578a67e..87d9875 100644
--- a/extensions/openpower-pels/registry.cpp
+++ b/extensions/openpower-pels/registry.cpp
@@ -19,9 +19,10 @@
#include "pel_types.hpp"
#include "pel_values.hpp"
-#include <fstream>
#include <phosphor-logging/log.hpp>
+#include <fstream>
+
namespace openpower
{
namespace pels
@@ -673,8 +674,8 @@
if (src.contains("Words6To9"))
{
- entry.src.hexwordADFields =
- helper::getSRCHexwordFields(src, name);
+ entry.src.hexwordADFields = helper::getSRCHexwordFields(src,
+ name);
}
if (src.contains("SymptomIDFields"))
diff --git a/extensions/openpower-pels/registry.hpp b/extensions/openpower-pels/registry.hpp
index c3b3bc0..f5888b3 100644
--- a/extensions/openpower-pels/registry.hpp
+++ b/extensions/openpower-pels/registry.hpp
@@ -1,8 +1,9 @@
#pragma once
#include "additional_data.hpp"
-#include <filesystem>
#include <nlohmann/json.hpp>
+
+#include <filesystem>
#include <optional>
#include <string>
#include <vector>
@@ -103,9 +104,7 @@
using AdditionalDataField = std::tuple<std::string, std::string>;
std::optional<std::map<WordNum, AdditionalDataField>> hexwordADFields;
- SRC() : type(0), reasonCode(0)
- {
- }
+ SRC() : type(0), reasonCode(0) {}
};
/**
@@ -225,8 +224,7 @@
*/
explicit Registry(const std::filesystem::path& registryFile) :
Registry(registryFile, true)
- {
- }
+ {}
/**
* @brief Constructor
@@ -242,8 +240,7 @@
bool loadCallouts) :
_registryFile(registryFile),
_loadCallouts(loadCallouts)
- {
- }
+ {}
/**
* @brief Find a registry entry based on its error name or reason code.
diff --git a/extensions/openpower-pels/repository.cpp b/extensions/openpower-pels/repository.cpp
index ee0d232..288d39a 100644
--- a/extensions/openpower-pels/repository.cpp
+++ b/extensions/openpower-pels/repository.cpp
@@ -17,10 +17,11 @@
#include <sys/stat.h>
-#include <fstream>
#include <phosphor-logging/log.hpp>
#include <xyz/openbmc_project/Common/File/error.hpp>
+#include <fstream>
+
namespace openpower
{
namespace pels
@@ -467,8 +468,8 @@
bool Repository::isServiceableSev(const PELAttributes& pel)
{
auto sevType = static_cast<SeverityType>(pel.severity & 0xF0);
- auto sevPVEntry =
- pel_values::findByValue(pel.severity, pel_values::severityValues);
+ auto sevPVEntry = pel_values::findByValue(pel.severity,
+ pel_values::severityValues);
std::string sevName = std::get<pel_values::registryNamePos>(*sevPVEntry);
bool check1 = (sevType == SeverityType::predictive) ||
diff --git a/extensions/openpower-pels/repository.hpp b/extensions/openpower-pels/repository.hpp
index 5845afd..a45a0d4 100644
--- a/extensions/openpower-pels/repository.hpp
+++ b/extensions/openpower-pels/repository.hpp
@@ -45,8 +45,7 @@
sizeOnDisk(size), creator(creator), subsystem(subsystem),
severity(sev), actionFlags(flags), hostState(hostState),
hmcState(hmcState)
- {
- }
+ {}
};
/**
@@ -61,33 +60,23 @@
struct Pel
{
uint32_t id;
- explicit Pel(uint32_t i) : id(i)
- {
- }
+ explicit Pel(uint32_t i) : id(i) {}
};
struct Obmc
{
uint32_t id;
- explicit Obmc(uint32_t i) : id(i)
- {
- }
+ explicit Obmc(uint32_t i) : id(i) {}
};
Pel pelID;
Obmc obmcID;
- LogID(Pel pel, Obmc obmc) : pelID(pel), obmcID(obmc)
- {
- }
+ LogID(Pel pel, Obmc obmc) : pelID(pel), obmcID(obmc) {}
- explicit LogID(Pel id) : pelID(id), obmcID(0)
- {
- }
+ explicit LogID(Pel id) : pelID(id), obmcID(0) {}
- explicit LogID(Obmc id) : pelID(0), obmcID(id)
- {
- }
+ explicit LogID(Obmc id) : pelID(0), obmcID(id) {}
LogID() = delete;
@@ -135,8 +124,7 @@
SizeStats() :
total(0), bmc(0), nonBMC(0), bmcServiceable(0), bmcInfo(0),
nonBMCServiceable(0), nonBMCInfo(0)
- {
- }
+ {}
};
Repository() = delete;
@@ -153,8 +141,7 @@
*/
explicit Repository(const std::filesystem::path& basePath) :
Repository(basePath, getPELRepoSize(), getMaxNumPELs())
- {
- }
+ {}
/**
* @brief Constructor that takes the repository size
diff --git a/extensions/openpower-pels/sbe_ffdc_handler.cpp b/extensions/openpower-pels/sbe_ffdc_handler.cpp
index 7d02693..30dcfee 100644
--- a/extensions/openpower-pels/sbe_ffdc_handler.cpp
+++ b/extensions/openpower-pels/sbe_ffdc_handler.cpp
@@ -14,7 +14,8 @@
* limitations under the License.
*/
-extern "C" {
+extern "C"
+{
#include <libpdbg.h>
}
@@ -27,9 +28,10 @@
#include <fmt/format.h>
#include <libekb.H>
-#include <new>
#include <phosphor-logging/log.hpp>
+#include <new>
+
namespace openpower
{
namespace pels
diff --git a/extensions/openpower-pels/sbe_ffdc_handler.hpp b/extensions/openpower-pels/sbe_ffdc_handler.hpp
index 5572ff6..12c3225 100644
--- a/extensions/openpower-pels/sbe_ffdc_handler.hpp
+++ b/extensions/openpower-pels/sbe_ffdc_handler.hpp
@@ -98,7 +98,6 @@
*/
~SbeFFDC()
{
-
try
{
for (auto path : paths)
diff --git a/extensions/openpower-pels/section_header.hpp b/extensions/openpower-pels/section_header.hpp
index 139fc5d..918a198 100644
--- a/extensions/openpower-pels/section_header.hpp
+++ b/extensions/openpower-pels/section_header.hpp
@@ -21,9 +21,7 @@
/**
* @brief Constructor
*/
- SectionHeader() : id(0), size(0), version(0), subType(0), componentID(0)
- {
- }
+ SectionHeader() : id(0), size(0), version(0), subType(0), componentID(0) {}
/**
* @brief Constructor
@@ -38,8 +36,7 @@
uint16_t componentID) :
id(id),
size(size), version(version), subType(subType), componentID(componentID)
- {
- }
+ {}
/**
* @brief A two character ASCII field which identifies the section type.
diff --git a/extensions/openpower-pels/service_indicators.cpp b/extensions/openpower-pels/service_indicators.cpp
index d2a9b43..5327129 100644
--- a/extensions/openpower-pels/service_indicators.cpp
+++ b/extensions/openpower-pels/service_indicators.cpp
@@ -17,9 +17,10 @@
#include <fmt/format.h>
-#include <bitset>
#include <phosphor-logging/log.hpp>
+#include <bitset>
+
namespace openpower::pels::service_indicators
{
@@ -202,8 +203,8 @@
{
try
{
- auto inventoryPath =
- _dataIface.getInventoryFromLocCode(locCode, 0, true);
+ auto inventoryPath = _dataIface.getInventoryFromLocCode(locCode, 0,
+ true);
paths.push_back(std::move(inventoryPath));
}
catch (const std::exception& e)
diff --git a/extensions/openpower-pels/service_indicators.hpp b/extensions/openpower-pels/service_indicators.hpp
index 1cb61a9..e45a448 100644
--- a/extensions/openpower-pels/service_indicators.hpp
+++ b/extensions/openpower-pels/service_indicators.hpp
@@ -27,8 +27,7 @@
* @param[in] dataIface - The DataInterface object
*/
explicit Policy(const DataInterfaceBase& dataIface) : _dataIface(dataIface)
- {
- }
+ {}
/**
* @brief Pure virtual function for activating service indicators
@@ -70,8 +69,7 @@
* @param[in] dataIface - The DataInterface object
*/
explicit LightPath(const DataInterfaceBase& dataIface) : Policy(dataIface)
- {
- }
+ {}
/**
* @brief Turns on LEDs for certain FRUs called out in the PEL.
diff --git a/extensions/openpower-pels/src.cpp b/extensions/openpower-pels/src.cpp
index 4c076c9..33e6082 100644
--- a/extensions/openpower-pels/src.cpp
+++ b/extensions/openpower-pels/src.cpp
@@ -23,6 +23,7 @@
#include <Python.h>
#include <nlohmann/json.hpp>
+
#include <sstream>
#endif
#include <fmt/format.h>
@@ -203,8 +204,8 @@
{
std::unique_ptr<PyObject, decltype(&pyDecRef)> resPtr(
pResult, &pyDecRef);
- PyObject* pBytes =
- PyUnicode_AsEncodedString(pResult, "utf-8", "~E~");
+ PyObject* pBytes = PyUnicode_AsEncodedString(pResult, "utf-8",
+ "~E~");
std::unique_ptr<PyObject, decltype(&pyDecRef)> pyBytePtr(
pBytes, &pyDecRef);
const char* output = PyBytes_AS_STRING(pBytes);
@@ -361,8 +362,8 @@
if (ss)
{
auto eventSubsystem = std::stoul(*ss, NULL, 16);
- std::string subsystem =
- pv::getValue(eventSubsystem, pel_values::subsystemValues);
+ std::string subsystem = pv::getValue(eventSubsystem,
+ pel_values::subsystemValues);
if (subsystem == "invalid")
{
log<level::WARNING>(
@@ -400,8 +401,8 @@
// Can only set words 6 - 9
if (!isUserDefinedWord(wordNum))
{
- std::string msg =
- "SRC user data word out of range: " + std::to_string(wordNum);
+ std::string msg = "SRC user data word out of range: " +
+ std::to_string(wordNum);
addDebugData(msg);
continue;
}
@@ -812,8 +813,8 @@
const nlohmann::json& jsonCallouts,
const DataInterfaceBase& dataIface)
{
- auto registryCallouts =
- getRegistryCallouts(regEntry, additionalData, dataIface);
+ auto registryCallouts = getRegistryCallouts(regEntry, additionalData,
+ dataIface);
auto item = additionalData.getValue("CALLOUT_INVENTORY_PATH");
auto priority = additionalData.getValue("CALLOUT_PRIORITY");
@@ -881,16 +882,16 @@
{
dataIface.getHWCalloutFields(inventoryPath, fn, ccin, sn);
- CalloutPriority p =
- priority ? priority.value() : CalloutPriority::high;
+ CalloutPriority p = priority ? priority.value()
+ : CalloutPriority::high;
- callout =
- std::make_unique<src::Callout>(p, locCode, fn, ccin, sn, mrus);
+ callout = std::make_unique<src::Callout>(p, locCode, fn, ccin, sn,
+ mrus);
}
catch (const sdbusplus::exception_t& e)
{
- std::string msg =
- "No VPD found for " + inventoryPath + ": " + e.what();
+ std::string msg = "No VPD found for " + inventoryPath + ": " +
+ e.what();
addDebugData(msg);
// Just create the callout with empty FRU fields
@@ -980,8 +981,8 @@
}
catch (const std::exception& e)
{
- std::string msg =
- "Error parsing PEL message registry callout JSON: "s + e.what();
+ std::string msg = "Error parsing PEL message registry callout JSON: "s +
+ e.what();
addDebugData(msg);
}
}
@@ -1002,8 +1003,8 @@
}
catch (const std::exception& e)
{
- auto msg =
- "Unable to expand location code " + locCode + ": " + e.what();
+ auto msg = "Unable to expand location code " + locCode + ": " +
+ e.what();
addDebugData(msg);
return;
}
@@ -1011,8 +1012,8 @@
// Via the PEL values table, get the priority enum.
// The schema will have validated the priority was a valid value.
- auto priorityIt =
- pv::findByName(regCallout.priority, pv::calloutPriorityValues);
+ auto priorityIt = pv::findByName(regCallout.priority,
+ pv::calloutPriorityValues);
assert(priorityIt != pv::calloutPriorityValues.end());
auto priority =
static_cast<CalloutPriority>(std::get<pv::fieldValuePos>(*priorityIt));
@@ -1020,8 +1021,8 @@
if (!regCallout.procedure.empty())
{
// Procedure callout
- callout =
- std::make_unique<src::Callout>(priority, regCallout.procedure);
+ callout = std::make_unique<src::Callout>(priority,
+ regCallout.procedure);
}
else if (!regCallout.symbolicFRU.empty())
{
diff --git a/extensions/openpower-pels/src.hpp b/extensions/openpower-pels/src.hpp
index 2ab5ae4..62b7699 100644
--- a/extensions/openpower-pels/src.hpp
+++ b/extensions/openpower-pels/src.hpp
@@ -100,8 +100,7 @@
SRC(const message::Entry& regEntry, const AdditionalData& additionalData,
const DataInterfaceBase& dataIface) :
SRC(regEntry, additionalData, nlohmann::json{}, dataIface)
- {
- }
+ {}
/**
* @brief Constructor
diff --git a/extensions/openpower-pels/stream.hpp b/extensions/openpower-pels/stream.hpp
index 0785f0e..c19b387 100644
--- a/extensions/openpower-pels/stream.hpp
+++ b/extensions/openpower-pels/stream.hpp
@@ -61,9 +61,7 @@
*
* @param[in] data - the vector of data
*/
- explicit Stream(std::vector<uint8_t>& data) : _data(data), _offset(0)
- {
- }
+ explicit Stream(std::vector<uint8_t>& data) : _data(data), _offset(0) {}
/**
* @brief Constructor
diff --git a/extensions/openpower-pels/temporary_file.cpp b/extensions/openpower-pels/temporary_file.cpp
index 5c52ccc..7ff1365 100644
--- a/extensions/openpower-pels/temporary_file.cpp
+++ b/extensions/openpower-pels/temporary_file.cpp
@@ -18,8 +18,8 @@
TemporaryFile::TemporaryFile(const char* data, const uint32_t len)
{
// Build template path required by mkstemp()
- std::string templatePath =
- fs::temp_directory_path() / "phosphor-logging-XXXXXX";
+ std::string templatePath = fs::temp_directory_path() /
+ "phosphor-logging-XXXXXX";
// Generate unique file name, create file, and open it. The XXXXXX
// characters are replaced by mkstemp() to make the file name unique.
diff --git a/extensions/openpower-pels/temporary_file.hpp b/extensions/openpower-pels/temporary_file.hpp
index 76c9e6a..fd5c7d7 100644
--- a/extensions/openpower-pels/temporary_file.hpp
+++ b/extensions/openpower-pels/temporary_file.hpp
@@ -73,9 +73,7 @@
/**
* Destructor.
*/
- ~TemporaryFile()
- {
- }
+ ~TemporaryFile() {}
/**
* Deletes the temporary file.
diff --git a/extensions/openpower-pels/tools/peltool.cpp b/extensions/openpower-pels/tools/peltool.cpp
index a45be58..f6329cc 100644
--- a/extensions/openpower-pels/tools/peltool.cpp
+++ b/extensions/openpower-pels/tools/peltool.cpp
@@ -15,6 +15,8 @@
*/
#include "config.h"
+#include "config_main.h"
+
#include "../bcd_time.hpp"
#include "../json_utils.hpp"
#include "../paths.hpp"
@@ -25,15 +27,14 @@
#include <Python.h>
#include <CLI/CLI.hpp>
+#include <phosphor-logging/log.hpp>
+
#include <bitset>
#include <fstream>
#include <iostream>
-#include <phosphor-logging/log.hpp>
#include <regex>
#include <string>
-#include "config_main.h"
-
namespace fs = std::filesystem;
using namespace phosphor::logging;
using namespace openpower::pels;
@@ -671,8 +672,8 @@
{
if (hexDump)
{
- std::string dstr =
- dumpHex(std::data(pel.data()), pel.size(), 0, false);
+ std::string dstr = dumpHex(std::data(pel.data()), pel.size(), 0,
+ false);
std::cout << dstr << std::endl;
}
else
@@ -878,8 +879,8 @@
PEL pel{data};
if (hexDump)
{
- std::string dstr =
- dumpHex(std::data(pel.data()), pel.size(), 0, false);
+ std::string dstr = dumpHex(std::data(pel.data()), pel.size(), 0,
+ false);
std::cout << dstr << std::endl;
}
else
diff --git a/extensions/openpower-pels/user_data_json.cpp b/extensions/openpower-pels/user_data_json.cpp
index da8b233..bf6152b 100644
--- a/extensions/openpower-pels/user_data_json.cpp
+++ b/extensions/openpower-pels/user_data_json.cpp
@@ -24,9 +24,10 @@
#include <Python.h>
-#include <iomanip>
#include <nlohmann/json.hpp>
#include <phosphor-logging/log.hpp>
+
+#include <iomanip>
#include <sstream>
namespace openpower::pels::user_data
@@ -329,8 +330,8 @@
{
std::unique_ptr<PyObject, decltype(&pyDecRef)> resPtr(
pResult, &pyDecRef);
- PyObject* pBytes =
- PyUnicode_AsEncodedString(pResult, "utf-8", "~E~");
+ PyObject* pBytes = PyUnicode_AsEncodedString(pResult, "utf-8",
+ "~E~");
std::unique_ptr<PyObject, decltype(&pyDecRef)> pyBytePtr(
pBytes, &pyDecRef);
const char* output = PyBytes_AS_STRING(pBytes);
diff --git a/extensions/openpower-pels/user_header.cpp b/extensions/openpower-pels/user_header.cpp
index 49da47a..da42bbf 100644
--- a/extensions/openpower-pels/user_header.cpp
+++ b/extensions/openpower-pels/user_header.cpp
@@ -22,9 +22,10 @@
#include <fmt/format.h>
-#include <iostream>
#include <phosphor-logging/log.hpp>
+#include <iostream>
+
namespace openpower
{
namespace pels
@@ -65,8 +66,8 @@
if (ss)
{
auto eventSubsystem = std::stoul(*ss, NULL, 16);
- std::string subsystemString =
- pv::getValue(eventSubsystem, pel_values::subsystemValues);
+ std::string subsystemString = pv::getValue(eventSubsystem,
+ pel_values::subsystemValues);
if (subsystemString == "invalid")
{
log<level::WARNING>(
@@ -265,8 +266,8 @@
subsystem = pv::getValue(_eventSubsystem, pel_values::subsystemValues);
eventScope = pv::getValue(_eventScope, pel_values::eventScopeValues);
eventType = pv::getValue(_eventType, pel_values::eventTypeValues);
- actionFlags =
- pv::getValuesBitwise(_actionFlags, pel_values::actionFlagsValues);
+ actionFlags = pv::getValuesBitwise(_actionFlags,
+ pel_values::actionFlagsValues);
std::string hostState{"Invalid"};
std::string hmcState{"Invalid"};