nvme-cli: update show_registers_cc() to use nvme.h
PATCH 1/1 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 <minwoo.im.dev at gmail.com>
--- nvme-print.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
nvme-print.c +5 -5
@@ -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" ); }
Signature · 1 line
2.7.4
Keith Busch
AppliedPATCH 1/1 nvme-cli: update show_registers_cc() to use nvme.h
Quoted 4 lines · Minwoo Im
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 at gmail.com>
Thanks, applied.