From b0f317340e24a60d24e5ba1cdcc17e498a66adce Mon Sep 17 00:00:00 2001 From: Tokunori Ikegami Date: Sun, 31 Mar 2024 07:42:11 +0900 Subject: [PATCH] nvme-print-stdout: use NVME_MAJOR and NVME_MINOR definitions Replace hard coded shift and mask values. Signed-off-by: Tokunori Ikegami --- nvme-print-stdout.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/nvme-print-stdout.c b/nvme-print-stdout.c index 43355bee..a9c3fc90 100644 --- a/nvme-print-stdout.c +++ b/nvme-print-stdout.c @@ -1118,8 +1118,7 @@ static void stdout_registers_cap(struct nvme_bar_cap *cap) static void stdout_registers_version(__u32 vs) { - printf("\tNVMe specification %d.%d\n\n", (vs & 0xffff0000) >> 16, - (vs & 0x0000ff00) >> 8); + printf("\tNVMe specification %d.%d\n\n", NVME_MAJOR(vs), NVME_MINOR(vs)); } static void stdout_registers_cc_ams(__u8 ams) -- 2.50.1