Skip to contentSkip to conversation

common/board_f.c: fix compile error when tracing disabled

PATCH New Kevin Hilman 3 participants 3 messages Dec 15, 2014 – Jan 12, 2015

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 common/board_f.c: fix compile error when tracing disabled

From: Kevin Hilman <[email protected]>

When CONFIG_TRACE is disabled, linking fails with:

common/built-in.o:(.data.init_sequence_f+0x8): undefined reference to `trace_early_init'

To fix, wrap trace init calls with #ifdef CONFIG_TRACE.

While at it, remove the static inline version of the init call from trace.h as suggested by Simon Glass, since it doesnt work.

---
Applies to v2015.01-rc3

v3: Actually remove the static inlines this time. :/

 common/board_f.c | 2 ++
 include/trace.h  | 7 -------
 2 files changed, 2 insertions(+), 7 deletions(-)
common/board_f.c +2 -0
index 98c9c728ce73..cfd77f865361 100644
@@ -813,7 +813,9 @@ static init_fnc_t init_sequence_f[] = {
 #endif
 	setup_mon_len,
 	setup_fdt,
+#ifdef CONFIG_TRACE
 	trace_early_init,
+#endif
 	initf_malloc,
 #if defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx)
 	/* TODO: can this go into arch_cpu_init()? */
include/trace.h +0 -7
index 871327fb358a..09a38d782fc0 100644
@@ -89,14 +89,7 @@ int trace_list_calls(void *buff, int buff_size, unsigned int *needed);
  */
 void trace_set_enabled(int enabled);
 
-#ifdef CONFIG_TRACE_EARLY
 int trace_early_init(void);
-#else
-static inline int trace_early_init(void)
-{
-	return 0;
-}
-#endif
 
 /**
  * Init the trace system
Signature · 1 line
2.1.3
#1 lore raw

PATCH v3 1/1 common/board_f.c: fix compile error when tracing disabled

Quoted 14 lines · Kevin Hilman

From: Kevin Hilman <[email protected]>

When CONFIG_TRACE is disabled, linking fails with:

common/built-in.o:(.data.init_sequence_f+0x8): undefined reference to `trace_early_init'

To fix, wrap trace init calls with #ifdef CONFIG_TRACE.

While at it, remove the static inline version of the init call from trace.h as suggested by Simon Glass, since it doesnt work.

Quoted 8 lines

---
Applies to v2015.01-rc3

v3: Actually remove the static inlines this time. :/

 common/board_f.c | 2 ++
 include/trace.h  | 7 -------
 2 files changed, 2 insertions(+), 7 deletions(-)
#2 lore raw

PATCH v3 1/1 common/board_f.c: fix compile error when tracing disabled

In reply to Kevin Hilman
Quoted 8 lines · Kevin Hilman

From: Kevin Hilman <[email protected]>

When CONFIG_TRACE is disabled, linking fails with:

common/built-in.o:(.data.init_sequence_f+0x8): undefined reference to `trace_early_init'

To fix, wrap trace init calls with #ifdef CONFIG_TRACE.

Quoted 7 lines

While at it, remove the static inline version of the init call from trace.h as suggested by Simon Glass, since it doesnt work.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150112/888c096f/attachment.pgp>