summaryrefslogtreecommitdiff
path: root/env/nvram.c
diff options
context:
space:
mode:
authorRasmus Villemoes <rasmus.villemoes@prevas.dk>2020-02-18 11:54:09 +0300
committerTom Rini <trini@konsulko.com>2020-04-17 19:29:43 +0300
commit46d9d1c306967780d7afbfcbf942daf9ab33c466 (patch)
treeca1c32286fa74c58501329e0d928bfce99386644 /env/nvram.c
parent8ce1f10cf2b139258c890774f263bec55c4df8ce (diff)
downloadu-boot-46d9d1c306967780d7afbfcbf942daf9ab33c466.tar.xz
env: make file-scope env_ptr variables static
The combination ENV_IS_IN_NVRAM=y, ENV_IS_IN_REMOTE=y fails to build: env/remote.o:/mnt/ext4/devel/u-boot/env/remote.c:17: multiple definition of `env_ptr' env/nvram.o:/mnt/ext4/devel/u-boot/env/nvram.c:41: first defined here It's not necessarily a meaningful combination, but for build-testing it's nice to be able to enable most ENV_IS_IN_* at the same time, and since these env_ptr are not declared anywhere, they really have no reason to have external linkage. nand.c and flash.c similarly already define file-scope static env_ptr variables. Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Diffstat (limited to 'env/nvram.c')
-rw-r--r--env/nvram.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/env/nvram.c b/env/nvram.c
index a78db21623..1a9fcf1c06 100644
--- a/env/nvram.c
+++ b/env/nvram.c
@@ -38,7 +38,7 @@ DECLARE_GLOBAL_DATA_PTR;
extern void *nvram_read(void *dest, const long src, size_t count);
extern void nvram_write(long dest, const void *src, size_t count);
#else
-env_t *env_ptr = (env_t *)CONFIG_ENV_ADDR;
+static env_t *env_ptr = (env_t *)CONFIG_ENV_ADDR;
#endif
#ifdef CONFIG_SYS_NVRAM_ACCESS_ROUTINE