mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-21 14:41:31 +00:00
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>
This commit is contained in:
parent
da77a0e593
commit
f8cfcf1b1c
1 changed files with 8 additions and 0 deletions
|
@ -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__ */
|
||||
|
|
Loading…
Add table
Reference in a new issue