]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
nvme-print: fix fetching status code type and status data type
authorGollu Appalanaidu <anaidu.gollu@samsung.com>
Sun, 14 Feb 2021 05:04:22 +0000 (10:34 +0530)
committerKeith Busch <kbusch@kernel.org>
Tue, 16 Feb 2021 02:37:08 +0000 (19:37 -0700)
Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
nvme-print.c
nvme-print.h

index 1ac99a9fb4b194e7019e45fcb9006a399a9cf63e..1e3c9df573cced5213fed012fe658983e5dae154 100644 (file)
@@ -4793,9 +4793,9 @@ void nvme_show_select_result(__u32 result)
                printf("  Feature is changeable\n");
 }
 
-const char *nvme_status_to_string(__u32 status)
+const char *nvme_status_to_string(__u16 status)
 {
-       switch (status & 0x3ff) {
+       switch (status & 0x7ff) {
        case NVME_SC_SUCCESS:
                return "SUCCESS: The command completed successfully";
        case NVME_SC_INVALID_OPCODE:
index c3f19bc76dbd2ddd80af88d9a6565809d0bf9709..bef55ece993e128a67217af0e04ba1b956b085fe 100644 (file)
@@ -86,7 +86,7 @@ void nvme_show_zns_changed( struct nvme_zns_changed_zone_log *log,
 void nvme_show_zns_report_zones(void *report, __u32 descs,
        __u8 ext_size, __u32 report_size, unsigned long flags);
 
-const char *nvme_status_to_string(__u32 status);
+const char *nvme_status_to_string(__u16 status);
 const char *nvme_select_to_string(int sel);
 const char *nvme_feature_to_string(enum nvme_feat feature);
 const char *nvme_register_to_string(int reg);