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

Finn Thain
2021-04-22T09:35:30Z

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?