From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Warren Date: Wed, 15 Jan 2014 10:40:29 -0700 Subject: [U-Boot] [PATCH 2/2] env_mmc: default to 0 if CONFIG_SYS_MMC_ENV_DEV not defined In-Reply-To: <1389783236-8464-2-git-send-email-hector.palacios@digi.com> References: <1389783236-8464-1-git-send-email-hector.palacios@digi.com> <1389783236-8464-2-git-send-email-hector.palacios@digi.com> Message-ID: <52D6C80D.3000601@wwwdotorg.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 01/15/2014 03:53 AM, Hector Palacios wrote: > Since function mmc_get_env_devno is __weak and can be overridden by > board code, boards do not necessarily need to define > CONFIG_SYS_MMC_ENV_DEV. If the constant is not defined, return 0 by > default. Ah, I see that's a better justification for allowing the define not to be set. > diff --git a/common/env_mmc.c b/common/env_mmc.c > __weak int mmc_get_env_devno(void) > { > +#ifdef CONFIG_SYS_MMC_ENV_DEV > return CONFIG_SYS_MMC_ENV_DEV; > +#endif Same comment here; need a #else here, and #endif below. > + return 0; > +} Re: Hector's comments: Perhaps the following in include/config_fallbacks.h would be appropriate? #ifndef CONFIG_SYS_MMC_ENV_DEV #define CONFIG_SYS_MMC_ENV_DEV 0 #endif ?