common: env_mmc: Use __weak annotation to simplify code
PATCH 1/1 common: env_mmc: Use __weak annotation to simplify code
Using the __weak annotation can make the code cleaner.
Signed-off-by Fabio Estevam <[email protected]>
--- common/env_mmc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
common/env_mmc.c +1 -3
@@ -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 ) {
Signature · 1 line
1.7.9.5
PATCH 1/1 common: env_mmc: Use __weak annotation to simplify code
Dear Fabio Estevam,
Quoted 3 lines
Using the
__weakannotation can make the code cleaner.Signed-off-by Fabio Estevam <[email protected]>
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 <[email protected]>
Quoted 13 lines
--- common/env_mmc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)common/env_mmc.c +0
-1@@ -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)
common/env_mmc.c DECLARE_GLOBAL_DATA_PTR; · line 56
Quoted 10 lines
common/env_mmc.c +1
-2+__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
PATCH 1/1 common: env_mmc: Use __weak annotation to simplify code
In reply to Fabio EstevamQuoted 4 lines · Fabio Estevam
Using the
__weakannotation can make the code cleaner.Signed-off-by Fabio Estevam <[email protected]>---
Applied to u-boot-imx, thanks.
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================
Quoted 4 lines · Fabio Estevam
Using the
__weakannotation can make the code cleaner.Signed-off-by Fabio Estevam <[email protected]>Acked-by Marek Vasut <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130204/755bf57b/attachment.pgp>