[U-Boot,4/5] mmc: size optimization when !CONFIG_MMC_SPI

Message ID 1378307547-16984-5-git-send-email-paul.burton@imgtec.com
State Accepted
Delegated to: Pantelis Antoniou
Headers show

Commit Message

Paul Burton Sept. 4, 2013, 3:12 p.m.
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>
 include/mmc.h | 4 ++++
 1 file changed, 4 insertions(+)


diff --git a/include/mmc.h b/include/mmc.h
index 228d771..214b9ed 100644
--- a/include/mmc.h
+++ b/include/mmc.h
@@ -335,7 +335,11 @@  int mmc_start_init(struct mmc *mmc);
 void mmc_set_preinit(struct mmc *mmc, int preinit);
 #define mmc_host_is_spi(mmc)	((mmc)->host_caps & MMC_MODE_SPI)
+#define mmc_host_is_spi(mmc)	0
 struct mmc *mmc_spi_init(uint bus, uint cs, uint speed, uint mode);
 int mmc_legacy_init(int verbose);