From: Niklas Cassel Date: Fri, 23 Oct 2020 09:37:30 +0000 (+0200) Subject: nvme-print: fix ZNS MAR/MOR print format X-Git-Tag: v1.14~154 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=0720599cd0757d5bef8c8b1032a1de11968976a8;p=users%2Fsagi%2Fnvme-cli.git nvme-print: fix ZNS MAR/MOR print format MAR is currently printed as unsigned. MOR is currently printed as signed. They should use the same print format. Printing MOR as unsigned on a controller that has no limit, shows as -1, which doesn't make sense. Since no limit is represented as 0xffffffff in the ZNS spec, printing MAR/MOR as hex makes the most sense. Signed-off-by: Niklas Cassel --- diff --git a/nvme-print.c b/nvme-print.c index 1f298f4a..c51ee4a0 100644 --- a/nvme-print.c +++ b/nvme-print.c @@ -3016,7 +3016,7 @@ void nvme_show_zns_id_ns(struct nvme_zns_id_ns *ns, printf("mar : %u\tActive Resources\n", le32_to_cpu(ns->mar) + 1); } } else { - printf("mar : %u\n", le32_to_cpu(ns->mar)); + printf("mar : %#x\n", le32_to_cpu(ns->mar)); } if (human) { @@ -3026,7 +3026,7 @@ void nvme_show_zns_id_ns(struct nvme_zns_id_ns *ns, printf("mor : %u\tOpen Resources\n", le32_to_cpu(ns->mor) + 1); } } else { - printf("mor : %d\n", le32_to_cpu(ns->mor)); + printf("mor : %#x\n", le32_to_cpu(ns->mor)); } if (!le32_to_cpu(ns->rrl) && human)