public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] env: don't generate callback list entries for SPL
@ 2012-12-15  0:54 Scott Wood
  2012-12-15  7:04 ` Joe Hershberger
  2012-12-17 14:52 ` Tom Rini
  0 siblings, 2 replies; 8+ messages in thread
From: Scott Wood @ 2012-12-15  0:54 UTC (permalink / raw)
  To: u-boot

SPL doesn't use 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.

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>
---
 include/env_callback.h |    8 ++++++++
 1 file changed, 8 insertions(+)

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__ */
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-12-17 20:11 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-15  0:54 [U-Boot] [PATCH] env: don't generate callback list entries for SPL Scott Wood
2012-12-15  7:04 ` Joe Hershberger
2012-12-17 14:52 ` Tom Rini
2012-12-17 18:53   ` Scott Wood
2012-12-17 19:12     ` Tom Rini
2012-12-17 19:55       ` Wolfgang Denk
2012-12-17 19:58         ` Tom Rini
2012-12-17 20:11           ` Joe Hershberger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox