clang-format: update latest spec and reformat
Copy the latest format file from the docs repository and apply.
Change-Id: Id8301a67d945f8a3d1ceb87ae59087100338119c
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/.clang-format b/.clang-format
index a75a2c2..e5530e6 100644
--- a/.clang-format
+++ b/.clang-format
@@ -104,7 +104,7 @@
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
-PenaltyReturnTypeOnItsOwnLine: 60
+PenaltyReturnTypeOnItsOwnLine: 150
PenaltyIndentedWhitespace: 1
PointerAlignment: Left
QualifierAlignment: Left
diff --git a/vpd-manager/include/backup_restore.hpp b/vpd-manager/include/backup_restore.hpp
index 12ec384..d3cd467 100644
--- a/vpd-manager/include/backup_restore.hpp
+++ b/vpd-manager/include/backup_restore.hpp
@@ -71,8 +71,8 @@
*
* @param[in] i_status - Status to set.
*/
- static void
- setBackupAndRestoreStatus(const BackupAndRestoreStatus& i_status);
+ static void setBackupAndRestoreStatus(
+ const BackupAndRestoreStatus& i_status);
private:
/**
diff --git a/vpd-manager/include/bios_handler.hpp b/vpd-manager/include/bios_handler.hpp
index 916811e..893a638 100644
--- a/vpd-manager/include/bios_handler.hpp
+++ b/vpd-manager/include/bios_handler.hpp
@@ -81,8 +81,8 @@
* @param[in] attributeName - Attribute to be read.
* @return - Bios attribute current value.
*/
- types::BiosAttributeCurrentValue
- readBiosAttribute(const std::string& attributeName);
+ types::BiosAttributeCurrentValue readBiosAttribute(
+ const std::string& attributeName);
/**
* @brief API to process "hb_field_core_override" attribute.
diff --git a/vpd-manager/include/ddimm_parser.hpp b/vpd-manager/include/ddimm_parser.hpp
index a53ed17..7289774 100644
--- a/vpd-manager/include/ddimm_parser.hpp
+++ b/vpd-manager/include/ddimm_parser.hpp
@@ -74,8 +74,8 @@
* @param[in] i_iterator - iterator to buffer containing VPD
* @return calculated size or 0 in case of any error.
*/
- size_t
- getDdr5BasedDdimmSize(types::BinaryVector::const_iterator i_iterator);
+ size_t getDdr5BasedDdimmSize(
+ types::BinaryVector::const_iterator i_iterator);
/**
* @brief This function calculates DDR4 based DDIMM's capacity
@@ -83,8 +83,8 @@
* @param[in] i_iterator - iterator to buffer containing VPD
* @return calculated size or 0 in case of any error.
*/
- size_t
- getDdr4BasedDdimmSize(types::BinaryVector::const_iterator i_iterator);
+ size_t getDdr4BasedDdimmSize(
+ types::BinaryVector::const_iterator i_iterator);
/**
* @brief This function calculates DDR5 based die per package
diff --git a/vpd-manager/include/ipz_parser.hpp b/vpd-manager/include/ipz_parser.hpp
index 2d50ddd..b41b7b6 100644
--- a/vpd-manager/include/ipz_parser.hpp
+++ b/vpd-manager/include/ipz_parser.hpp
@@ -87,8 +87,8 @@
*
* @return On success return the value read. On failure throw exception.
*/
- types::DbusVariantType
- readKeywordFromHardware(const types::ReadVpdParams i_paramsToReadData);
+ types::DbusVariantType readKeywordFromHardware(
+ const types::ReadVpdParams i_paramsToReadData);
/**
* @brief API to write keyword's value on hardware.
@@ -174,8 +174,8 @@
* @param[in] iterator - pointer to the start of keywords under the record.
* @return keyword-value map of keywords under that record.
*/
- types::IPZVpdMap::mapped_type
- readKeywords(types::BinaryVector::const_iterator& itrToKwds);
+ types::IPZVpdMap::mapped_type readKeywords(
+ types::BinaryVector::const_iterator& itrToKwds);
/**
* @brief API to process a record.
@@ -211,9 +211,9 @@
* @return On success return record's details, on failure return empty
* buffer.
*/
- types::RecordData
- getRecordDetailsFromVTOC(const types::Record& l_recordName,
- const types::RecordOffset& i_vtocOffset);
+ types::RecordData getRecordDetailsFromVTOC(
+ const types::Record& l_recordName,
+ const types::RecordOffset& i_vtocOffset);
/**
* @brief API to update record's ECC
diff --git a/vpd-manager/include/isdimm_parser.hpp b/vpd-manager/include/isdimm_parser.hpp
index 5cd3d87..4a6d21b 100644
--- a/vpd-manager/include/isdimm_parser.hpp
+++ b/vpd-manager/include/isdimm_parser.hpp
@@ -49,8 +49,8 @@
* @param[in] i_iterator - iterator to buffer containing SPD
* @return- map of kwd:value
*/
- types::JedecSpdMap
- readKeywords(types::BinaryVector::const_iterator& i_iterator);
+ types::JedecSpdMap readKeywords(
+ types::BinaryVector::const_iterator& i_iterator);
/**
* @brief This function calculates DIMM size from DDR4 SPD
@@ -66,8 +66,8 @@
* @param[in] i_iterator - iterator to buffer containing SPD
* @return calculated part number or a default value.
*/
- std::string_view
- getDDR4PartNumber(types::BinaryVector::const_iterator& i_iterator);
+ std::string_view getDDR4PartNumber(
+ types::BinaryVector::const_iterator& i_iterator);
/**
* @brief This function calculates serial number from DDR4 SPD
@@ -75,8 +75,8 @@
* @param[in] i_iterator - iterator to buffer containing SPD
* @return calculated serial number or a default value.
*/
- std::string
- getDDR4SerialNumber(types::BinaryVector::const_iterator& i_iterator);
+ std::string getDDR4SerialNumber(
+ types::BinaryVector::const_iterator& i_iterator);
/**
* @brief This function allocates FRU number based on part number
@@ -88,9 +88,9 @@
* @param[in] i_iterator - iterator to buffer containing SPD
* @return allocated FRU number or a default value
*/
- std::string_view
- getDDR4FruNumber(const std::string& i_partNumber,
- types::BinaryVector::const_iterator& i_iterator);
+ std::string_view getDDR4FruNumber(
+ const std::string& i_partNumber,
+ types::BinaryVector::const_iterator& i_iterator);
/**
* @brief This function allocates CCIN based on part number for DDR4 SPD
diff --git a/vpd-manager/include/manager.hpp b/vpd-manager/include/manager.hpp
index 73d82c2..4a6a9ef 100644
--- a/vpd-manager/include/manager.hpp
+++ b/vpd-manager/include/manager.hpp
@@ -107,9 +107,9 @@
* @return On success returns the read value in variant of array of bytes.
* On failure throws exception.
*/
- types::DbusVariantType
- readKeyword(const types::Path i_fruPath,
- const types::ReadVpdParams i_paramsToReadData);
+ types::DbusVariantType readKeyword(
+ const types::Path i_fruPath,
+ const types::ReadVpdParams i_paramsToReadData);
/**
* @brief Collect single FRU VPD
@@ -214,8 +214,8 @@
*
* @return Location code in unexpanded format and its node number.
*/
- std::tuple<std::string, uint16_t>
- getUnexpandedLocationCode(const std::string& i_expandedLocationCode);
+ std::tuple<std::string, uint16_t> getUnexpandedLocationCode(
+ const std::string& i_expandedLocationCode);
private:
#ifdef IBM_SYSTEM
diff --git a/vpd-manager/include/parser_factory.hpp b/vpd-manager/include/parser_factory.hpp
index 819ec59..22e5d3b 100644
--- a/vpd-manager/include/parser_factory.hpp
+++ b/vpd-manager/include/parser_factory.hpp
@@ -43,8 +43,8 @@
*
* @return - Pointer to concrete parser class object.
*/
- static std::shared_ptr<ParserInterface>
- getParser(const types::BinaryVector& i_vpdVector,
- const std::string& i_vpdFilePath, size_t i_vpdStartOffset);
+ static std::shared_ptr<ParserInterface> getParser(
+ const types::BinaryVector& i_vpdVector,
+ const std::string& i_vpdFilePath, size_t i_vpdStartOffset);
};
} // namespace vpd
diff --git a/vpd-manager/include/parser_interface.hpp b/vpd-manager/include/parser_interface.hpp
index 0ff2862..3b12089 100644
--- a/vpd-manager/include/parser_interface.hpp
+++ b/vpd-manager/include/parser_interface.hpp
@@ -33,8 +33,8 @@
*
* @return keyword's value on successful read. Exception on failure.
*/
- virtual types::DbusVariantType
- readKeywordFromHardware(const types::ReadVpdParams)
+ virtual types::DbusVariantType readKeywordFromHardware(
+ const types::ReadVpdParams)
{
return types::DbusVariantType();
}
@@ -54,8 +54,8 @@
* @return On success returns number of bytes written on hardware, On
* failure returns -1.
*/
- virtual int
- writeKeywordOnHardware(const types::WriteVpdParams i_paramsToWriteData)
+ virtual int writeKeywordOnHardware(
+ const types::WriteVpdParams i_paramsToWriteData)
{
(void)i_paramsToWriteData;
return -1;
diff --git a/vpd-manager/include/utility/dbus_utility.hpp b/vpd-manager/include/utility/dbus_utility.hpp
index 4c81815..27014df 100644
--- a/vpd-manager/include/utility/dbus_utility.hpp
+++ b/vpd-manager/include/utility/dbus_utility.hpp
@@ -127,9 +127,9 @@
* success. If failed, empty map.
*/
-inline types::MapperGetSubTree
- getObjectSubTree(const std::string& i_objectPath, const int& i_depth,
- const std::vector<std::string>& i_interfaces)
+inline types::MapperGetSubTree getObjectSubTree(
+ const std::string& i_objectPath, const int& i_depth,
+ const std::vector<std::string>& i_interfaces)
{
types::MapperGetSubTree l_subTreeMap;
@@ -343,8 +343,8 @@
* @return Tuple of PLDM attribute Type, current attribute value and pending
* attribute value.
*/
-inline types::BiosAttributeCurrentValue
- biosGetAttributeMethodCall(const std::string& i_attributeName)
+inline types::BiosAttributeCurrentValue biosGetAttributeMethodCall(
+ const std::string& i_attributeName)
{
auto l_bus = sdbusplus::bus::new_default();
auto l_method = l_bus.new_method_call(
diff --git a/vpd-manager/include/utility/json_utility.hpp b/vpd-manager/include/utility/json_utility.hpp
index a43682c..764fb66 100644
--- a/vpd-manager/include/utility/json_utility.hpp
+++ b/vpd-manager/include/utility/json_utility.hpp
@@ -730,8 +730,8 @@
*
* @return list of FRUs parameters that needs polling.
*/
-inline std::vector<std::string>
- getListOfGpioPollingFrus(const nlohmann::json& i_sysCfgJsonObj)
+inline std::vector<std::string> getListOfGpioPollingFrus(
+ const nlohmann::json& i_sysCfgJsonObj)
{
if (i_sysCfgJsonObj.empty())
{
@@ -1006,8 +1006,8 @@
*
* @return - List of FRUs replaceable at standby.
*/
-inline std::vector<std::string>
- getListOfFrusReplaceableAtStandby(const nlohmann::json& i_sysCfgJsonObj)
+inline std::vector<std::string> getListOfFrusReplaceableAtStandby(
+ const nlohmann::json& i_sysCfgJsonObj)
{
std::vector<std::string> l_frusReplaceableAtStandby;
diff --git a/vpd-manager/include/utility/vpd_specific_utility.hpp b/vpd-manager/include/utility/vpd_specific_utility.hpp
index 9e679a7..3253105 100644
--- a/vpd-manager/include/utility/vpd_specific_utility.hpp
+++ b/vpd-manager/include/utility/vpd_specific_utility.hpp
@@ -225,9 +225,9 @@
* @return Expanded location code. In case of any error, unexpanded is returned
* as it is.
*/
-inline std::string
- getExpandedLocationCode(const std::string& unexpandedLocationCode,
- const types::VPDMapVariant& parsedVpdMap)
+inline std::string getExpandedLocationCode(
+ const std::string& unexpandedLocationCode,
+ const types::VPDMapVariant& parsedVpdMap)
{
auto expanded{unexpandedLocationCode};
diff --git a/vpd-manager/include/worker.hpp b/vpd-manager/include/worker.hpp
index a9725c3..f364964 100644
--- a/vpd-manager/include/worker.hpp
+++ b/vpd-manager/include/worker.hpp
@@ -174,8 +174,8 @@
* @return Tuple of status and file path. Status, true if successfull else
* false.
*/
- std::tuple<bool, std::string>
- parseAndPublishVPD(const std::string& i_vpdFilePath);
+ std::tuple<bool, std::string> parseAndPublishVPD(
+ const std::string& i_vpdFilePath);
/**
* @brief An API to set appropriate device tree and JSON.
@@ -495,8 +495,8 @@
*
* @return - Formed asset tag string.
*/
- std::string
- createAssetTagString(const types::VPDMapVariant& i_parsedVpdMap);
+ std::string createAssetTagString(
+ const types::VPDMapVariant& i_parsedVpdMap);
/**
* @brief API to prime system blueprint.
diff --git a/vpd-manager/src/bios_handler.cpp b/vpd-manager/src/bios_handler.cpp
index 463bfb7..59094e0 100644
--- a/vpd-manager/src/bios_handler.cpp
+++ b/vpd-manager/src/bios_handler.cpp
@@ -170,8 +170,8 @@
processKeepAndClear();
}
-types::BiosAttributeCurrentValue
- IbmBiosHandler::readBiosAttribute(const std::string& i_attributeName)
+types::BiosAttributeCurrentValue IbmBiosHandler::readBiosAttribute(
+ const std::string& i_attributeName)
{
types::BiosAttributeCurrentValue l_attrValueVariant =
dbusUtility::biosGetAttributeMethodCall(i_attributeName);
@@ -710,8 +710,8 @@
logging::logMessage("Invalid type recieved for keep and clear from VPD.");
}
-void
- IbmBiosHandler::saveKeepAndClearToBios(const std::string& i_KeepAndClearVal)
+void IbmBiosHandler::saveKeepAndClearToBios(
+ const std::string& i_KeepAndClearVal)
{
// checking for exact length as it is a string and can have garbage value.
if (i_KeepAndClearVal.size() != constants::VALUE_1)
diff --git a/vpd-manager/src/ddimm_parser.cpp b/vpd-manager/src/ddimm_parser.cpp
index a480000..6f36c60 100644
--- a/vpd-manager/src/ddimm_parser.cpp
+++ b/vpd-manager/src/ddimm_parser.cpp
@@ -325,8 +325,8 @@
return l_dimmSize;
}
-size_t
- DdimmVpdParser::getDdimmSize(types::BinaryVector::const_iterator i_iterator)
+size_t DdimmVpdParser::getDdimmSize(
+ types::BinaryVector::const_iterator i_iterator)
{
size_t l_dimmSize = 0;
if (i_iterator[constants::SPD_BYTE_2] == constants::SPD_DRAM_TYPE_DDR5)
@@ -346,8 +346,8 @@
return l_dimmSize;
}
-void
- DdimmVpdParser::readKeywords(types::BinaryVector::const_iterator i_iterator)
+void DdimmVpdParser::readKeywords(
+ types::BinaryVector::const_iterator i_iterator)
{
// collect DDIMM size value
auto l_dimmSize = getDdimmSize(i_iterator);
diff --git a/vpd-manager/src/ipz_parser.cpp b/vpd-manager/src/ipz_parser.cpp
index 4300e12..f2dfa2b 100644
--- a/vpd-manager/src/ipz_parser.cpp
+++ b/vpd-manager/src/ipz_parser.cpp
@@ -326,8 +326,8 @@
return recordOffsets;
}
-types::IPZVpdMap::mapped_type
- IpzVpdParser::readKeywords(types::BinaryVector::const_iterator& itrToKwds)
+types::IPZVpdMap::mapped_type IpzVpdParser::readKeywords(
+ types::BinaryVector::const_iterator& itrToKwds)
{
types::IPZVpdMap::mapped_type kwdValueMap{};
while (true)
diff --git a/vpd-manager/src/manager.cpp b/vpd-manager/src/manager.cpp
index 1e3f3d5..e006f56 100644
--- a/vpd-manager/src/manager.cpp
+++ b/vpd-manager/src/manager.cpp
@@ -688,8 +688,8 @@
return l_inventoryPaths;
}
-std::string
- Manager::getHwPath(const sdbusplus::message::object_path& i_dbusObjPath)
+std::string Manager::getHwPath(
+ const sdbusplus::message::object_path& i_dbusObjPath)
{
// Dummy code to supress unused variable warning. To be removed.
logging::logMessage(std::string(i_dbusObjPath));
diff --git a/vpd-manager/src/worker.cpp b/vpd-manager/src/worker.cpp
index c1e6b38..f1758fb 100644
--- a/vpd-manager/src/worker.cpp
+++ b/vpd-manager/src/worker.cpp
@@ -1151,8 +1151,8 @@
}
}
-std::string
- Worker::createAssetTagString(const types::VPDMapVariant& i_parsedVpdMap)
+std::string Worker::createAssetTagString(
+ const types::VPDMapVariant& i_parsedVpdMap)
{
std::string l_assetTag;
@@ -1416,8 +1416,8 @@
}
}
-std::tuple<bool, std::string>
- Worker::parseAndPublishVPD(const std::string& i_vpdFilePath)
+std::tuple<bool, std::string> Worker::parseAndPublishVPD(
+ const std::string& i_vpdFilePath)
{
try
{
diff --git a/vpd-tool/include/tool_utils.hpp b/vpd-tool/include/tool_utils.hpp
index 4306da5..598cdd2 100644
--- a/vpd-tool/include/tool_utils.hpp
+++ b/vpd-tool/include/tool_utils.hpp
@@ -189,9 +189,9 @@
*
* @throw std::runtime_error, sdbusplus::exception::SdBusError
*/
-inline types::DbusVariantType
- readKeywordFromHardware(const std::string& i_eepromPath,
- const types::ReadVpdParams i_paramsToReadData)
+inline types::DbusVariantType readKeywordFromHardware(
+ const std::string& i_eepromPath,
+ const types::ReadVpdParams i_paramsToReadData)
{
if (i_eepromPath.empty())
{
@@ -355,9 +355,9 @@
*
* @throw - std::runtime_error, sdbusplus::exception::SdBusError
*/
-inline int
- writeKeywordOnHardware(const std::string& i_eepromPath,
- const types::WriteVpdParams& i_paramsToWriteData)
+inline int writeKeywordOnHardware(
+ const std::string& i_eepromPath,
+ const types::WriteVpdParams& i_paramsToWriteData)
{
if (i_eepromPath.empty())
{
diff --git a/vpd-tool/include/vpd_tool.hpp b/vpd-tool/include/vpd_tool.hpp
index f26a0a3..7898d00 100644
--- a/vpd-tool/include/vpd_tool.hpp
+++ b/vpd-tool/include/vpd_tool.hpp
@@ -77,8 +77,8 @@
* format, otherwise returns empty JSON. The caller of this API should
* handle empty JSON.
*/
- nlohmann::json
- getFruTypeProperty(const std::string& i_objectPath) const noexcept;
+ nlohmann::json getFruTypeProperty(
+ const std::string& i_objectPath) const noexcept;
/**
* @brief Check if a FRU is present in the system.
diff --git a/vpd-tool/src/vpd_tool.cpp b/vpd-tool/src/vpd_tool.cpp
index ce10e6c..1291129 100644
--- a/vpd-tool/src/vpd_tool.cpp
+++ b/vpd-tool/src/vpd_tool.cpp
@@ -626,8 +626,8 @@
return l_returnValue;
}
-nlohmann::json
- VpdTool::getFruTypeProperty(const std::string& i_objectPath) const noexcept
+nlohmann::json VpdTool::getFruTypeProperty(
+ const std::string& i_objectPath) const noexcept
{
nlohmann::json l_resultInJson = nlohmann::json::object({});
std::vector<std::string> l_pimInfList;