mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	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>
This commit is contained in:
		
							parent
							
								
									2ceda20f0a
								
							
						
					
					
						commit
						40b93836a1
					
				
					 1 changed files with 1 additions and 6 deletions
				
			
		| 
						 | 
					@ -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);
 | 
						struct scsi_cmnd *cmd = blk_mq_rq_to_pdu(req);
 | 
				
			||||||
	blk_status_t ret;
 | 
						blk_status_t ret;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (!blk_rq_bytes(req))
 | 
						cmd->sc_data_direction = rq_dma_dir(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;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (blk_rq_is_scsi(req))
 | 
						if (blk_rq_is_scsi(req))
 | 
				
			||||||
		ret = scsi_setup_scsi_cmnd(sdev, req);
 | 
							ret = scsi_setup_scsi_cmnd(sdev, req);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue