提交 46d9d1c3 编写于 作者: R Rasmus Villemoes 提交者: Tom Rini

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: NRasmus Villemoes <rasmus.villemoes@prevas.dk>
上级 8ce1f10c
......@@ -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
......
......@@ -12,9 +12,9 @@
#include <u-boot/crc.h>
#ifdef ENV_IS_EMBEDDED
env_t *env_ptr = &environment;
static env_t *env_ptr = &environment;
#else /* ! ENV_IS_EMBEDDED */
env_t *env_ptr = (env_t *)CONFIG_ENV_ADDR;
static env_t *env_ptr = (env_t *)CONFIG_ENV_ADDR;
#endif /* ENV_IS_EMBEDDED */
DECLARE_GLOBAL_DATA_PTR;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册