From 78a4af6fd0408bf041273fb583680fe0f0c8d054 Mon Sep 17 00:00:00 2001 From: Tokunori Ikegami Date: Sun, 28 May 2023 19:38:27 +0900 Subject: [PATCH] plugins/ocp: Fix remaining files linux kernel check patch warnings Signed-off-by: Tokunori Ikegami --- plugins/ocp/ocp-clear-fw-update-history.c | 3 +-- plugins/ocp/ocp-fw-activation-history.c | 4 ++-- plugins/ocp/ocp-smart-extended-log.c | 16 +++++++--------- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/plugins/ocp/ocp-clear-fw-update-history.c b/plugins/ocp/ocp-clear-fw-update-history.c index b9235b82..6b256b16 100644 --- a/plugins/ocp/ocp-clear-fw-update-history.c +++ b/plugins/ocp/ocp-clear-fw-update-history.c @@ -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); } diff --git a/plugins/ocp/ocp-fw-activation-history.c b/plugins/ocp/ocp-fw-activation-history.c index c2d06929..b067346e 100644 --- a/plugins/ocp/ocp-fw-activation-history.c +++ b/plugins/ocp/ocp-fw-activation-history.c @@ -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; diff --git a/plugins/ocp/ocp-smart-extended-log.c b/plugins/ocp/ocp-smart-extended-log.c index 37b62e92..c989d346 100644 --- a/plugins/ocp/ocp-smart-extended-log.c +++ b/plugins/ocp/ocp-smart-extended-log.c @@ -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; -- 2.49.0