From patchwork Wed Sep 4 15:12:26 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Burton X-Patchwork-Id: 272650 X-Patchwork-Delegate: panto@antoniou-consulting.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id C54D72C00CE for ; Thu, 5 Sep 2013 01:14:45 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B36EC4A066; Wed, 4 Sep 2013 17:14:36 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9cp9Ufn8wG3B; Wed, 4 Sep 2013 17:14:36 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 09A464A0A5; Wed, 4 Sep 2013 17:14:32 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7FCC94A090 for ; Wed, 4 Sep 2013 17:14:18 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id C4KPFOF41+Dq for ; Wed, 4 Sep 2013 17:14:13 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from multi.imgtec.com (multi.imgtec.com [194.200.65.239]) by theia.denx.de (Postfix) with ESMTPS id 84E6A4A07B for ; Wed, 4 Sep 2013 17:14:08 +0200 (CEST) From: Paul Burton To: Date: Wed, 4 Sep 2013 16:12:26 +0100 Message-ID: <1378307547-16984-5-git-send-email-paul.burton@imgtec.com> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1378307547-16984-1-git-send-email-paul.burton@imgtec.com> References: <1378307547-16984-1-git-send-email-paul.burton@imgtec.com> MIME-Version: 1.0 X-Originating-IP: [192.168.152.22] X-SEF-Processed: 7_3_0_01192__2013_09_04_16_14_02 Cc: panto@antoniou-consulting.com Subject: [U-Boot] [PATCH 4/5] mmc: size optimization when !CONFIG_MMC_SPI X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de 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 --- 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); #ifdef CONFIG_GENERIC_MMC +#ifdef CONFIG_MMC_SPI #define mmc_host_is_spi(mmc) ((mmc)->host_caps & MMC_MODE_SPI) +#else +#define mmc_host_is_spi(mmc) 0 +#endif struct mmc *mmc_spi_init(uint bus, uint cs, uint speed, uint mode); #else int mmc_legacy_init(int verbose);