X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=common%2Fenv_nvram.c;h=7c18896cb04fa88b42ec92275547eacfa1d18406;hb=0b20335015945cc9aedf27356e51aa3a0b0cdc48;hp=2c831d14d774b63a3609dfab8a9c466cfe2055f9;hpb=8bde7f776c77b343aca29b8c7b58464d915ac245;p=u-boot diff --git a/common/env_nvram.c b/common/env_nvram.c index 2c831d14d7..7c18896cb0 100644 --- a/common/env_nvram.c +++ b/common/env_nvram.c @@ -42,12 +42,13 @@ #include +DECLARE_GLOBAL_DATA_PTR; + #ifdef CFG_ENV_IS_IN_NVRAM /* Environment is in NVRAM */ #include #include #include -#include #ifdef CFG_NVRAM_ACCESS_ROUTINE extern void *nvram_read(void *dest, const long src, size_t count); @@ -75,7 +76,6 @@ uchar env_get_char_spec (int index) return c; #else - DECLARE_GLOBAL_DATA_PTR; uchar retval; enable_nvram(); retval = *((uchar *)(gd->env_addr + index)); @@ -93,8 +93,6 @@ uchar env_get_char_spec (int index) return c; #else - DECLARE_GLOBAL_DATA_PTR; - return *((uchar *)(gd->env_addr + index)); #endif } @@ -136,7 +134,6 @@ int saveenv (void) */ int env_init (void) { - DECLARE_GLOBAL_DATA_PTR; #ifdef CONFIG_AMIGAONEG3SE enable_nvram(); #endif