bootstage: Eliminate when not enabled
When we do not have bootstage enabled, rather than include an empty
dummy function, we just don't reference it. This saves us space in some
tight builds. This also shows a few cases where show_boot_progress was
incorrectly guarded before.
Cc: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
diff --git a/board/Seagate/dockstar/dockstar.c b/board/Seagate/dockstar/dockstar.c
index 380e37b..fb69193 100644
--- a/board/Seagate/dockstar/dockstar.c
+++ b/board/Seagate/dockstar/dockstar.c
@@ -140,6 +140,7 @@
}
#endif /* CONFIG_RESET_PHY_R */
+#if CONFIG_IS_ENABLED(BOOTSTAGE)
#define GREEN_LED (1 << 14)
#define ORANGE_LED (1 << 15)
#define BOTH_LEDS (GREEN_LED | ORANGE_LED)
@@ -169,3 +170,4 @@
break;
}
}
+#endif
diff --git a/board/Seagate/goflexhome/goflexhome.c b/board/Seagate/goflexhome/goflexhome.c
index 4c19fa7..af8cab7 100644
--- a/board/Seagate/goflexhome/goflexhome.c
+++ b/board/Seagate/goflexhome/goflexhome.c
@@ -142,6 +142,7 @@
}
#endif /* CONFIG_RESET_PHY_R */
+#if CONFIG_IS_ENABLED(BOOTSTAGE)
#define GREEN_LED (1 << 14)
#define ORANGE_LED (1 << 15)
#define BOTH_LEDS (GREEN_LED | ORANGE_LED)
@@ -175,3 +176,4 @@
break;
}
}
+#endif
diff --git a/board/bosch/shc/board.c b/board/bosch/shc/board.c
index 86356e3..13fd25e 100644
--- a/board/bosch/shc/board.c
+++ b/board/bosch/shc/board.c
@@ -188,7 +188,7 @@
/*
* Function to set the LEDs in the state "Bootloader error"
*/
-static void leds_set_failure(int state)
+static void __maybe_unused leds_set_failure(int state)
{
#if defined(CONFIG_B_SAMPLE)
/* Turn all blue and green LEDs off */
@@ -479,7 +479,7 @@
}
#endif
-#ifdef CONFIG_SHOW_BOOT_PROGRESS
+#if CONFIG_IS_ENABLED(BOOTSTAGE)
static void bosch_check_reset_pin(void)
{
if (readl(GPIO1_BASE + OMAP_GPIO_IRQSTATUS_SET_0) & RESET_MASK) {
@@ -525,9 +525,9 @@
break;
}
}
+#endif
void arch_preboot_os(void)
{
leds_set_finish();
}
-#endif
diff --git a/board/buffalo/lsxl/lsxl.c b/board/buffalo/lsxl/lsxl.c
index 34be601..738b6bc2 100644
--- a/board/buffalo/lsxl/lsxl.c
+++ b/board/buffalo/lsxl/lsxl.c
@@ -271,7 +271,7 @@
}
#endif
-#ifdef CONFIG_SHOW_BOOT_PROGRESS
+#if CONFIG_IS_ENABLED(BOOTSTAGE)
void show_boot_progress(int progress)
{
if (progress > 0)
diff --git a/board/k+p/kp_imx53/kp_imx53.c b/board/k+p/kp_imx53/kp_imx53.c
index cc8118b..7c3a695 100644
--- a/board/k+p/kp_imx53/kp_imx53.c
+++ b/board/k+p/kp_imx53/kp_imx53.c
@@ -155,6 +155,7 @@
return ret;
}
+#if CONFIG_IS_ENABLED(BOOTSTAGE)
#define GPIO_DR 0x0
#define GPIO_GDIR 0x4
#define GPIO_ALT1 0x1
@@ -203,3 +204,4 @@
gpio_direction_output(LED_RED, 1);
}
}
+#endif
diff --git a/board/st/stv0991/stv0991.c b/board/st/stv0991/stv0991.c
index 3b0de82..57ca9f6 100644
--- a/board/st/stv0991/stv0991.c
+++ b/board/st/stv0991/stv0991.c
@@ -37,7 +37,7 @@
};
#endif
-#ifdef CONFIG_SHOW_BOOT_PROGRESS
+#if CONFIG_IS_ENABLED(BOOTSTAGE)
void show_boot_progress(int progress)
{
printf("%i\n", progress);