From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] common: env_mmc: Use __weak annotation to simplify code
Date: Tue, 8 Jan 2013 16:57:53 +0100 [thread overview]
Message-ID: <201301081657.53695.marex@denx.de> (raw)
In-Reply-To: <1357659371-25513-1-git-send-email-fabio.estevam@freescale.com>
Dear Fabio Estevam,
> Using the __weak annotation can make the code cleaner.
>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
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 <marex@denx.de>
> ---
> 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
next prev parent reply other threads:[~2013-01-08 15:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-08 15:36 [U-Boot] [PATCH] common: env_mmc: Use __weak annotation to simplify code Fabio Estevam
2013-01-08 15:57 ` Marek Vasut [this message]
2013-01-28 5:54 ` Stefano Babic
2013-02-04 16:37 ` [U-Boot] " Tom Rini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201301081657.53695.marex@denx.de \
--to=marex@denx.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox