Skip to content

Commit a3cc228

Browse files
clang-format: re-format for clang-18
clang-format-18 isn't compatible with the clang-format-17 output, so we need to reformat the code with the latest version. The way clang-18 handles lambda formatting also changed, so we have made changes to the organization default style format to better handle lambda formatting. See I5e08687e696dd240402a2780158664b7113def0e for updated style. See Iea0776aaa7edd483fa395e23de25ebf5a6288f71 for clang-18 enablement. Change-Id: I98f262c24e427f4228b184715d7ad88b0d7060f6 Signed-off-by: Patrick Williams <[email protected]>
1 parent bc5725d commit a3cc228

File tree

5 files changed

+37
-37
lines changed

5 files changed

+37
-37
lines changed

.clang-format

+4-3
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ IndentWidth: 4
8787
IndentWrappedFunctionNames: true
8888
InsertNewlineAtEOF: true
8989
KeepEmptyLinesAtTheStartOfBlocks: false
90-
LambdaBodyIndentation: OuterScope
90+
LambdaBodyIndentation: Signature
9191
LineEnding: LF
9292
MacroBlockBegin: ''
9393
MacroBlockEnd: ''
@@ -98,13 +98,14 @@ ObjCSpaceAfterProperty: false
9898
ObjCSpaceBeforeProtocolList: true
9999
PackConstructorInitializers: BinPack
100100
PenaltyBreakAssignment: 25
101-
PenaltyBreakBeforeFirstCallParameter: 19
101+
PenaltyBreakBeforeFirstCallParameter: 50
102102
PenaltyBreakComment: 300
103103
PenaltyBreakFirstLessLess: 120
104104
PenaltyBreakString: 1000
105+
PenaltyBreakTemplateDeclaration: 10
105106
PenaltyExcessCharacter: 1000000
106107
PenaltyReturnTypeOnItsOwnLine: 60
107-
PenaltyIndentedWhitespace: 0
108+
PenaltyIndentedWhitespace: 1
108109
PointerAlignment: Left
109110
QualifierAlignment: Left
110111
ReferenceAlignment: Left

fru_area.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ using namespace phosphor::logging;
1111

1212
IPMIFruArea::IPMIFruArea(const uint8_t fruID, const ipmi_fru_area_type type,
1313
bool bmcOnlyFru) :
14-
fruID(fruID),
15-
type(type), bmcOnlyFru(bmcOnlyFru)
14+
fruID(fruID), type(type), bmcOnlyFru(bmcOnlyFru)
1615
{
1716
if (type == IPMI_FRU_AREA_INTERNAL_USE)
1817
{

frup.cpp

+16-16
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,8 @@ static int _parse_type_length(const void* areabuf, unsigned int areabuflen,
216216

217217
type_code = (type_length & IPMI_FRU_TYPE_LENGTH_TYPE_CODE_MASK) >>
218218
IPMI_FRU_TYPE_LENGTH_TYPE_CODE_SHIFT;
219-
(*number_of_data_bytes) = type_length &
220-
IPMI_FRU_TYPE_LENGTH_NUMBER_OF_DATA_BYTES_MASK;
219+
(*number_of_data_bytes) =
220+
type_length & IPMI_FRU_TYPE_LENGTH_NUMBER_OF_DATA_BYTES_MASK;
221221

222222
/* special case: this shouldn't be a length of 0x01 (see type/length
223223
* byte format in fru information storage definition).
@@ -245,12 +245,12 @@ static int _parse_type_length(const void* areabuf, unsigned int areabuflen,
245245
return (0);
246246
}
247247

248-
int ipmi_fru_chassis_info_area(const void* areabuf, unsigned int areabuflen,
249-
uint8_t* chassis_type,
250-
ipmi_fru_field_t* chassis_part_number,
251-
ipmi_fru_field_t* chassis_serial_number,
252-
ipmi_fru_field_t* chassis_custom_fields,
253-
unsigned int chassis_custom_fields_len)
248+
int ipmi_fru_chassis_info_area(
249+
const void* areabuf, unsigned int areabuflen, uint8_t* chassis_type,
250+
ipmi_fru_field_t* chassis_part_number,
251+
ipmi_fru_field_t* chassis_serial_number,
252+
ipmi_fru_field_t* chassis_custom_fields,
253+
unsigned int chassis_custom_fields_len)
254254
{
255255
const uint8_t* areabufptr = (const uint8_t*)areabuf;
256256
unsigned int area_offset = 0;
@@ -497,8 +497,8 @@ int ipmi_fru_product_info_area(
497497
goto out;
498498

499499
if (_parse_type_length(areabufptr, areabuflen, area_offset,
500-
&number_of_data_bytes,
501-
product_manufacturer_name) < 0)
500+
&number_of_data_bytes, product_manufacturer_name) <
501+
0)
502502
goto cleanup;
503503
area_offset += 1; /* type/length byte */
504504
area_offset += number_of_data_bytes;
@@ -516,8 +516,8 @@ int ipmi_fru_product_info_area(
516516
goto out;
517517

518518
if (_parse_type_length(areabufptr, areabuflen, area_offset,
519-
&number_of_data_bytes,
520-
product_part_model_number) < 0)
519+
&number_of_data_bytes, product_part_model_number) <
520+
0)
521521
goto cleanup;
522522
area_offset += 1; /* type/length byte */
523523
area_offset += number_of_data_bytes;
@@ -643,8 +643,8 @@ void _append_to_dict(uint8_t vpd_key_id, uint8_t* vpd_key_val,
643643
" Len = [%d] : Val = [%s]\n",
644644
vpd_key_names[vpd_key_id], vpd_val_len, bin_in_ascii);
645645
#endif
646-
info[vpd_key_id] = std::make_pair(vpd_key_names[vpd_key_id],
647-
bin_in_ascii);
646+
info[vpd_key_id] =
647+
std::make_pair(vpd_key_names[vpd_key_id], bin_in_ascii);
648648
break;
649649

650650
case 3:
@@ -750,8 +750,8 @@ int parse_fru_area(const uint8_t area, const void* msgbuf, const size_t len,
750750
printf("Board : Appending [%s] = [%s]\n", vpd_key_names[i],
751751
timestr);
752752
#endif
753-
info[i] = std::make_pair(vpd_key_names[i],
754-
std::string(timestr));
753+
info[i] =
754+
std::make_pair(vpd_key_names[i], std::string(timestr));
755755
continue;
756756
}
757757
_append_to_dict(i, vpd_info[i].type_length_field, info);

strgfnhandler.cpp

+4-5
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,10 @@ using namespace phosphor::logging;
1818
///-------------------------------------------------------
1919
// Called by IPMI netfn router for write fru data command
2020
//--------------------------------------------------------
21-
ipmi_ret_t ipmiStorageWriteFruData(ipmi_netfn_t /*netfn*/, ipmi_cmd_t /*cmd*/,
22-
ipmi_request_t request,
23-
ipmi_response_t response,
24-
ipmi_data_len_t dataLen,
25-
ipmi_context_t /*context*/)
21+
ipmi_ret_t
22+
ipmiStorageWriteFruData(ipmi_netfn_t /*netfn*/, ipmi_cmd_t /*cmd*/,
23+
ipmi_request_t request, ipmi_response_t response,
24+
ipmi_data_len_t dataLen, ipmi_context_t /*context*/)
2625
{
2726
FILE* fp = NULL;
2827
char fruFilename[16] = {0};

writefrudata.cpp

+12-11
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,9 @@ std::string getFRUValue(const std::string& section, const std::string& key,
9393
auto first = fruData.cbegin() + minIndexValue;
9494
auto last = first + (maxIndexValue - minIndexValue) + 1;
9595

96-
auto itr = std::find_if(first, last,
97-
[&key](const auto& e) { return key == e.first; });
96+
auto itr = std::find_if(first, last, [&key](const auto& e) {
97+
return key == e.first;
98+
});
9899

99100
if (itr != last)
100101
{
@@ -132,10 +133,10 @@ std::string getFRUValue(const std::string& section, const std::string& key,
132133
auto getService(sdbusplus::bus_t& bus, const std::string& intf,
133134
const std::string& path)
134135
{
135-
auto mapperCall = bus.new_method_call("xyz.openbmc_project.ObjectMapper",
136-
"/xyz/openbmc_project/object_mapper",
137-
"xyz.openbmc_project.ObjectMapper",
138-
"GetObject");
136+
auto mapperCall =
137+
bus.new_method_call("xyz.openbmc_project.ObjectMapper",
138+
"/xyz/openbmc_project/object_mapper",
139+
"xyz.openbmc_project.ObjectMapper", "GetObject");
139140

140141
mapperCall.append(path);
141142
mapperCall.append(std::vector<std::string>({intf}));
@@ -539,10 +540,10 @@ int ipmiPopulateFruAreas(uint8_t* fruData, const size_t dataLen,
539540
return rc;
540541
}
541542

542-
auto fruDataView = std::span<uint8_t>(&fruData[areaOffset],
543-
areaLen);
544-
auto areaData = std::vector<uint8_t>(fruDataView.begin(),
545-
fruDataView.end());
543+
auto fruDataView =
544+
std::span<uint8_t>(&fruData[areaOffset], areaLen);
545+
auto areaData =
546+
std::vector<uint8_t>(fruDataView.begin(), fruDataView.end());
546547

547548
// Validate the CRC, but not for the internal use area, since its
548549
// contents beyond the first byte are not defined in the spec and
@@ -581,7 +582,7 @@ int ipmiPopulateFruAreas(uint8_t* fruData, const size_t dataLen,
581582
}
582583
}
583584
} // If we have FRU data present
584-
} // Walk struct common_header
585+
} // Walk struct common_header
585586

586587
// Not all the fields will be populated in a FRU data. Mostly all cases will
587588
// not have more than 2 or 3.

0 commit comments

Comments
 (0)