mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-26 23:41:50 +00:00
env/sf.c: drop private CMD_SAVEENV logic
Deciding whether to compile the env_sf_save() function based solely on CONFIG_SPL_BUILD is wrong: For U-Boot proper, it leads to a build warning in case CONFIG_CMD_SAVEENV=n (because the env_save_ptr() macro causes the function to indeed not be referenced anywhere). And for SPL, when one selects CONFIG_SPL_SAVEENV, one obviously expects to actually be able to save the environment. Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
This commit is contained in:
parent
1df96a7e76
commit
9e3c94d117
1 changed files with 1 additions and 11 deletions
12
env/sf.c
vendored
12
env/sf.c
vendored
|
@ -21,16 +21,12 @@
|
||||||
#include <u-boot/crc.h>
|
#include <u-boot/crc.h>
|
||||||
|
|
||||||
#ifndef CONFIG_SPL_BUILD
|
#ifndef CONFIG_SPL_BUILD
|
||||||
#define CMD_SAVEENV
|
|
||||||
#define INITENV
|
#define INITENV
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_ENV_OFFSET_REDUND
|
#ifdef CONFIG_ENV_OFFSET_REDUND
|
||||||
#ifdef CMD_SAVEENV
|
|
||||||
static ulong env_offset = CONFIG_ENV_OFFSET;
|
static ulong env_offset = CONFIG_ENV_OFFSET;
|
||||||
static ulong env_new_offset = CONFIG_ENV_OFFSET_REDUND;
|
static ulong env_new_offset = CONFIG_ENV_OFFSET_REDUND;
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* CONFIG_ENV_OFFSET_REDUND */
|
#endif /* CONFIG_ENV_OFFSET_REDUND */
|
||||||
|
|
||||||
DECLARE_GLOBAL_DATA_PTR;
|
DECLARE_GLOBAL_DATA_PTR;
|
||||||
|
@ -69,7 +65,6 @@ static int setup_flash_device(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(CONFIG_ENV_OFFSET_REDUND)
|
#if defined(CONFIG_ENV_OFFSET_REDUND)
|
||||||
#ifdef CMD_SAVEENV
|
|
||||||
static int env_sf_save(void)
|
static int env_sf_save(void)
|
||||||
{
|
{
|
||||||
env_t env_new;
|
env_t env_new;
|
||||||
|
@ -148,7 +143,6 @@ static int env_sf_save(void)
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
#endif /* CMD_SAVEENV */
|
|
||||||
|
|
||||||
static int env_sf_load(void)
|
static int env_sf_load(void)
|
||||||
{
|
{
|
||||||
|
@ -187,7 +181,6 @@ out:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
#ifdef CMD_SAVEENV
|
|
||||||
static int env_sf_save(void)
|
static int env_sf_save(void)
|
||||||
{
|
{
|
||||||
u32 saved_size, saved_offset, sector;
|
u32 saved_size, saved_offset, sector;
|
||||||
|
@ -247,7 +240,6 @@ static int env_sf_save(void)
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
#endif /* CMD_SAVEENV */
|
|
||||||
|
|
||||||
static int env_sf_load(void)
|
static int env_sf_load(void)
|
||||||
{
|
{
|
||||||
|
@ -313,9 +305,7 @@ U_BOOT_ENV_LOCATION(sf) = {
|
||||||
.location = ENVL_SPI_FLASH,
|
.location = ENVL_SPI_FLASH,
|
||||||
ENV_NAME("SPI Flash")
|
ENV_NAME("SPI Flash")
|
||||||
.load = env_sf_load,
|
.load = env_sf_load,
|
||||||
#ifdef CMD_SAVEENV
|
.save = ENV_SAVE_PTR(env_sf_save),
|
||||||
.save = env_save_ptr(env_sf_save),
|
|
||||||
#endif
|
|
||||||
#if defined(INITENV) && (CONFIG_ENV_ADDR != 0x0)
|
#if defined(INITENV) && (CONFIG_ENV_ADDR != 0x0)
|
||||||
.init = env_sf_init,
|
.init = env_sf_init,
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue