Skip to contentSkip to conversation

env: Make use of IF_ENABLED_INT in spi flash support

PATCH In review Tom Rini 1 participant 2 messages Mar 20 – Apr 3

lore
Share & tools
lore

Tom Rini

author
#0 lore raw

PATCH 1/1 env: Make use of IF_ENABLED_INT in spi flash support

In order to build the spi flash environment driver, but with CONFIG_ENV_REDUNDANT disabled we must make use of IF_ENABLED_INT to check for a value in CONFIG_ENV_OFFSET_REDUND otherwise we will fail to build.

---
 env/sf.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
env/sf.c +2 -1
index 0e27a020643e..14c35324e641 100644
@@ -396,7 +396,8 @@ static int env_sf_init_early(void)
 
 	if (IS_ENABLED(CONFIG_ENV_REDUNDANT)) {
 		read2_fail = spi_flash_read(env_flash,
-					    CONFIG_ENV_OFFSET_REDUND,
+					    IF_ENABLED_INT(CONFIG_ENV_REDUNDANT,
+							   CONFIG_ENV_OFFSET_REDUND),
 					    CONFIG_ENV_SIZE, tmp_env2);
 		ret = env_check_redund((char *)tmp_env1, read1_fail,
 				       (char *)tmp_env2, read2_fail);
Signature · 1 line
2.43.0
author
#1 lore raw
Quoted 6 lines · Tom Rini

In order to build the spi flash environment driver, but with CONFIG_ENV_REDUNDANT disabled we must make use of IF_ENABLED_INT to check for a value in CONFIG_ENV_OFFSET_REDUND otherwise we will fail to build.

Applied to u-boot/next, thanks!

[1/1] env: Make use of IF_ENABLED_INT in spi flash support

      commit: c1e17ac28466f9ba68cb65daa9d7f8b4b3ae0a25
Signature · 1 line
Tom