Skip to content

Commit

Permalink
unified-sel: fix most coding style issues
Browse files Browse the repository at this point in the history
Solve several issues pointed by checkpatch.pl.

Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  • Loading branch information
mchehab committed Nov 18, 2024
1 parent 0649a66 commit 9993308
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions unified-sel.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,17 @@ static int verify_id_log_sel(uint64_t status,
* Byte 16: ID of the error detected on the PCle device that triggered this SEL record
*/

/* Potentially all error status bits could be set for a given PCIe device.
* Therefore, iterate over all 32 bits each of cor and uncor errors
/*
* Potentially all error status bits could be set for a given PCIe
* device. Therefore, iterate over all 32 bits each of cor and uncor
* errors.
*/
for (i = 0; i < 32; i++) {
if ((status & (1 << i)) && idarray[i]) {
sprintf(openbmc_ipmi_add_sel,
"ipmitool raw 0x0a 0x44 0x00 0x00 0xFB 0x20 0x00 0x00 0x00 0x00 0x01 0x00 0x%02x 0x%02x 0x01 0x00 0xff %s",
dev_fn, bus, idarray[i]);
snprintf(openbmc_ipmi_add_sel,
sizeof(openbmc_ipmi_add_sel),
"ipmitool raw 0x0a 0x44 0x00 0x00 0xFB 0x20 0x00 0x00 0x00 0x00 0x01 0x00 0x%02x 0x%02x 0x01 0x00 0xff %s",
dev_fn, bus, idarray[i]);
if (system(openbmc_ipmi_add_sel) != 0)
return -1;
}
Expand All @@ -73,9 +76,10 @@ int openbmc_unified_sel_log(uint64_t severity, const char *dev_name, uint64_t st
sscanf(dev_name, "%*x:%x:%x.%x", &bus, &dev, &fn);
dev_fn = (((dev & 0x1f) << 3) | (fn & 0x7));

/* Use the appropriate correctable error status ID
/*
* Use the appropriate correctable error status ID
* for a given severity level
* */
*/
if (severity == HW_EVENT_AER_CORRECTED) {
if (verify_id_log_sel(status, cor_error_ids, bus, dev_fn) < 0)
return -1;
Expand Down

0 comments on commit 9993308

Please sign in to comment.