Skip to contentSkip to conversation

arm: fix CONFIG_DELAY_ENVIRONMENT to act like it claims in the README

PATCH Superseded Lucas Stach 2 participants 2 messages Jan 22, 2013 Arm (32-bit)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm: fix CONFIG_DELAY_ENVIRONMENT to act like it claims in the README

No one expects to end up in a delayed environment if CONFIG_DELAY_ENVIRONMENT isn't defined.

---
 arch/arm/lib/board.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
arch/arm/lib/board.c +3 -1
index cfe32cc..1a32611 100644
@@ -487,10 +487,12 @@ static char *failed = "*** failed ***\n";
  */
 static int should_load_env(void)
 {
+#ifdef CONFIG_DELAY_ENVIRONMENT
 #ifdef CONFIG_OF_CONTROL
 	return fdtdec_get_config_int(gd->fdt_blob, "load-environment", 0);
-#elif defined CONFIG_DELAY_ENVIRONMENT
+#else
 	return 0;
+#endif
 #else
 	return 1;
 #endif
Signature · 1 line
1.8.0.2
#1 lore raw

PATCH 1/1 arm: fix CONFIG_DELAY_ENVIRONMENT to act like it claims in the README

Hi Lucas,

Quoted 13 lines · Lucas Stach

No one expects to end up in a delayed environment if CONFIG_DELAY_ENVIRONMENT isn't defined.

---
 arch/arm/lib/board.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
arch/arm/lib/board.c +0 -0
index cfe32cc..1a32611 100644

arch/arm/lib/board.c static char *failed = "*** failed ***\n"; · line 492

Quoted 6 lines
arch/arm/lib/board.c +1 -0
@@ -487,10 +487,12 @@ static char *failed = "*** failed ***\n";
  */
 static int should_load_env(void)
 {
+#ifdef CONFIG_DELAY_ENVIRONMENT
 #ifdef CONFIG_OF_CONTROL
        return fdtdec_get_config_int(gd->fdt_blob, "load-environment", 0);

The only problem with this as that now you have two separate controls. Part of the intent with CONFIG_OF_CONTROL is to reduce the amount of #ifdef'ing going on - how about just changing the default value here to 1?

Quoted 10 lines
arch/arm/lib/board.c +2 -2
-#elif defined CONFIG_DELAY_ENVIRONMENT
+#else
        return 0;
+#endif
 #else
        return 1;
 #endif
--

1.8.0.2

Regards,
Simon