Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

scsi: 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.

Link: https://lore.kernel.org/r/20210809230355.8186-13-bvanassche@acm.org
Cc: Michael Schmitz <schmitzmic@gmail.com>
Suggested-by: Finn Thain <fthain@linux-m68k.org>
Acked-by: Finn Thain <fthain@linux-m68k.org>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Bart Van Assche and committed by
Martin K. Petersen
2e4b231a cd4b46cd

+5 -4
+3 -3
drivers/scsi/NCR5380.c
··· 778 778 } 779 779 780 780 #ifdef CONFIG_SUN3 781 - if ((sun3scsi_dma_finish(rq_data_dir(hostdata->connected->request)))) { 781 + if (sun3scsi_dma_finish(hostdata->connected->sc_data_direction)) { 782 782 pr_err("scsi%d: overrun in UDC counter -- not prepared to deal with this!\n", 783 783 instance->host_no); 784 784 BUG(); ··· 1710 1710 count = sun3scsi_dma_xfer_len(hostdata, cmd); 1711 1711 1712 1712 if (count > 0) { 1713 - if (rq_data_dir(cmd->request)) 1713 + if (cmd->sc_data_direction == DMA_TO_DEVICE) 1714 1714 sun3scsi_dma_send_setup(hostdata, 1715 1715 cmd->SCp.ptr, count); 1716 1716 else ··· 2158 2158 count = sun3scsi_dma_xfer_len(hostdata, tmp); 2159 2159 2160 2160 if (count > 0) { 2161 - if (rq_data_dir(tmp->request)) 2161 + if (tmp->sc_data_direction == DMA_TO_DEVICE) 2162 2162 sun3scsi_dma_send_setup(hostdata, 2163 2163 tmp->SCp.ptr, count); 2164 2164 else
+2 -1
drivers/scsi/sun3_scsi.c
··· 366 366 } 367 367 368 368 /* clean up after our dma is done */ 369 - static int sun3scsi_dma_finish(int write_flag) 369 + static int sun3scsi_dma_finish(enum dma_data_direction data_dir) 370 370 { 371 + const bool write_flag = data_dir == DMA_TO_DEVICE; 371 372 unsigned short __maybe_unused count; 372 373 unsigned short fifo; 373 374 int ret = 0;