diff options
author | Damien Le Moal <damien.lemoal@opensource.wdc.com> | 2022-02-20 12:18:02 +0900 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2022-02-22 21:31:20 -0500 |
commit | a1e7c7991923ab736e5be0ebcf65499acb04d583 (patch) | |
tree | 84069e022f5c90f69848d5d70c4d36783e87ec41 /drivers/scsi/libsas | |
parent | f792a3629f4c4aa4c3703d66b43ce1edcc3ec09a (diff) | |
download | linux-stable-a1e7c7991923ab736e5be0ebcf65499acb04d583.tar.gz linux-stable-a1e7c7991923ab736e5be0ebcf65499acb04d583.tar.bz2 linux-stable-a1e7c7991923ab736e5be0ebcf65499acb04d583.zip |
scsi: libsas: Simplify sas_ata_qc_issue() detection of NCQ commands
To detect if a command is NCQ, there is no need to test all possible NCQ
command codes. Instead, use ata_is_ncq() to test the command protocol.
Link: https://lore.kernel.org/r/20220220031810.738362-24-damien.lemoal@opensource.wdc.com
Reviewed-by: John Garry <john.garry@huawei.com>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/libsas')
-rw-r--r-- | drivers/scsi/libsas/sas_ata.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c index dd4ae5e8cb5c..d34c82e24d9a 100644 --- a/drivers/scsi/libsas/sas_ata.c +++ b/drivers/scsi/libsas/sas_ata.c @@ -179,14 +179,9 @@ static unsigned int sas_ata_qc_issue(struct ata_queued_cmd *qc) task->task_proto = SAS_PROTOCOL_STP; task->task_done = sas_ata_task_done; - if (qc->tf.command == ATA_CMD_FPDMA_WRITE || - qc->tf.command == ATA_CMD_FPDMA_READ || - qc->tf.command == ATA_CMD_FPDMA_RECV || - qc->tf.command == ATA_CMD_FPDMA_SEND || - qc->tf.command == ATA_CMD_NCQ_NON_DATA) { - /* Need to zero out the tag libata assigned us */ + /* For NCQ commands, zero out the tag libata assigned us */ + if (ata_is_ncq(qc->tf.protocol)) qc->tf.nsect = 0; - } ata_tf_to_fis(&qc->tf, qc->dev->link->pmp, 1, (u8 *)&task->ata_task.fis); task->uldd_task = qc; |