Skip to content

Commit aafa162

Browse files
authored
Merge pull request #274 from sc108-lee/status_code_type
types: fix status code type bug (wrong masking)
2 parents e9a32c8 + 9d32644 commit aafa162

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/nvme/types.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5735,11 +5735,13 @@ enum nvme_status_field {
57355735
NVME_SCT_PATH = 0x3,
57365736
NVME_SCT_VS = 0x7,
57375737
NVME_SCT_MASK = 0x7,
5738+
NVME_SCT_SHIFT = 0x8,
57385739

57395740
/*
57405741
* Status Code inidicators
57415742
*/
57425743
NVME_SC_MASK = 0xff,
5744+
NVME_SC_SHIFT = 0x0,
57435745

57445746
/*
57455747
* Generic Command Status Codes:
@@ -5923,7 +5925,7 @@ enum nvme_status_field {
59235925
*/
59245926
static inline __u16 nvme_status_code_type(__u16 status_field)
59255927
{
5926-
return status_field & NVME_SCT_MASK;
5928+
return NVME_GET(status_field, SCT);
59275929
}
59285930

59295931
/**
@@ -5934,7 +5936,7 @@ static inline __u16 nvme_status_code_type(__u16 status_field)
59345936
*/
59355937
static inline __u16 nvme_status_code(__u16 status_field)
59365938
{
5937-
return status_field & NVME_SC_MASK;
5939+
return NVME_GET(status_field, SC);
59385940
}
59395941

59405942
/**

0 commit comments

Comments
 (0)