]> www.infradead.org Git - users/hch/nvme-cli.git/commitdiff
nvme-cli: update show_registers_cc() to use nvme.h
authorMinwoo Im <minwoo.im.dev@gmail.com>
Thu, 30 Nov 2017 15:49:17 +0000 (00:49 +0900)
committerKeith Busch <keith.busch@intel.com>
Thu, 30 Nov 2017 21:38:13 +0000 (14:38 -0700)
Replace constants for shift in show_register_cc() with macros defined.
Also clean up a small typo (IOSQES to IOCQES).

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
nvme-print.c

index db11dd73e8d0aa69b89ff313568536d70452ecc4..e84c73f1f4cdbb99fb6a61ffc66b165f81c368b6 100644 (file)
@@ -1923,11 +1923,11 @@ static void show_registers_cc_shn (__u8 shn)
 
 static void show_registers_cc(__u32 cc)
 {
-       printf("\tI/O Completion Queue Entry Size (IOSQES): %u bytes\n", 1 <<   ((cc & 0x00f00000) >> 20));
-       printf("\tI/O Submission Queue Entry Size (IOSQES): %u bytes\n", 1 <<   ((cc & 0x000f0000) >> 16));
-       show_registers_cc_shn((cc & 0x0000c000) >> 14);
-       show_registers_cc_ams((cc & 0x00003800) >> 11);
-       printf("\tMemory Page Size                   (MPS): %u bytes\n", 1 <<  (12 + ((cc & 0x00000780) >> 7)));
+       printf("\tI/O Completion Queue Entry Size (IOCQES): %u bytes\n", 1 << ((cc & 0x00f00000) >> NVME_CC_IOCQES_SHIFT));
+       printf("\tI/O Submission Queue Entry Size (IOSQES): %u bytes\n", 1 << ((cc & 0x000f0000) >> NVME_CC_IOSQES_SHIFT));
+       show_registers_cc_shn((cc & 0x0000c000) >> NVME_CC_SHN_SHIFT);
+       show_registers_cc_ams((cc & 0x00003800) >> NVME_CC_AMS_SHIFT);
+       printf("\tMemory Page Size                   (MPS): %u bytes\n", 1 << (12 + ((cc & 0x00000780) >> NVME_CC_MPS_SHIFT)));
        printf("\tI/O Command Sets Selected          (CSS): %s\n", (cc & 0x00000070) ? "Reserved":"NVM Command Set");
        printf("\tEnable                              (EN): %s\n\n", (cc & 0x00000001) ? "Yes":"No");
 }