From 55568b4b418f2db24928242fb6780ccc4d02b1f7 Mon Sep 17 00:00:00 2001 From: Niklas Cassel Date: Fri, 18 Sep 2020 15:40:16 +0000 Subject: [PATCH] nvme-print: fix ZNS MAR/MOR print According to the ZNS specification, MAR/MOR is 0's based, and no limit for these fields are represented as 0xffffffff, not as 0. Since all ones is the same in little endian and big endian, no need to do any conversion before doing the comparison. Signed-off-by: Niklas Cassel --- nvme-print.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nvme-print.c b/nvme-print.c index 10190a31..960df96a 100644 --- a/nvme-print.c +++ b/nvme-print.c @@ -3010,12 +3010,12 @@ void nvme_show_zns_id_ns(struct nvme_zns_id_ns *ns, printf("ozcs : %u\n", le16_to_cpu(ns->ozcs)); } - if (!le32_to_cpu(ns->mar) && human) + if (ns->mar == 0xffffffff && human) printf("mar : No Limit\n"); else printf("mar : %#x\n", le32_to_cpu(ns->mar)); - if (!le32_to_cpu(ns->mor) && human) + if (ns->mor == 0xffffffff && human) printf("mor : No Limit\n"); else printf("mor : %#x\n", le32_to_cpu(ns->mor)); -- 2.50.1