From 0720599cd0757d5bef8c8b1032a1de11968976a8 Mon Sep 17 00:00:00 2001 From: Niklas Cassel Date: Fri, 23 Oct 2020 11:37:30 +0200 Subject: [PATCH] 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 --- nvme-print.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) -- 2.50.1