Skip to content

Commit

Permalink
types: fix status code type bug (wrong masking)
Browse files Browse the repository at this point in the history
the error comes from fc274c5
using NVME_GET for masked value linux-nvme#148

Signed-off-by: Steven Seungcheol Lee <[email protected]>
  • Loading branch information
sc108-lee committed Mar 4, 2022
1 parent e9a32c8 commit 9d32644
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/nvme/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -5735,11 +5735,13 @@ enum nvme_status_field {
NVME_SCT_PATH = 0x3,
NVME_SCT_VS = 0x7,
NVME_SCT_MASK = 0x7,
NVME_SCT_SHIFT = 0x8,

/*
* Status Code inidicators
*/
NVME_SC_MASK = 0xff,
NVME_SC_SHIFT = 0x0,

/*
* Generic Command Status Codes:
Expand Down Expand Up @@ -5923,7 +5925,7 @@ enum nvme_status_field {
*/
static inline __u16 nvme_status_code_type(__u16 status_field)
{
return status_field & NVME_SCT_MASK;
return NVME_GET(status_field, SCT);
}

/**
Expand All @@ -5934,7 +5936,7 @@ static inline __u16 nvme_status_code_type(__u16 status_field)
*/
static inline __u16 nvme_status_code(__u16 status_field)
{
return status_field & NVME_SC_MASK;
return NVME_GET(status_field, SC);
}

/**
Expand Down

0 comments on commit 9d32644

Please sign in to comment.