Skip to content

Commit 12980c1

Browse files
committed
ata: libata-eh: Use ata_ncq_enabled() in ata_eh_speed_down()
In ata_eh_speed_down(), instead of hard-coding the test on the device flags to detect if NCQ is supported and enabled, use ata_ncq_enabled(). Signed-off-by: Damien Le Moal <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Reviewed-by: Johannes Thumshirn <[email protected]> Reviewed-by: John Garry <[email protected]>
1 parent 45623d3 commit 12980c1

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/ata/libata-eh.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1817,9 +1817,7 @@ static unsigned int ata_eh_speed_down(struct ata_device *dev,
18171817
verdict = ata_eh_speed_down_verdict(dev);
18181818

18191819
/* turn off NCQ? */
1820-
if ((verdict & ATA_EH_SPDN_NCQ_OFF) &&
1821-
(dev->flags & (ATA_DFLAG_PIO | ATA_DFLAG_NCQ |
1822-
ATA_DFLAG_NCQ_OFF)) == ATA_DFLAG_NCQ) {
1820+
if ((verdict & ATA_EH_SPDN_NCQ_OFF) && ata_ncq_enabled(dev)) {
18231821
dev->flags |= ATA_DFLAG_NCQ_OFF;
18241822
ata_dev_warn(dev, "NCQ disabled due to excessive errors\n");
18251823
goto done;

0 commit comments

Comments
 (0)