Skip to contentSkip to conversation

env_callback: Mark find_env_callback as static

PATCH New Tom Rini 2 participants 6 messages Mar 12, 2013 – Mar 27, 2013

lore
Share & tools
lore

Tom Rini

author
#0 lore raw

PATCH 1/2 env_callback: Mark find_env_callback as static

This is not called outside of env_callback.c so mark static, remove from <env_callback.h>

Cc Joe Hershberger <[email protected]>
---
 common/env_callback.c  |    2 +-
 include/env_callback.h |    1 -
 2 files changed, 1 insertion(+), 2 deletions(-)
common/env_callback.c +1 -1
index 78ca367..78aafb4 100644
@@ -31,7 +31,7 @@ DECLARE_GLOBAL_DATA_PTR;
 /*
  * Look up a callback function pointer by name
  */
-struct env_clbk_tbl *find_env_callback(const char *name)
+static struct env_clbk_tbl *find_env_callback(const char *name)
 {
 	struct env_clbk_tbl *clbkp;
 	int i;
include/env_callback.h +0 -1
index 62428d1..dfc41ae 100644
@@ -67,7 +67,6 @@ struct env_clbk_tbl {
 		int flags);
 };
 
-struct env_clbk_tbl *find_env_callback(const char *);
 void env_callback_init(ENTRY *var_entry);
 
 /*
Signature · 1 line
1.7.9.5
author
#1 lore raw

PATCH 1/2 env_callback: Mark find_env_callback as static

Quoted 6 lines · Tom Rini

This is not called outside of env_callback.c so mark static, remove from <env_callback.h>

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/20130327/221d6c55/attachment.pgp>
author
#3 lore raw

PATCH 2/2 SPL: Fix build of CONFIG_SPL_NET_SUPPORT

In reply to Tom Rini

With CONFIG_SPL_NET_SUPPORT set we bring in most of the environment related code. This in turn means that while we discard the callback saftey checks in the environment, we had still needed their __start/__end linker symbols. In most cases this had been working because we generated u-boot.lst for the main U-Boot build prior to creating u-boot-spl.lds. With a sufficiently large machine this is not the case and exposed this latent bug which is that as of f8cfcf1 there are no callback linker entries so not __start/__end symbol was generated.

As the environment is not user modifiable in this particular run-time (for any variable that had a callback associated with it) we simply provide an empty env_callback_init in SPL.

---
 common/Makefile  |    3 ---
 common/spl/spl.c |   12 ++++++++++++
 2 files changed, 12 insertions(+), 3 deletions(-)
common/Makefile +0 -3
index 719fc23..0e11964 100644
@@ -211,10 +211,7 @@ COBJS-y += cmd_nvedit.o
 COBJS-y += env_common.o
 COBJS-$(CONFIG_ENV_IS_IN_FLASH) += env_flash.o
 COBJS-$(CONFIG_SPL_YMODEM_SUPPORT) += xyzModem.o
-COBJS-$(CONFIG_SPL_NET_SUPPORT) += cmd_nvedit.o
 COBJS-$(CONFIG_SPL_NET_SUPPORT) += env_attr.o
-COBJS-$(CONFIG_SPL_NET_SUPPORT) += env_callback.o
-COBJS-$(CONFIG_SPL_NET_SUPPORT) += env_common.o
 COBJS-$(CONFIG_SPL_NET_SUPPORT) += env_flags.o
 COBJS-$(CONFIG_SPL_NET_SUPPORT) += env_nowhere.o
 COBJS-$(CONFIG_SPL_NET_SUPPORT) += miiphyutil.o
common/spl/spl.c +12 -0
index 6715e0d..1ac2e4b 100644
@@ -32,6 +32,7 @@
 #include <image.h>
 #include <malloc.h>
 #include <linux/compiler.h>
+#include <env_callback.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -271,3 +272,14 @@ void preloader_console_init(void)
 	spl_display_print();
 #endif
 }
+
+/*
+ * When CONFIG_SPL_NET_SUPPORT is set, we bring in and require a large
+ * subset of the environment code.  However, as the environment is not
+ * modifable interactively in this case we remove the environment
+ * callback support from the binary.  To do so we must provide an empty
+ * env_callback_init function.
+ */
+void env_callback_init(ENTRY *var_entry)
+{
+}
Signature · 1 line
1.7.9.5
#4 lore raw

PATCH 2/2 SPL: Fix build of CONFIG_SPL_NET_SUPPORT

Hi Tom,

Quoted 14 lines · Tom Rini

With CONFIG_SPL_NET_SUPPORT set we bring in most of the environment related code. This in turn means that while we discard the callback saftey checks in the environment, we had still needed their __start/__end linker symbols. In most cases this had been working because we generated u-boot.lst for the main U-Boot build prior to creating u-boot-spl.lds. With a sufficiently large machine this is not the case and exposed this latent bug which is that as of f8cfcf1 there are no callback linker entries so not __start/__end symbol was generated.

As the environment is not user modifiable in this particular run-time (for any variable that had a callback associated with it) we simply provide an empty env_callback_init in SPL.

Quoted 5 lines

---

author
#5 lore raw

PATCH 2/2 SPL: Fix build of CONFIG_SPL_NET_SUPPORT

In reply to Tom Rini
Quoted 10 lines · Tom Rini

With CONFIG_SPL_NET_SUPPORT set we bring in most of the environment related code. This in turn means that while we discard the callback saftey checks in the environment, we had still needed their __start/__end linker symbols. In most cases this had been working because we generated u-boot.lst for the main U-Boot build prior to creating u-boot-spl.lds. With a sufficiently large machine this is not the case and exposed this latent bug which is that as of f8cfcf1 there are no callback linker entries so not __start/__end symbol was generated.

Quoted 8 lines

As the environment is not user modifiable in this particular run-time (for any variable that had a callback associated with it) we simply provide an empty env_callback_init in SPL.

As this part is no longer needed with Albert's LG updates, I'm dropping 2/2.

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/20130314/e7748dec/attachment.pgp>