History

ata: add CONFIG_SATA_HOST=n version of ata_ncq_enabled()

When CONFIG_SATA_HOST=n there are no NCQ capable host drivers built so it is safe to hardwire ata_ncq_enabled() to always return zero. Code size savings on m68k arch using (modified) atari_defconfig: text data bss dec hex filename before: 37820 572 40 38432 9620 drivers/ata/libata-core.o 21040 105 576 21721 54d9 drivers/ata/libata-scsi.o 17405 18 0 17423 440f drivers/ata/libata-eh.o after: 37582 572 40 38194 9532 drivers/ata/libata-core.o 20702 105 576 21383 5387 drivers/ata/libata-scsi.o 17353 18 0 17371 43db drivers/ata/libata-eh.o

Bartlomiej Zolnierkiewicz committed 6 years ago

Commit 7caa30e1 parent a9b2c121 file · +2 −0Browse files

Showing the changes to include/linux (1 of 1 file). Show all

Unified · Split

include/linux/libata.h+2−0
@@ -1633,6 +1633,8 @@ extern struct ata_device *ata_dev_next(struct ata_device *dev, · 1632 unmodified lines
16331633 */
16341634 static inline int ata_ncq_enabled(struct ata_device *dev)
16351635 {
1636+ if (!IS_ENABLED(CONFIG_SATA_HOST))
1637+ return 0;
16361638 return (dev->flags & (ATA_DFLAG_PIO | ATA_DFLAG_NCQ_OFF |
16371639 ATA_DFLAG_NCQ)) == ATA_DFLAG_NCQ;
16381640 }