From: Brandon Paupore Date: Wed, 10 Jun 2020 20:32:45 +0000 (-0500) Subject: Corrected text output in FW activation history X-Git-Tag: v1.12~1 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=4b0b7321aab6745ede3169ea0f7492d840ab6d62;p=users%2Fhch%2Fnvme-cli.git Corrected text output in FW activation history --- diff --git a/plugins/wdc/wdc-nvme.c b/plugins/wdc/wdc-nvme.c index 6822919..0cebe3f 100644 --- a/plugins/wdc/wdc-nvme.c +++ b/plugins/wdc/wdc-nvme.c @@ -723,7 +723,7 @@ struct wdc_fw_act_history_log_entry { __le32 entry_num; __le32 power_cycle_count; __le64 power_on_seconds; - __le64 current_fw_version; + __le64 previous_fw_version; __le64 new_fw_version; __u8 slot_number; __u8 commit_action_type; @@ -3338,22 +3338,22 @@ static void wdc_print_fw_act_history_log_normal(struct wdc_fw_act_history_log_en int num_entries) { int i; - char current_fw[9]; + char previous_fw[9]; char new_fw[9]; char commit_action_bin[8]; - memset((void *)current_fw, 0, 9); + memset((void *)previous_fw, 0, 9); memset((void *)new_fw, 0, 9); memset((void *)commit_action_bin, 0, 8); char *null_fw = "--------"; printf(" Firmware Activate History Log \n"); - printf(" Power on Hour Power Cycle Current New \n"); + printf(" Power on Hour Power Cycle Previous New \n"); printf(" Entry hh:mm:ss Count Firmware Firmware Slot Action Result \n"); printf(" ----- -------------- ------------ ---------- ---------- ----- ------ -------\n"); for (i = 0; i < num_entries; i++) { - memcpy(current_fw, (char *)&(fw_act_history_entry->current_fw_version), 8); + memcpy(previous_fw, (char *)&(fw_act_history_entry->previous_fw_version), 8); if (strlen((char *)&(fw_act_history_entry->new_fw_version)) > 1) memcpy(new_fw, (char *)&(fw_act_history_entry->new_fw_version), 8); else @@ -3367,7 +3367,7 @@ static void wdc_print_fw_act_history_log_normal(struct wdc_fw_act_history_log_en printf(" "); printf("%8"PRIu32"", (uint32_t)le32_to_cpu(fw_act_history_entry->power_cycle_count)); printf(" "); - printf("%s", (char *)current_fw); + printf("%s", (char *)previous_fw); printf(" "); printf("%s", (char *)new_fw); printf(" "); @@ -3392,12 +3392,12 @@ static void wdc_print_fw_act_history_log_json(struct wdc_fw_act_history_log_entr { struct json_object *root; int i; - char current_fw[9]; + char previous_fw[9]; char new_fw[9]; char commit_action_bin[8]; char fail_str[32]; char time_str[9]; - memset((void *)current_fw, 0, 9); + memset((void *)previous_fw, 0, 9); memset((void *)new_fw, 0, 9); memset((void *)commit_action_bin, 0, 8); memset((void *)time_str, 0, 9); @@ -3407,7 +3407,7 @@ static void wdc_print_fw_act_history_log_json(struct wdc_fw_act_history_log_entr root = json_create_object(); for (i = 0; i < num_entries; i++) { - memcpy(current_fw, (char *)&(fw_act_history_entry->current_fw_version), 8); + memcpy(previous_fw, (char *)&(fw_act_history_entry->previous_fw_version), 8); if (strlen((char *)&(fw_act_history_entry->new_fw_version)) > 1) memcpy(new_fw, (char *)&(fw_act_history_entry->new_fw_version), 8); else @@ -3423,8 +3423,8 @@ static void wdc_print_fw_act_history_log_json(struct wdc_fw_act_history_log_entr json_object_add_value_int(root, "Power Cycle Count", le32_to_cpu(fw_act_history_entry->power_cycle_count)); - json_object_add_value_string(root, "Current Firmware", - current_fw); + json_object_add_value_string(root, "Previous Firmware", + previous_fw); json_object_add_value_string(root, "New Firmware", new_fw); json_object_add_value_int(root, "Slot",