nvme: remove redundant status mask

JIRA: https://issues.redhat.com/browse/RHEL-25547

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>
(cherry picked from commit 6f9a71c61183d6849d5aeab085b210c10398af9a)
Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
This commit is contained in:
Maurizio Lombardi 2024-03-13 16:24:40 +01:00
parent 11f502c97b
commit 9afc6976c0
1 changed files with 1 additions and 1 deletions

View 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";
}