Re: [PATCH 15/42] NCR5380: use SCSI result accessors

Finn Thain
2021-04-22T09:36:12Z

On Wed, 21 Apr 2021, Hannes Reinecke wrote:

> Use accessors to set the SCSI result.
>
> Signed-off-by: Hannes Reinecke <hare@suse.de>
> ---
> drivers/scsi/NCR5380.c | 28 ++++++++++++++--------------
> 1 file changed, 14 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/scsi/NCR5380.c b/drivers/scsi/NCR5380.c
> index d7594b794d3c..855edda9db41 100644
> --- a/drivers/scsi/NCR5380.c
> +++ b/drivers/scsi/NCR5380.c
> @@ -538,7 +538,7 @@ static void complete_cmd(struct Scsi_Host *instance,
>
> if (hostdata->sensing == cmd) {
> /* Autosense processing ends here */
> - if (status_byte(cmd->result) != GOOD) {
> + if (get_status_byte(cmd) != SAM_STAT_GOOD) {
> scsi_eh_restore_cmnd(cmd, &hostdata->ses);
> } else {
> scsi_eh_restore_cmnd(cmd, &hostdata->ses);
> @@ -567,18 +567,19 @@ static int NCR5380_queue_command(struct Scsi_Host *instance,
> struct NCR5380_cmd *ncmd = scsi_cmd_priv(cmd);
> unsigned long flags;
>
> + set_host_byte(cmd, DID_OK);
> + set_status_byte(cmd, SAM_STAT_GOOD);
> #if (NDEBUG & NDEBUG_NO_WRITE)
> switch (cmd->cmnd[0]) {
> case WRITE_6:
> case WRITE_10:
> shost_printk(KERN_DEBUG, instance, "WRITE attempted with NDEBUG_NO_WRITE set\n");
> - cmd->result = (DID_ERROR << 16);
> + set_host_byte(cmd, DID_ERROR);
> cmd->scsi_done(cmd);
> return 0;
> }
> #endif /* (NDEBUG & NDEBUG_NO_WRITE) */
>
> - cmd->result = 0;
>

Please remove the superfluous blank line.