Commit 40b93836 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Martin K. Petersen

scsi: core: Use rq_dma_dir in scsi_setup_cmnd()

Link: https://lore.kernel.org/r/20201005084130.143273-6-hch@lst.deReviewed-by: default avatarHannes Reinecke <hare@suse.de>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 2ceda20f
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment