Skip to content

Commit 2529115

Browse files
williamspatrickspinler
authored andcommitted
clang-format: update latest spec and reformat
Copy the latest format file from the docs repository and apply. Change-Id: Iac96affe709a51dd865117d006cb033cf5c624b1 Signed-off-by: Patrick Williams <[email protected]>
1 parent 963683a commit 2529115

29 files changed

+147
-147
lines changed

.clang-format

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ PenaltyBreakFirstLessLess: 120
104104
PenaltyBreakString: 1000
105105
PenaltyBreakTemplateDeclaration: 10
106106
PenaltyExcessCharacter: 1000000
107-
PenaltyReturnTypeOnItsOwnLine: 60
107+
PenaltyReturnTypeOnItsOwnLine: 150
108108
PenaltyIndentedWhitespace: 1
109109
PointerAlignment: Left
110110
QualifierAlignment: Left

extensions/openpower-pels/data_interface.cpp

+8-8
Original file line numberDiff line numberDiff line change
@@ -465,8 +465,8 @@ void DataInterface::getHWCalloutFields(
465465
serialNumber = std::string{value.begin(), value.end()};
466466
}
467467

468-
std::string
469-
DataInterface::getLocationCode(const std::string& inventoryPath) const
468+
std::string DataInterface::getLocationCode(
469+
const std::string& inventoryPath) const
470470
{
471471
auto service = getService(inventoryPath, interface::locCode);
472472

@@ -477,8 +477,8 @@ std::string
477477
return std::get<std::string>(locCode);
478478
}
479479

480-
std::string
481-
DataInterface::addLocationCodePrefix(const std::string& locationCode)
480+
std::string DataInterface::addLocationCodePrefix(
481+
const std::string& locationCode)
482482
{
483483
static const std::string locationCodePrefix{"Ufcs-"};
484484

@@ -820,8 +820,8 @@ std::vector<uint8_t> DataInterface::getRawProgressSRC(void) const
820820
return std::get<1>(rawProgress);
821821
}
822822

823-
std::optional<std::vector<uint8_t>>
824-
DataInterface::getDIProperty(const std::string& locationCode) const
823+
std::optional<std::vector<uint8_t>> DataInterface::getDIProperty(
824+
const std::string& locationCode) const
825825
{
826826
std::vector<uint8_t> viniDI;
827827

@@ -850,8 +850,8 @@ std::optional<std::vector<uint8_t>>
850850
return viniDI;
851851
}
852852

