From: Minwoo Im Date: Thu, 30 Nov 2017 15:49:17 +0000 (+0900) Subject: nvme-cli: update show_registers_cc() to use nvme.h X-Git-Tag: v1.5~21 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=6f0dd6617d9dffd08bf36d522a1a1b36dbe9cc4a;p=users%2Fhch%2Fnvme-cli.git nvme-cli: update show_registers_cc() to use nvme.h 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 --- diff --git a/nvme-print.c b/nvme-print.c index db11dd7..e84c73f 100644 --- a/nvme-print.c +++ b/nvme-print.c @@ -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"); }