]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit855ae61291875d687742559ef12783057a51cb41
tree6010ae02826371b47b7bef0505bf7660e6523b51
parent4ce72753173700b1d0b280ff0204bf87b0cff7f5
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