]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
plugins/ocp: Fix remaining files linux kernel check patch warnings
authorTokunori Ikegami <ikegami.t@gmail.com>
Sun, 28 May 2023 10:38:27 +0000 (19:38 +0900)
committerDaniel Wagner <wagi@monom.org>
Thu, 1 Jun 2023 17:45:53 +0000 (19:45 +0200)
Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
plugins/ocp/ocp-clear-fw-update-history.c
plugins/ocp/ocp-fw-activation-history.c
plugins/ocp/ocp-smart-extended-log.c

index b9235b82ebe90c231f54b871adc82bb95dd3c2fc..6b256b16a960e29c407ed877118846a37eb786bd 100644 (file)
@@ -16,6 +16,5 @@ int ocp_clear_fw_update_history(int argc, char **argv, struct command *cmd, stru
 {
        const char *desc = "OCP Clear Firmware Update History";
 
-       return ocp_clear_feature(argc, argv, desc,
-                                OCP_FID_CLEAR_FW_ACTIVATION_HISTORY);
+       return ocp_clear_feature(argc, argv, desc, OCP_FID_CLEAR_FW_ACTIVATION_HISTORY);
 }
index c2d069299d07fce12694533c89a4e9cf7d1379d3..b067346e679fb4e0e16eca9cf9425c0675b28c62 100644 (file)
@@ -22,7 +22,7 @@ static const unsigned char ocp_fw_activation_history_guid[16] = {
        0xac, 0xf3, 0x1c, 0xd1
 };
 
-struct __attribute__ ((packed)) fw_activation_history_entry {
+struct __packed fw_activation_history_entry {
        __u8 ver_num;
        __u8 entry_length;
        __u16 reserved1;
@@ -38,7 +38,7 @@ struct __attribute__ ((packed)) fw_activation_history_entry {
        __u8 reserved3[14];
 };
 
-struct __attribute__ ((packed)) fw_activation_history {
+struct __packed fw_activation_history {
        __u8 log_id;
        __u8 reserved1[3];
        __u32 valid_entries;
index 37b62e92994a61973676fb9ad5a407e857073638..c989d3460d6c332d3deba06ab2c3c43f5621f70c 100644 (file)
@@ -26,7 +26,7 @@ static __u8 scao_guid[C0_GUID_LENGTH] = {
        0xC9, 0x14, 0xD5, 0xAF
 };
 
-typedef enum {
+enum {
        SCAO_PMUW       = 0,    /* Physical media units written */
        SCAO_PMUR       = 16,   /* Physical media units read */
        SCAO_BUNBR      = 32,   /* Bad user nand blocks raw */
@@ -62,7 +62,7 @@ typedef enum {
        SCAO_PSCC       = 200,  /* Power State Change Count */
        SCAO_LPV        = 494,  /* Log page version */
        SCAO_LPG        = 496,  /* Log page GUID */
-} SMART_CLOUD_ATTRIBUTE_OFFSETS;
+};
 
 static void ocp_print_C0_log_normal(void *data)
 {
@@ -71,10 +71,10 @@ static void ocp_print_C0_log_normal(void *data)
 
        printf("SMART Cloud Attributes :-\n");
 
-       printf("  Physical media units written -                %"PRIu64" %"PRIu64"\n",
+       printf("  Physical media units written -                %"PRIu64" %"PRIu64"\n",
               (uint64_t)le64_to_cpu(*(uint64_t *)&log_data[SCAO_PMUW + 8] & 0xFFFFFFFFFFFFFFFF),
               (uint64_t)le64_to_cpu(*(uint64_t *)&log_data[SCAO_PMUW] & 0xFFFFFFFFFFFFFFFF));
-       printf("  Physical media units read    -                %"PRIu64" %"PRIu64"\n",
+       printf("  Physical media units read    -                %"PRIu64" %"PRIu64"\n",
               (uint64_t)le64_to_cpu(*(uint64_t *)&log_data[SCAO_PMUR + 8] & 0xFFFFFFFFFFFFFFFF),
               (uint64_t)le64_to_cpu(*(uint64_t *)&log_data[SCAO_PMUR] & 0xFFFFFFFFFFFFFFFF));
        printf("  Bad user nand blocks - Raw                    %"PRIu64"\n",
@@ -105,7 +105,7 @@ static void ocp_print_C0_log_normal(void *data)
               (uint32_t)le32_to_cpu(*(uint32_t *)&log_data[SCAO_MNUDEC]));
        printf("  Number of Thermal throttling events           %d\n",
               (__u8)log_data[SCAO_NTTE]);
-       printf("  Current throttling status                     0x%x\n",
+       printf("  Current throttling status                     0x%x\n",
               (__u8)log_data[SCAO_CTS]);
        printf("  PCIe correctable error count                  %"PRIu64"\n",
               (uint64_t)le64_to_cpu(*(uint64_t *)&log_data[SCAO_PCEC]));
@@ -286,14 +286,12 @@ static int get_c0_log_page(int fd, char *format)
 
                                fprintf(stderr, "ERROR : OCP : Unknown GUID in C0 Log Page data\n");
                                fprintf(stderr, "ERROR : OCP : Expected GUID:  0x");
-                               for (j = 0; j < 16; j++) {
+                               for (j = 0; j < 16; j++)
                                        fprintf(stderr, "%x", scao_guid[j]);
-                               }
 
                                fprintf(stderr, "\nERROR : OCP : Actual GUID:    0x");
-                               for (j = 0; j < 16; j++) {
+                               for (j = 0; j < 16; j++)
                                        fprintf(stderr, "%x", data[SCAO_LPG + j]);
-                               }
                                fprintf(stderr, "\n");
 
                                ret = -1;