From: Damien Le Moal Date: Sun, 4 Jun 2023 23:16:32 +0000 (+0900) Subject: ata: libata-eh: Use ata_ncq_enabled() in ata_eh_speed_down() X-Git-Tag: v6.6.7~2489^2~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=12980c1f2f8a926dd634e27c700014b3246a99ec;p=platform%2Fkernel%2Flinux-starfive.git 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 Reviewed-by: Hannes Reinecke Reviewed-by: Johannes Thumshirn Reviewed-by: John Garry --- diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index c7336a0..b80e680 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c @@ -1817,9 +1817,7 @@ static unsigned int ata_eh_speed_down(struct ata_device *dev, verdict = ata_eh_speed_down_verdict(dev); /* turn off NCQ? */ - if ((verdict & ATA_EH_SPDN_NCQ_OFF) && - (dev->flags & (ATA_DFLAG_PIO | ATA_DFLAG_NCQ | - ATA_DFLAG_NCQ_OFF)) == ATA_DFLAG_NCQ) { + if ((verdict & ATA_EH_SPDN_NCQ_OFF) && ata_ncq_enabled(dev)) { dev->flags |= ATA_DFLAG_NCQ_OFF; ata_dev_warn(dev, "NCQ disabled due to excessive errors\n"); goto done;