]> www.infradead.org Git - users/mchehab/rasdaemon.git/commitdiff
unified-sel: fix most coding style issues
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Mon, 18 Nov 2024 15:59:51 +0000 (16:59 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Mon, 18 Nov 2024 15:59:51 +0000 (16:59 +0100)
Solve several issues pointed by checkpatch.pl.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
unified-sel.c

index 564afcaa3c43a813e1cb9b3a60529ae12f7e45cf..d0a94b1c1c4c6185cb149e2fa277bc26431f0810 100644 (file)
@@ -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;
                }
@@ -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;