Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

scsi: pm8001: Simplify pm8001_get_ncq_tag()

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-26-damien.lemoal@opensource.wdc.com
Reviewed-by: John Garry <john.garry@huawei.com>
Reviewed-by: Jack Wang <jinpu.wang@ionos.com>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Damien Le Moal and committed by
Martin K. Petersen
bf67e693 0c4ad6c3

+5 -9
+5 -9
drivers/scsi/pm8001/pm8001_sas.c
··· 304 304 u32 pm8001_get_ncq_tag(struct sas_task *task, u32 *tag) 305 305 { 306 306 struct ata_queued_cmd *qc = task->uldd_task; 307 - if (qc) { 308 - if (qc->tf.command == ATA_CMD_FPDMA_WRITE || 309 - qc->tf.command == ATA_CMD_FPDMA_READ || 310 - qc->tf.command == ATA_CMD_FPDMA_RECV || 311 - qc->tf.command == ATA_CMD_FPDMA_SEND || 312 - qc->tf.command == ATA_CMD_NCQ_NON_DATA) { 313 - *tag = qc->tag; 314 - return 1; 315 - } 307 + 308 + if (qc && ata_is_ncq(qc->tf.protocol)) { 309 + *tag = qc->tag; 310 + return 1; 316 311 } 312 + 317 313 return 0; 318 314 } 319 315