Commit 8687d5c80c9b4d66b4c33e34ef8eb36cf93d9ec7
Committed by
Pantelis Antoniou
1 parent
5619682664
Exists in
master
and in
53 other branches
mmc: size optimization when !CONFIG_MMC_SPI
When CONFIG_MMC_SPI is not enabled, the MMC_MODE_SPI capability can never be set. However there is code in mmc.c which uses the mmc_host_is_spi macro to check that capability & act accordingly. If we expand that macro to 0 when CONFIG_MMC_SPI is not set (since it will always be 0 at runtime anyway) then the compiler can optimize away the SPI-specific code paths in mmc.c. Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Showing 1 changed file with 4 additions and 0 deletions Side-by-side Diff
include/mmc.h
... | ... | @@ -335,7 +335,11 @@ |
335 | 335 | void mmc_set_preinit(struct mmc *mmc, int preinit); |
336 | 336 | |
337 | 337 | #ifdef CONFIG_GENERIC_MMC |
338 | +#ifdef CONFIG_MMC_SPI | |
338 | 339 | #define mmc_host_is_spi(mmc) ((mmc)->host_caps & MMC_MODE_SPI) |
340 | +#else | |
341 | +#define mmc_host_is_spi(mmc) 0 | |
342 | +#endif | |
339 | 343 | struct mmc *mmc_spi_init(uint bus, uint cs, uint speed, uint mode); |
340 | 344 | #else |
341 | 345 | int mmc_legacy_init(int verbose); |