From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hector Palacios Date: Thu, 16 Jan 2014 19:13:03 +0100 Subject: [U-Boot] [PATCH 2/2] env_mmc: default to 0 if CONFIG_SYS_MMC_ENV_DEV not defined In-Reply-To: <52D6C80D.3000601@wwwdotorg.org> References: <1389783236-8464-1-git-send-email-hector.palacios@digi.com> <1389783236-8464-2-git-send-email-hector.palacios@digi.com> <52D6C80D.3000601@wwwdotorg.org> Message-ID: <52D8212F.40603@digi.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Stephen, On 01/15/2014 06:40 PM, Stephen Warren wrote: > 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 This define is only used in common/env_mmc.c so I think the default definition should stay on that file, rather than in include/config_fallbacks.h. Best regards, -- Hector Palacios