@@ -261,7 +261,7 @@ void nvme_delete_ctrl_sync(struct nvme_ctrl *ctrl)
261261
262262static blk_status_t nvme_error_status (u16 status )
263263{
264- switch (status & 0x7ff ) {
264+ switch (status & NVME_SCT_SC_MASK ) {
265265 case NVME_SC_SUCCESS :
266266 return BLK_STS_OK ;
267267 case NVME_SC_CAP_EXCEEDED :
@@ -329,8 +329,8 @@ static void nvme_log_error(struct request *req)
329329 nvme_sect_to_lba (ns -> head , blk_rq_pos (req )),
330330 blk_rq_bytes (req ) >> ns -> head -> lba_shift ,
331331 nvme_get_error_status_str (nr -> status ),
332- nr -> status >> 8 & 7 , /* Status Code Type */
333- nr -> status & 0xff , /* Status Code */
332+ NVME_SCT ( nr -> status ), /* Status Code Type */
333+ nr -> status & NVME_SC_MASK , /* Status Code */
334334 nr -> status & NVME_SC_MORE ? "MORE " : "" ,
335335 nr -> status & NVME_SC_DNR ? "DNR " : "" );
336336 return ;
@@ -341,8 +341,8 @@ static void nvme_log_error(struct request *req)
341341 nvme_get_admin_opcode_str (nr -> cmd -> common .opcode ),
342342 nr -> cmd -> common .opcode ,
343343 nvme_get_error_status_str (nr -> status ),
344- nr -> status >> 8 & 7 , /* Status Code Type */
345- nr -> status & 0xff , /* Status Code */
344+ NVME_SCT ( nr -> status ) , /* Status Code Type */
345+ nr -> status & NVME_SC_MASK , /* Status Code */
346346 nr -> status & NVME_SC_MORE ? "MORE " : "" ,
347347 nr -> status & NVME_SC_DNR ? "DNR " : "" );
348348}
@@ -359,8 +359,8 @@ static void nvme_log_err_passthru(struct request *req)
359359 nvme_get_admin_opcode_str (nr -> cmd -> common .opcode ),
360360 nr -> cmd -> common .opcode ,
361361 nvme_get_error_status_str (nr -> status ),
362- nr -> status >> 8 & 7 , /* Status Code Type */
363- nr -> status & 0xff , /* Status Code */
362+ NVME_SCT ( nr -> status ), /* Status Code Type */
363+ nr -> status & NVME_SC_MASK , /* Status Code */
364364 nr -> status & NVME_SC_MORE ? "MORE " : "" ,
365365 nr -> status & NVME_SC_DNR ? "DNR " : "" ,
366366 nr -> cmd -> common .cdw10 ,
@@ -388,7 +388,7 @@ static inline enum nvme_disposition nvme_decide_disposition(struct request *req)
388388 nvme_req (req )-> retries >= nvme_max_retries )
389389 return COMPLETE ;
390390
391- if ((nvme_req (req )-> status & 0x7ff ) == NVME_SC_AUTH_REQUIRED )
391+ if ((nvme_req (req )-> status & NVME_SCT_SC_MASK ) == NVME_SC_AUTH_REQUIRED )
392392 return AUTHENTICATE ;
393393
394394 if (req -> cmd_flags & REQ_NVME_MPATH ) {
@@ -1256,7 +1256,7 @@ EXPORT_SYMBOL_NS_GPL(nvme_passthru_end, NVME_TARGET_PASSTHRU);
12561256
12571257/*
12581258 * Recommended frequency for KATO commands per NVMe 1.4 section 7.12.1:
1259- *
1259+ *
12601260 * The host should send Keep Alive commands at half of the Keep Alive Timeout
12611261 * accounting for transport roundtrip times [..].
12621262 */
0 commit comments