]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
nvme: random fixes in primary controller capabilities
authorGollu Appalanaidu <anaidu.gollu@samsung.com>
Fri, 2 Apr 2021 16:54:00 +0000 (22:24 +0530)
committerKeith Busch <kbusch@kernel.org>
Sun, 4 Apr 2021 15:53:56 +0000 (09:53 -0600)
Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
nvme-print.c
nvme.c

index 1a8f3cde05ec8984a7fa0590a8ba43cb699f9e81..7828bdb4422c0a9e033ff360906d743b0cf0e7dc 100755 (executable)
@@ -4233,12 +4233,12 @@ static void nvme_show_primary_ctrl_caps_crt(__u8 crt)
 {
        __u8 rsvd = (crt & 0xFC) >> 2;
        __u8 vi = (crt & 0x2) >> 1;
-       __u8 vq = (crt & 0x1) >> 0;
+       __u8 vq = crt & 0x1;
 
        if (rsvd)
                printf("  [7:2] : %#x\tReserved\n", rsvd);
        printf("  [1:1] %#x\tVI Resources are %ssupported\n", vi, vi ? "" : "not ");
-       printf("  [1:1] %#x\tVQ Resources are %ssupported\n", vq, vq ? "" : "not ");
+       printf("  [0:0] %#x\tVQ Resources are %ssupported\n", vq, vq ? "" : "not ");
 }
 
 void nvme_show_primary_ctrl_caps(const struct nvme_primary_ctrl_caps *caps,
@@ -4271,7 +4271,6 @@ void nvme_show_primary_ctrl_caps(const struct nvme_primary_ctrl_caps *caps,
        printf("vigran    : %d\n", le16_to_cpu(caps->vigran));
 }
 
-
 static void json_nvme_list_secondary_ctrl(const struct nvme_secondary_controllers_list *sc_list,
                                          __u32 count)
 {
diff --git a/nvme.c b/nvme.c
index 926651f51d33f5c22ed439ecf42ebe6c2b59af42..e5a8925e11a3fdfe3dcdccc225d3d66f8cfb2ff6 100644 (file)
--- a/nvme.c
+++ b/nvme.c
@@ -2455,7 +2455,7 @@ static int primary_ctrl_caps(int argc, char **argv, struct command *cmd, struct
        err = nvme_identify_primary_ctrl_caps(fd, &caps);
        if (!err)
                nvme_show_primary_ctrl_caps(&caps, flags);
-       else if (err >0)
+       else if (err > 0)
                nvme_show_status(err);
        else
                perror("identify primary controller capabilities");