summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Wood <scottwood@freescale.com>2012-12-20 11:51:05 +0000
committerTom Rini <trini@ti.com>2012-12-22 05:57:16 -0700
commitf8cfcf1b1c7543d5dd103359376a3319301143bc (patch)
tree5dc3827b3fa5c877055d04bdccbe58a53a9ef27b
parentda77a0e593c370c9ed79ea22c1df321d5f4e4bbf (diff)
downloadu-boot-imx-f8cfcf1b1c7543d5dd103359376a3319301143bc.zip
u-boot-imx-f8cfcf1b1c7543d5dd103359376a3319301143bc.tar.gz
u-boot-imx-f8cfcf1b1c7543d5dd103359376a3319301143bc.tar.bz2
env: don't generate callback list entries for SPL
SPL doesn't write to the environment. These list entries prevent the functions from being garbage-collected, even though nothing will look at the list. This caused several SPL builds (e.g. P2020RDB-PC_NAND) to break due to size limitations and/or unresolved symbols. A static inline function is used to provide a context in which we can consume the callback, and thus avoid unused function warnings. Signed-off-by: Scott Wood <scottwood@freescale.com> Acked-by: Joe Hershberger <joe.hershberger@gmail.com> Acked-by: Kim Phillips <kim.phillips@freescale.com>
-rw-r--r--include/env_callback.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/env_callback.h b/include/env_callback.h
index 47fdc6f..c583120 100644
--- a/include/env_callback.h
+++ b/include/env_callback.h
@@ -68,8 +68,16 @@ void env_callback_init(ENTRY *var_entry);
* when associated through the ".callbacks" environment variable, the callback
* will be executed any time the variable is inserted, overwritten, or deleted.
*/
+#ifdef CONFIG_SPL_BUILD
+#define U_BOOT_ENV_CALLBACK(name, callback) \
+ static inline void _u_boot_env_noop_##name(void) \
+ { \
+ (void)callback; \
+ }
+#else
#define U_BOOT_ENV_CALLBACK(name, callback) \
ll_entry_declare(struct env_clbk_tbl, name, env_clbk, env_clbk) = \
{#name, callback}
+#endif
#endif /* __ENV_CALLBACK_H__ */