diff mbox series

[12/52] gdth: use standard SAM status codes

Message ID 20191104090151.129140-13-hare@suse.de (mailing list archive)
State Deferred
Headers show
Series Revamp SCSI result values | expand

Commit Message

Hannes Reinecke Nov. 4, 2019, 9:01 a.m. UTC
Use standard SAM status codes and omit the explicit shift to convert
from linux-specific ones.

Signed-off-by: Hannes Reinecke <hare@suse.de>
---
 drivers/scsi/gdth.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

Comments

Bart Van Assche Nov. 4, 2019, 5:40 p.m. UTC | #1
On 11/4/19 1:01 AM, Hannes Reinecke wrote:
> Use standard SAM status codes and omit the explicit shift to convert
> from linux-specific ones.

Reviewed-by: Bart Van Assche <bvanassche@acm.org>
diff mbox series

Patch

diff --git a/drivers/scsi/gdth.c b/drivers/scsi/gdth.c
index fe03410268e6..d23e277c1b85 100644
--- a/drivers/scsi/gdth.c
+++ b/drivers/scsi/gdth.c
@@ -1677,7 +1677,7 @@  static void gdth_next(gdth_ha_str *ha)
                 memset((char*)nscp->sense_buffer,0,16);
                 nscp->sense_buffer[0] = 0x70;
                 nscp->sense_buffer[2] = NOT_READY;
-                nscp->result = (DID_OK << 16) | (CHECK_CONDITION << 1);
+		nscp->result = (DID_OK << 16) | SAM_STAT_CHECK_CONDITION;
                 if (!nscp_cmndinfo->wait_for_completion)
                     nscp_cmndinfo->wait_for_completion++;
                 else
@@ -1722,7 +1722,7 @@  static void gdth_next(gdth_ha_str *ha)
                     memset((char*)nscp->sense_buffer,0,16);
                     nscp->sense_buffer[0] = 0x70;
                     nscp->sense_buffer[2] = UNIT_ATTENTION;
-                    nscp->result = (DID_OK << 16) | (CHECK_CONDITION << 1);
+		    nscp->result = (DID_OK << 16) | SAM_STAT_CHECK_CONDITION;
                     if (!nscp_cmndinfo->wait_for_completion)
                         nscp_cmndinfo->wait_for_completion++;
                     else
@@ -1774,7 +1774,7 @@  static void gdth_next(gdth_ha_str *ha)
                     memset((char*)nscp->sense_buffer,0,16);
                     nscp->sense_buffer[0] = 0x70;
                     nscp->sense_buffer[2] = UNIT_ATTENTION;
-                    nscp->result = (DID_OK << 16) | (CHECK_CONDITION << 1);
+		    nscp->result = (DID_OK << 16) | SAM_STAT_CHECK_CONDITION;
                     if (!nscp_cmndinfo->wait_for_completion)
                         nscp_cmndinfo->wait_for_completion++;
                     else
@@ -2802,7 +2802,7 @@  static int gdth_sync_event(gdth_ha_str *ha, int service, u8 index,
                 memset((char*)scp->sense_buffer,0,16);
                 scp->sense_buffer[0] = 0x70;
                 scp->sense_buffer[2] = NOT_READY;
-                scp->result = (DID_OK << 16) | (CHECK_CONDITION << 1);
+		scp->result = (DID_OK << 16) | SAM_STAT_CHECK_CONDITION;
             } else if (service == CACHESERVICE) {
                 if (ha->status == S_CACHE_UNKNOWN &&
                     (ha->hdr[t].cluster_type & 
@@ -2812,11 +2812,11 @@  static int gdth_sync_event(gdth_ha_str *ha, int service, u8 index,
                 }
                 memset((char*)scp->sense_buffer,0,16);
                 if (ha->status == (u16)S_CACHE_RESERV) {
-                    scp->result = (DID_OK << 16) | (RESERVATION_CONFLICT << 1);
+                    scp->result = (DID_OK << 16) | SAM_STAT_RESERVATION_CONFLICT;
                 } else {
                     scp->sense_buffer[0] = 0x70;
                     scp->sense_buffer[2] = NOT_READY;
-                    scp->result = (DID_OK << 16) | (CHECK_CONDITION << 1);
+                    scp->result = (DID_OK << 16) | SAM_STAT_CHECK_CONDITION;
                 }
                 if (!cmndinfo->internal_command) {
                     ha->dvr.size = sizeof(ha->dvr.eu.sync);