From c65be1a63f1df224c8f22d72b9ec824241ada585 Mon Sep 17 00:00:00 2001 From: Johannes Thumshirn Date: Mon, 25 Jun 2018 13:20:58 +0200 Subject: scsi: core: check for equality of result byte values When evaluating a SCSI command's result using the field access macros, check for equality of the fields and not if a specific bit is set. This is a preparation patch, for reworking the results field in the SCSI command. Signed-off-by: Johannes Thumshirn Reviewed-by: Christoph Hellwig Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen --- drivers/scsi/scsi_lib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/scsi/scsi_lib.c') diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 252edd61a688..a1a0a2903263 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -911,7 +911,7 @@ static void scsi_io_completion_action(struct scsi_cmnd *cmd, int result) */ if (!level && __ratelimit(&_rs)) { scsi_print_result(cmd, NULL, FAILED); - if (driver_byte(result) & DRIVER_SENSE) + if (driver_byte(result) == DRIVER_SENSE) scsi_print_sense(cmd); scsi_print_command(cmd); } @@ -2605,7 +2605,7 @@ scsi_mode_sense(struct scsi_device *sdev, int dbd, int modepage, * ILLEGAL REQUEST if the code page isn't supported */ if (use_10_for_ms && !scsi_status_is_good(result) && - (driver_byte(result) & DRIVER_SENSE)) { + driver_byte(result) == DRIVER_SENSE) { if (scsi_sense_valid(sshdr)) { if ((sshdr->sense_key == ILLEGAL_REQUEST) && (sshdr->asc == 0x20) && (sshdr->ascq == 0)) { -- cgit v1.2.3