diff options
author | Christoph Hellwig <hch@lst.de> | 2020-10-05 10:41:25 +0200 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2020-10-07 21:48:27 -0400 |
commit | 40b93836a136a46d7240aa13840c87fb239c865c (patch) | |
tree | e06e027d096a3e6a7f67b8d5aab43aad0943c0c9 /drivers/scsi | |
parent | 2ceda20f0a99a74a82b78870f3b3e5fa93087a7f (diff) | |
download | linux-40b93836a136a46d7240aa13840c87fb239c865c.tar.bz2 |
scsi: core: Use rq_dma_dir in scsi_setup_cmnd()
Link: https://lore.kernel.org/r/20201005084130.143273-6-hch@lst.de
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/scsi_lib.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index b0bd15f53467..3325ca22bf6d 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -1215,12 +1215,7 @@ static blk_status_t scsi_setup_cmnd(struct scsi_device *sdev, struct scsi_cmnd *cmd = blk_mq_rq_to_pdu(req); blk_status_t ret; - if (!blk_rq_bytes(req)) - cmd->sc_data_direction = DMA_NONE; - else if (rq_data_dir(req) == WRITE) - cmd->sc_data_direction = DMA_TO_DEVICE; - else - cmd->sc_data_direction = DMA_FROM_DEVICE; + cmd->sc_data_direction = rq_dma_dir(req); if (blk_rq_is_scsi(req)) ret = scsi_setup_scsi_cmnd(sdev, req); |