From patchwork Thu Jul 14 00:05:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 648124 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3rqbZm1f1Jz9s8d for ; Thu, 14 Jul 2016 10:06:08 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751425AbcGNAGH (ORCPT ); Wed, 13 Jul 2016 20:06:07 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:55696 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751342AbcGNAGH (ORCPT ); Wed, 13 Jul 2016 20:06:07 -0400 Received: from p7077-ipngn101marunouchi.tokyo.ocn.ne.jp ([114.177.62.77] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.85_2 #1 (Red Hat Linux)) id 1bNUAH-0002IV-BW; Thu, 14 Jul 2016 00:06:05 +0000 From: Christoph Hellwig To: tj@kernel.org Cc: hare@suse.com, damien.lemoal@hgst.com, linux-ide@vger.kernel.org, Hannes Reinecke Subject: [PATCH 03/10] libsas: use ata_is_ncq() and ata_has_dma() accessors Date: Thu, 14 Jul 2016 09:05:44 +0900 Message-Id: <1468454751-12466-4-git-send-email-hch@lst.de> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1468454751-12466-1-git-send-email-hch@lst.de> References: <1468454751-12466-1-git-send-email-hch@lst.de> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org From: Hannes Reinecke Use accessors instead of the raw protocol value. Signed-off-by: Hannes Reinecke [hch: trivial cleanup of the ata_task assignments] Signed-off-by: Christoph Hellwig --- drivers/scsi/libsas/sas_ata.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) 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);