]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
nvme-cli: fix wrong bitmask in number of rpmb units.
authorMinwoo Im <minwoo.im.dev@gmail.com>
Sat, 28 Oct 2017 18:01:52 +0000 (03:01 +0900)
committerKeith Busch <keith.busch@intel.com>
Mon, 30 Oct 2017 19:35:31 +0000 (13:35 -0600)
Number of RPMB Units is a 3-bit field[02:00].
Bitmask should be 0111b(7h) to get this field.

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
nvme-print.c

index 9f524cdc7d79409b42d3b2d32f94d5ef946336cc..e79b3f48c7f41493507cb4fa2660de3f6c4eade3 100644 (file)
@@ -218,7 +218,7 @@ static void show_nvme_id_ctrl_rpmbs(__le32 ctrl_rpmbs)
        __u32 tsz = (rpmbs & 0xFF0000) >> 16;
        __u32 rsvd = (rpmbs & 0xFFC0) >> 6;
        __u32 auth = (rpmbs & 0x38) >> 3;
-       __u32 rpmb = rpmbs & 0x3;
+       __u32 rpmb = rpmbs & 0x7;
 
        printf(" [31:24]: %#x\tAccess Size\n", asz);
        printf(" [23:16]: %#x\tTotal Size\n", tsz);