diff options
author | Hannes Reinecke <hare@suse.de> | 2021-04-27 10:30:14 +0200 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2021-06-01 04:48:21 +0200 |
commit | d0672a03e0af5dd4b07dc9175b38e44290722192 (patch) | |
tree | d7b4890299d7b8ea026d14ed7775468acf3d30fe /drivers/scsi/scsi_error.c | |
parent | scsi: core: Introduce scsi_build_sense() (diff) | |
download | linux-d0672a03e0af5dd4b07dc9175b38e44290722192.tar.xz linux-d0672a03e0af5dd4b07dc9175b38e44290722192.zip |
scsi: core: Introduce scsi_status_is_check_condition()
Add a helper function scsi_status_is_check_condition() to encapsulate the
frequent checks for SAM_STAT_CHECK_CONDITION.
Link: https://lore.kernel.org/r/20210427083046.31620-9-hare@suse.de
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/scsi_error.c')
-rw-r--r-- | drivers/scsi/scsi_error.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index d8fafe77dbbe..0967021cc06e 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c @@ -1258,7 +1258,7 @@ int scsi_eh_get_sense(struct list_head *work_q, current->comm)); break; } - if (status_byte(scmd->result) != CHECK_CONDITION) + if (!scsi_status_is_check_condition(scmd->result)) /* * don't request sense if there's no check condition * status because the error we're processing isn't one @@ -1774,7 +1774,7 @@ int scsi_noretry_cmd(struct scsi_cmnd *scmd) return (scmd->request->cmd_flags & REQ_FAILFAST_DRIVER); } - if (status_byte(scmd->result) != CHECK_CONDITION) + if (!scsi_status_is_check_condition(scmd->result)) return 0; check_type: |