diff mbox series

[16/42] NCR5380: Fold SCSI message ABORT onto DID_ABORT

Message ID 20210421174749.11221-17-hare@suse.de (mailing list archive)
State Superseded
Headers show
Series SCSI result cleanup, part 2 | expand

Commit Message

Hannes Reinecke April 21, 2021, 5:47 p.m. UTC
The message byte can take only two values, COMMAND_COMPLETE and ABORT.
So we can easily map ABORT to DID_ABORT and do not set the message byte.

Signed-off-by: Hannes Reinecke <hare@suse.de>
---
 drivers/scsi/NCR5380.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Finn Thain April 22, 2021, 9:35 a.m. UTC | #1
On Wed, 21 Apr 2021, Hannes Reinecke wrote:

> The message byte can take only two values, COMMAND_COMPLETE and ABORT.
> So we can easily map ABORT to DID_ABORT and do not set the message byte.
> 
> Signed-off-by: Hannes Reinecke <hare@suse.de>
> ---
>  drivers/scsi/NCR5380.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/NCR5380.c b/drivers/scsi/NCR5380.c
> index 855edda9db41..76b4dce22e03 100644
> --- a/drivers/scsi/NCR5380.c
> +++ b/drivers/scsi/NCR5380.c
> @@ -1827,7 +1827,8 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance)
>  					hostdata->connected = NULL;
>  					hostdata->busy[scmd_id(cmd)] &= ~(1 << cmd->device->lun);
>  
> -					set_msg_byte(cmd, cmd->SCp.Message);
> +					if (cmd->SCp.Message == ABORT)
> +						set_host_byte(cmd, DID_ABORT);
>  					set_status_byte(cmd, cmd->SCp.Status);
>  
>  					set_resid_from_SCp(cmd);
> 

Can that be expressed more succinctly? E.g.

                                 switch (tmp) {
                                 case ABORT:
+					set_host_byte(cmd, DID_ABORT);
                                 case COMMAND_COMPLETE:

Should this be folded into the preceding patch?
diff mbox series

Patch

diff --git a/drivers/scsi/NCR5380.c b/drivers/scsi/NCR5380.c
index 855edda9db41..76b4dce22e03 100644
--- a/drivers/scsi/NCR5380.c
+++ b/drivers/scsi/NCR5380.c
@@ -1827,7 +1827,8 @@  static void NCR5380_information_transfer(struct Scsi_Host *instance)
 					hostdata->connected = NULL;
 					hostdata->busy[scmd_id(cmd)] &= ~(1 << cmd->device->lun);
 
-					set_msg_byte(cmd, cmd->SCp.Message);
+					if (cmd->SCp.Message == ABORT)
+						set_host_byte(cmd, DID_ABORT);
 					set_status_byte(cmd, cmd->SCp.Status);
 
 					set_resid_from_SCp(cmd);