]> www.infradead.org Git - users/sagi/libnvme.git/commitdiff
examples: fix incorrect controller status in MI info output
authorLior Weintraub <liorw@pliops.com>
Mon, 24 Apr 2023 05:26:57 +0000 (08:26 +0300)
committerDaniel Wagner <wagi@monom.org>
Thu, 27 Apr 2023 13:01:08 +0000 (15:01 +0200)
In the mi-mctp example, we're incorrectly reporting the percent drive
life used as the controller status. Fix the controller status output
to use the correct (ccs) field.

Signed-off-by: Lior Weintraub <liorw@pliops.com>
Reviewed-by: Jeremy Kerr <jk@codeconstruct.com.au>
examples/mi-mctp.c

index c9a38523f4b521f0426b56a1b460c499d202de20..801924913d660cdf1d9cb864a680c94191afbfed 100644 (file)
@@ -113,7 +113,7 @@ int do_info(nvme_mi_ep_t ep)
        printf(" smart warnings:    0x%x\n", ss_health.sw);
        printf(" composite temp:    %d\n", ss_health.ctemp);
        printf(" drive life used:   %d%%\n", ss_health.pdlu);
-       printf(" controller status: 0x%04x\n", le16_to_cpu(ss_health.pdlu));
+       printf(" controller status: 0x%04x\n", le16_to_cpu(ss_health.ccs));
 
        return 0;
 }