ata: let compiler optimize out ata_eh_set_lpm() on non-SATA hosts
authorBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Thu, 26 Mar 2020 15:58:10 +0000 (16:58 +0100)
committerJens Axboe <axboe@kernel.dk>
Thu, 26 Mar 2020 16:28:19 +0000 (10:28 -0600)
commit4c9029e7d00f31923bcecbaab6a12ba52017924e
tree6010ae02826371b47b7bef0505bf7660e6523b51
parentcba97ea18d92f3b9c56816fe9325aeb38a46746f
ata: let compiler optimize out ata_eh_set_lpm() on non-SATA hosts

Add !IS_ENABLED(CONFIG_SATA_HOST) to ata_eh_set_lpm() to allow
compiler to optimize out the function for non-SATA configs (for
PATA hosts "ap && !ap->ops->set_lpm" condition is always true so
it's sufficient for the function to return zero).

Code size savings on m68k arch using (modified) atari_defconfig:

   text    data     bss     dec     hex filename
before:
  17353      18       0   17371    43db drivers/ata/libata-eh.o
after:
  16607      18       0   16625    40f1 drivers/ata/libata-eh.o

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/ata/libata-eh.c