]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
nvme-print: fix ZNS MAR/MOR print
authorNiklas Cassel <niklas.cassel@wdc.com>
Fri, 18 Sep 2020 15:40:16 +0000 (15:40 +0000)
committerKeith Busch <kbusch@kernel.org>
Fri, 18 Sep 2020 16:27:59 +0000 (10:27 -0600)
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 <niklas.cassel@wdc.com>
nvme-print.c

index 10190a313be2f6040f3ea0f8c5f6092d1255eb42..960df96af77b88f00138b4ec6dd4be4b52c2a382 100644 (file)
@@ -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));