853-
std::optional<bool>
854-
DataInterfaceBase::isDIMMLocCode(const std::string& locCode) const
853+
std::optional<bool> DataInterfaceBase::isDIMMLocCode(
854+
const std::string& locCode) const
855855
{
856856
if (_locationCache.contains(locCode))
857857
{

extensions/openpower-pels/data_interface.hpp

+24-24
Original file line numberDiff line numberDiff line change
@@ -355,8 +355,8 @@ class DataInterfaceBase
355355
*
356356
* @return std::string - The location code
357357
*/
358-
virtual std::string
359-
getLocationCode(const std::string& inventoryPath) const = 0;
358+
virtual std::string getLocationCode(
359+
const std::string& inventoryPath) const = 0;
360360

361361
/**
362362
* @brief Get the list of system type names the system is called.
@@ -398,9 +398,9 @@ class DataInterfaceBase
398398
*
399399
* @return std::vector<std::string> - The inventory D-Bus objects
400400
*/
401-
virtual std::vector<std::string>
402-
getInventoryFromLocCode(const std::string& LocationCode, uint16_t node,
403-
bool expanded) const = 0;
401+
virtual std::vector<std::string> getInventoryFromLocCode(
402+
const std::string& LocationCode, uint16_t node,
403+
bool expanded) const = 0;
404404

405405
/**
406406
* @brief Sets the Asserted property on the LED group passed in.
@@ -426,8 +426,8 @@ class DataInterfaceBase
426426
*
427427
* @param[in] objectPath - The D-Bus object path
428428
*/
429-
virtual void
430-
setCriticalAssociation(const std::string& objectPath) const = 0;
429+
virtual void setCriticalAssociation(
430+
const std::string& objectPath) const = 0;
431431

432432
/**
433433
* @brief Returns the manufacturing QuiesceOnError property
@@ -450,8 +450,8 @@ class DataInterfaceBase
450450
* @param[in] locationCode - location code to split
451451
* @return pair<string, string> - The base and connector segments
452452
*/
453-
static std::pair<std::string, std::string>
454-
extractConnectorFromLocCode(const std::string& locationCode);
453+
static std::pair<std::string, std::string> extractConnectorFromLocCode(
454+
const std::string& locationCode);
455455

456456
#ifdef PEL_ENABLE_PHAL
457457
/**
@@ -472,9 +472,9 @@ class DataInterfaceBase
472472
* @param[in] priSRC - Primary SRC value (e.g. BD8D1001)
473473
* @param[in] srcStruct - Full SRC base structure
474474
*/
475-
virtual void
476-
createProgressSRC(const uint64_t& priSRC,
477-
const std::vector<uint8_t>& srcStruct) const = 0;
475+
virtual void createProgressSRC(
476+
const uint64_t& priSRC,
477+
const std::vector<uint8_t>& srcStruct) const = 0;
478478

479479
/**
480480
* @brief Get the list of unresolved OpenBMC event log ids that have an
@@ -501,8 +501,8 @@ class DataInterfaceBase
501501
* @return std::optional<std::vector<uint8_t>> - The FRUs DI or
502502
* std::nullopt
503503
*/
504-
virtual std::optional<std::vector<uint8_t>>
505-
getDIProperty(const std::string& locationCode) const = 0;
504+
virtual std::optional<std::vector<uint8_t>> getDIProperty(
505+
const std::string& locationCode) const = 0;
506506

507507
/**
508508
* @brief Wrpper API to call pHAL API 'getFRUType()' and check whether the
@@ -788,8 +788,8 @@ class DataInterface : public DataInterfaceBase
788788
*
789789
* @return std::string - The location code
790790
*/
791-
std::string
792-
getLocationCode(const std::string& inventoryPath) const override;
791+
std::string getLocationCode(
792+
const std::string& inventoryPath) const override;
793793

794794
/**
795795
* @brief Get the list of system type names the system is called.
@@ -831,9 +831,9 @@ class DataInterface : public DataInterfaceBase
831831
*
832832
* @return std::vector<std::string> - The inventory D-Bus objects
833833
*/
834-
std::vector<std::string>
835-
getInventoryFromLocCode(const std::string& locationCode, uint16_t node,
836-
bool expanded) const override;
834+
std::vector<std::string> getInventoryFromLocCode(
835+
const std::string& locationCode, uint16_t node,
836+
bool expanded) const override;
837837

838838
/**
839839
* @brief Sets the Asserted property on the LED group passed in.
@@ -886,9 +886,9 @@ class DataInterface : public DataInterfaceBase
886886
* @param[in] priSRC - Primary SRC value
887887
* @param[in] srcStruct - Full SRC base structure
888888
*/
889-
void
890-
createProgressSRC(const uint64_t& priSRC,
891-
const std::vector<uint8_t>& srcStruct) const override;
889+
void createProgressSRC(
890+
const uint64_t& priSRC,
891+
const std::vector<uint8_t>& srcStruct) const override;
892892

893893
/**
894894
* @brief Get the list of unresolved OpenBMC event log ids that have an
@@ -915,8 +915,8 @@ class DataInterface : public DataInterfaceBase
915915
* @return std::optional<std::vector<uint8_t>> - The FRUs DI or
916916
* std::nullopt
917917
*/
918-
std::optional<std::vector<uint8_t>>
919-
getDIProperty(const std::string& locationCode) const override;
918+
std::optional<std::vector<uint8_t>> getDIProperty(
919+
const std::string& locationCode) const override;
920920

921921
/**
922922
* @brief Finds all D-Bus Associated paths that contain any of the

extensions/openpower-pels/device_callouts.cpp

+13-13
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,8 @@ std::string getFSISearchKeys(const std::string& devPath)
156156
return links;
157157
}
158158

159-
std::tuple<std::string, std::tuple<size_t, uint8_t>>
160-
getFSII2CSearchKeys(const std::string& devPath)
159+
std::tuple<std::string, std::tuple<size_t, uint8_t>> getFSII2CSearchKeys(
160+
const std::string& devPath)
161161
{
162162
// This combines the FSI and i2C search keys
163163

@@ -327,8 +327,8 @@ std::vector<device_callouts::Callout> calloutI2CUsingPath(
327327
*
328328
* @return std::vector<Callout> - The callouts
329329
*/
330-
std::vector<device_callouts::Callout>
331-
calloutFSI(const std::string& devPath, const nlohmann::json& calloutJSON)
330+
std::vector<device_callouts::Callout> calloutFSI(
331+
const std::string& devPath, const nlohmann::json& calloutJSON)
332332
{
333333
auto links = getFSISearchKeys(devPath);
334334

@@ -359,8 +359,8 @@ std::vector<device_callouts::Callout>
359359
*
360360
* @return std::vector<Callout> - The callouts
361361
*/
362-
std::vector<device_callouts::Callout>
363-
calloutFSII2C(const std::string& devPath, const nlohmann::json& calloutJSON)
362+
std::vector<device_callouts::Callout> calloutFSII2C(
363+
const std::string& devPath, const nlohmann::json& calloutJSON)
364364
{
365365
auto linksAndI2C = getFSII2CSearchKeys(devPath);
366366
auto links = std::get<std::string>(linksAndI2C);
@@ -405,8 +405,8 @@ std::vector<device_callouts::Callout>
405405
*
406406
* @return std::vector<Callout> - The callouts
407407
*/
408-
std::vector<device_callouts::Callout>
409-
calloutFSISPI(const std::string& devPath, const nlohmann::json& calloutJSON)
408+
std::vector<device_callouts::Callout> calloutFSISPI(
409+
const std::string& devPath, const nlohmann::json& calloutJSON)
410410
{
411411
auto linksAndSPI = getFSISPISearchKeys(devPath);
412412
auto links = std::get<std::string>(linksAndSPI);
@@ -445,8 +445,8 @@ std::vector<device_callouts::Callout>
445445
*
446446
* @return std::vector<Callout> - The list of callouts
447447
*/
448-
std::vector<device_callouts::Callout>
449-
findCallouts(const std::string& devPath, const nlohmann::json& json)
448+
std::vector<device_callouts::Callout> findCallouts(const std::string& devPath,
449+
const nlohmann::json& json)
450450
{
451451
std::vector<Callout> callouts;
452452
fs::path path;
@@ -523,9 +523,9 @@ std::vector<Callout> getCallouts(const std::string& devPath,
523523
return util::findCallouts(devPath, json);
524524
}
525525

526-
std::vector<Callout>
527-
getI2CCallouts(size_t i2cBus, uint8_t i2cAddress,
528-
const std::vector<std::string>& compatibleList)
526+
std::vector<Callout> getI2CCallouts(
527+
size_t i2cBus, uint8_t i2cAddress,
528+
const std::vector<std::string>& compatibleList)
529529
{
530530
auto json = util::loadJSON(compatibleList);
531531
return util::calloutI2C(i2cBus, i2cAddress, json);

extensions/openpower-pels/device_callouts.hpp

+7-7
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,9 @@ std::vector<Callout> getCallouts(
113113
* system.
114114
* @return std::vector<Callout> - The list of callouts
115115
*/
116-
std::vector<Callout>
117-
getI2CCallouts(size_t i2cBus, uint8_t i2cAddress,
118-
const std::vector<std::string>& compatibleList);
116+
std::vector<Callout> getI2CCallouts(
117+
size_t i2cBus, uint8_t i2cAddress,
118+
const std::vector<std::string>& compatibleList);
119119

120120
namespace util
121121
{
@@ -140,8 +140,8 @@ enum class CalloutType
140140
*
141141
* @return path - The path to the file.
142142
*/
143-
std::filesystem::path
144-
getJSONFilename(const std::vector<std::string>& compatibleList);
143+
std::filesystem::path getJSONFilename(
144+
const std::vector<std::string>& compatibleList);
145145

146146
/**
147147
* @brief Looks up the callouts in the JSON using the I2C keys.
@@ -201,8 +201,8 @@ std::string getFSISearchKeys(const std::string& devPath);
201201
* @return std::tuple<std::string, std::tuple<size_t, uint8_t>>
202202
* - The FSI links key along with the I2C bus/address.
203203
*/
204-
std::tuple<std::string, std::tuple<size_t, uint8_t>>
205-
getFSII2CSearchKeys(const std::string& devPath);
204+
std::tuple<std::string, std::tuple<size_t, uint8_t>> getFSII2CSearchKeys(
205+
const std::string& devPath);
206206

207207
/**
208208
* @brief Pulls the fields out of the SPI device path to use as search keys

extensions/openpower-pels/extended_user_data.hpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,9 @@ class ExtendedUserData : public Section
144144
* @return The JSON as a string if a parser was found,
145145
* otherwise std::nullopt.
146146
*/
147-
std::optional<std::string>
148-
getJSON(uint8_t creatorID,
149-
const std::vector<std::string>& plugins) const override;
147+
std::optional<std::string> getJSON(
148+
uint8_t creatorID,
149+
const std::vector<std::string>& plugins) const override;
150150

151151
/**
152152
* @brief Shrink the section

extensions/openpower-pels/journal.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ void Journal::sync() const
6868
}
6969
}
7070

71-
std::vector<std::string>
72-
Journal::getMessages(const std::string& syslogID, size_t maxMessages) const
71+
std::vector<std::string> Journal::getMessages(const std::string& syslogID,
72+
size_t maxMessages) const
7373
{
7474
// The message registry JSON schema will also fail if a zero is in the JSON
7575
if (0 == maxMessages)

extensions/openpower-pels/journal.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ class JournalBase
3030
*
3131
* @return The messages
3232
*/
33-
virtual std::vector<std::string>
34-
getMessages(const std::string& syslogID, size_t maxMessages) const = 0;
33+
virtual std::vector<std::string> getMessages(const std::string& syslogID,
34+
size_t maxMessages) const = 0;
3535

3636
/**
3737
* @brief Call journalctl --sync to write unwritten journal data to disk

extensions/openpower-pels/json_utils.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,8 @@ std::string trimEnd(std::string s)
252252
* @param[in] creatorID - The creator ID for the PEL
253253
* @return optional<string> - The comp name, or std::nullopt
254254
*/
255-
static std::optional<std::string>
256-
lookupComponentName(uint16_t compID, char creatorID)
255+
static std::optional<std::string> lookupComponentName(uint16_t compID,
256+
char creatorID)
257257
{
258258
static std::map<char, nlohmann::json> jsonCache;
259259
nlohmann::json jsonData;

extensions/openpower-pels/manager.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1004,8 +1004,8 @@ uint32_t Manager::getBMCLogIdFromPELId(uint32_t pelId)
10041004
}
10051005
}
10061006

1007-
void
1008-
Manager::updateProgressSRC(std::unique_ptr<openpower::pels::PEL>& pel) const
1007+
void Manager::updateProgressSRC(
1008+
std::unique_ptr<openpower::pels::PEL>& pel) const
10091009
{
10101010
// Check for pel severity of type - 0x51 = critical error, system
10111011
// termination

extensions/openpower-pels/pel.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -987,8 +987,8 @@ std::vector<uint8_t> readFD(int fd)
987987
return data;
988988
}
989989

990-
std::unique_ptr<UserData>
991-
makeFFDCuserDataSection(uint16_t componentID, const PelFFDCfile& file)
990+
std::unique_ptr<UserData> makeFFDCuserDataSection(uint16_t componentID,
991+
const PelFFDCfile& file)
992992
{
993993
auto data = readFD(file.fd);
994994

extensions/openpower-pels/pel.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -508,8 +508,8 @@ std::vector<uint8_t> readFD(int fd);
508508
* @param[in] componentID - The component ID of the PEL creator
509509
* @param[in] file - The FFDC file information
510510
*/
511-
std::unique_ptr<UserData>
512-
makeFFDCuserDataSection(uint16_t componentID, const PelFFDCfile& file);
511+
std::unique_ptr<UserData> makeFFDCuserDataSection(uint16_t componentID,
512+
const PelFFDCfile& file);
513513

514514
/**
515515
* @brief To create JSON object with the given location code and the hex

extensions/openpower-pels/registry.cpp

+8-8
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,8 @@ std::optional<std::map<SRC::WordNum, SRC::AdditionalDataField>>
247247

248248
return std::nullopt;
249249
}
250-
std::optional<std::vector<SRC::WordNum>>
251-
getSRCSymptomIDFields(const nlohmann::json& src, const std::string& name)
250+
std::optional<std::vector<SRC::WordNum>> getSRCSymptomIDFields(
251+
const nlohmann::json& src, const std::string& name)
252252
{
253253
std::vector<SRC::WordNum> symptomIDFields;
254254

@@ -858,8 +858,8 @@ std::optional<Entry> Registry::lookup(const std::string& name, LookupType type,
858858
return std::nullopt;
859859
}
860860

861-
std::optional<nlohmann::json>
862-
Registry::readRegistry(const std::filesystem::path& registryFile)
861+
std::optional<nlohmann::json> Registry::readRegistry(
862+
const std::filesystem::path& registryFile)
863863
{
864864
// Look in /etc first in case someone put a test file there
865865
fs::path debugFile{fs::path{debugFilePath} / registryFileName};
@@ -889,10 +889,10 @@ std::optional<nlohmann::json>
889889
return registry;
890890
}
891891

892-
std::vector<RegistryCallout>
893-
Registry::getCallouts(const nlohmann::json& calloutJSON,
894-
const std::vector<std::string>& systemNames,
895-
const AdditionalData& additionalData)
892+
std::vector<RegistryCallout> Registry::getCallouts(
893+
const nlohmann::json& calloutJSON,
894+
const std::vector<std::string>& systemNames,
895+
const AdditionalData& additionalData)
896896
{
897897
// The JSON may either use an AdditionalData key
898898
// as an index, or not.

0 commit comments

Comments
 (0)