From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Tue, 8 Jan 2013 16:57:53 +0100 Subject: [U-Boot] [PATCH] common: env_mmc: Use __weak annotation to simplify code In-Reply-To: <1357659371-25513-1-git-send-email-fabio.estevam@freescale.com> References: <1357659371-25513-1-git-send-email-fabio.estevam@freescale.com> Message-ID: <201301081657.53695.marex@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Fabio Estevam, > Using the __weak annotation can make the code cleaner. > > Signed-off-by: Fabio Estevam Just a quickie -- have you checked that noone is using the "default" versions of all these functions you annotate with __weak? Other than that: Acked-by: Marek Vasut > --- > common/env_mmc.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/common/env_mmc.c b/common/env_mmc.c > index ce21671..02bd5ae 100644 > --- a/common/env_mmc.c > +++ b/common/env_mmc.c > @@ -46,13 +46,11 @@ DECLARE_GLOBAL_DATA_PTR; > #define CONFIG_ENV_OFFSET 0 > #endif > > -static int __mmc_get_env_addr(struct mmc *mmc, u32 *env_addr) > +__weak int mmc_get_env_addr(struct mmc *mmc, u32 *env_addr) > { > *env_addr = CONFIG_ENV_OFFSET; > return 0; > } > -int mmc_get_env_addr(struct mmc *mmc, u32 *env_addr) > - __attribute__((weak, alias("__mmc_get_env_addr"))); > > int env_init(void) > { Best regards, Marek Vasut