From: Niklas Cassel Date: Fri, 18 Sep 2020 15:40:16 +0000 (+0000) Subject: nvme-print: fix ZNS MAR/MOR print X-Git-Tag: v1.13~12 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=55568b4b418f2db24928242fb6780ccc4d02b1f7;p=users%2Fsagi%2Fnvme-cli.git 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 --- 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));