nvme: remove redundant status mask
authorCaleb Sander <csander@purestorage.com>
Wed, 31 Jan 2024 16:43:12 +0000 (09:43 -0700)
committerKeith Busch <kbusch@kernel.org>
Thu, 1 Feb 2024 00:06:12 +0000 (16:06 -0800)
In nvme_get_error_status_str(), the status code is already masked
with 0x7ff at the beginning of the function.
Don't bother masking it again when indexing nvme_statuses.

Signed-off-by: Caleb Sander <csander@purestorage.com>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Keith Busch <kbusch@kernel.org>
drivers/nvme/host/constants.c

index 8791283ec6ad2aad3fe798e7e2f35c7def22022f..6f2ebb5fcdb05e1e65971643c9aff2c3f2271c19 100644 (file)
@@ -175,7 +175,7 @@ const char *nvme_get_error_status_str(u16 status)
 {
        status &= 0x7ff;
        if (status < ARRAY_SIZE(nvme_statuses) && nvme_statuses[status])
-               return nvme_statuses[status & 0x7ff];
+               return nvme_statuses[status];
        return "Unknown";
 }