Re: [PATCH v4 12/52] NCR5380: Use scsi_cmd_to_rq() instead of scsi_cmnd.request

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 7 Aug 2021, Bart Van Assche wrote:

> 
> How about replacing patch 12/52 with the (totally untested) patch below?
> 
> Thanks,
> 
> Bart.
> 
> 
> Subject: [PATCH] NCR5380: Use sc_data_direction instead of rq_data_dir()
> 
> This patch prepares for the removal of the request pointer from struct
> scsi_cmnd and does not change any functionality.
> 
> Suggested-by: Finn Thain <fthain@xxxxxxxxxxxxxx>
> Cc: Finn Thain <fthain@xxxxxxxxxxxxxx>

Acked-by: Finn Thain <fthain@xxxxxxxxxxxxxx>

Thanks, Bart.

> Cc: Michael Schmitz <schmitzmic@xxxxxxxxx>
> Signed-off-by: Bart Van Assche <bvanassche@xxxxxxx>
> ---
>  drivers/scsi/NCR5380.c   | 6 +++---
>  drivers/scsi/sun3_scsi.c | 3 ++-
>  2 files changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/scsi/NCR5380.c b/drivers/scsi/NCR5380.c
> index 3baadd068768..a85589a2a8af 100644
> --- a/drivers/scsi/NCR5380.c
> +++ b/drivers/scsi/NCR5380.c
> @@ -778,7 +778,7 @@ static void NCR5380_dma_complete(struct Scsi_Host *instance)
>  	}
> 
>  #ifdef CONFIG_SUN3
> -	if ((sun3scsi_dma_finish(rq_data_dir(hostdata->connected->request)))) {
> +	if (sun3scsi_dma_finish(hostdata->connected->sc_data_direction)) {
>  		pr_err("scsi%d: overrun in UDC counter -- not prepared to deal with this!\n",
>  		       instance->host_no);
>  		BUG();
> @@ -1710,7 +1710,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance)
>  				count = sun3scsi_dma_xfer_len(hostdata, cmd);
> 
>  				if (count > 0) {
> -					if (rq_data_dir(cmd->request))
> +					if (cmd->sc_data_direction == DMA_TO_DEVICE)
>  						sun3scsi_dma_send_setup(hostdata,
>  						                        cmd->SCp.ptr, count);
>  					else
> @@ -2158,7 +2158,7 @@ static void NCR5380_reselect(struct Scsi_Host *instance)
>  		count = sun3scsi_dma_xfer_len(hostdata, tmp);
> 
>  		if (count > 0) {
> -			if (rq_data_dir(tmp->request))
> +			if (tmp->sc_data_direction == DMA_TO_DEVICE)
>  				sun3scsi_dma_send_setup(hostdata,
>  				                        tmp->SCp.ptr, count);
>  			else
> diff --git a/drivers/scsi/sun3_scsi.c b/drivers/scsi/sun3_scsi.c
> index 2e3fbc2fae97..af71ab112a84 100644
> --- a/drivers/scsi/sun3_scsi.c
> +++ b/drivers/scsi/sun3_scsi.c
> @@ -366,10 +366,11 @@ static inline int sun3scsi_dma_start(unsigned long count, unsigned char *data)
>  }
> 
>  /* clean up after our dma is done */
> -static int sun3scsi_dma_finish(int write_flag)
> +static int sun3scsi_dma_finish(enum dma_data_direction data_dir)
>  {
>  	unsigned short __maybe_unused count;
>  	unsigned short fifo;
> +	const bool write_flag = data_dir == DMA_TO_DEVICE;
>  	int ret = 0;
>  	
>  	sun3_dma_active = 0;
> 



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux