diff mbox

[03/10] libsas: use ata_is_ncq() and ata_has_dma() accessors

Message ID 1468454751-12466-4-git-send-email-hch@lst.de
State Not Applicable
Delegated to: David Miller
Headers show

Commit Message

Christoph Hellwig July 14, 2016, 12:05 a.m. UTC
From: Hannes Reinecke <hare@suse.de>

Use accessors instead of the raw protocol value.

Signed-off-by: Hannes Reinecke <hare@suse.com>
[hch: trivial cleanup of the ata_task assignments]
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 drivers/scsi/libsas/sas_ata.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

Comments

Tejun Heo July 14, 2016, 2:45 p.m. UTC | #1
On Thu, Jul 14, 2016 at 09:05:44AM +0900, Christoph Hellwig wrote:
> From: Hannes Reinecke <hare@suse.de>
> 
> Use accessors instead of the raw protocol value.
> 
> Signed-off-by: Hannes Reinecke <hare@suse.com>
> [hch: trivial cleanup of the ata_task assignments]
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Applied 1-3 to libata/for-4.8.

Thanks.
diff mbox

Patch

diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c
index 935c430..497bc15 100644
--- a/drivers/scsi/libsas/sas_ata.c
+++ b/drivers/scsi/libsas/sas_ata.c
@@ -233,15 +233,8 @@  static unsigned int sas_ata_qc_issue(struct ata_queued_cmd *qc)
 	task->task_state_flags = SAS_TASK_STATE_PENDING;
 	qc->lldd_task = task;
 
-	switch (qc->tf.protocol) {
-	case ATA_PROT_NCQ:
-		task->ata_task.use_ncq = 1;
-		/* fall through */
-	case ATAPI_PROT_DMA:
-	case ATA_PROT_DMA:
-		task->ata_task.dma_xfer = 1;
-		break;
-	}
+	task->ata_task.use_ncq = ata_is_ncq(qc->tf.protocol);
+	task->ata_task.dma_xfer = ata_is_dma(qc->tf.protocol);
 
 	if (qc->scsicmd)
 		ASSIGN_SAS_TASK(qc->scsicmd, task);