[U-Boot,v2,1/6] mtd: cfi_flash: Use CONFIG_SYS_MONITOR_BASE only when defined
diff mbox series

Message ID 20191010055207.26831-2-vigneshr@ti.com
State Superseded
Delegated to: Stefan Roese
Headers show
Series
  • J721e: Add HyperBus support
Related show

Commit Message

Vignesh Raghavendra Oct. 10, 2019, 5:52 a.m. UTC
Make use of CONFIG_SYS_MONITOR_BASE only when available to avoid build
error when CONFIG_SYS_MONITOR_BASE is not defined.

Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
---
v2:
Make macro check consistent as pointed out by Stefan

 drivers/mtd/cfi_flash.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Stefan Roese Oct. 10, 2019, 6:03 a.m. UTC | #1
On 10.10.19 07:52, Vignesh Raghavendra wrote:
> Make use of CONFIG_SYS_MONITOR_BASE only when available to avoid build
> error when CONFIG_SYS_MONITOR_BASE is not defined.
> 
> Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
> ---
> v2:
> Make macro check consistent as pointed out by Stefan

Reviewed-by: Stefan Roese <sr@denx.de>

Thanks,
Stefan

Patch
diff mbox series

diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c
index c59254c76e3e..0574fa63a44d 100644
--- a/drivers/mtd/cfi_flash.c
+++ b/drivers/mtd/cfi_flash.c
@@ -178,7 +178,8 @@  __maybe_weak u64 flash_read64(void *addr)
 /*-----------------------------------------------------------------------
  */
 #if defined(CONFIG_ENV_IS_IN_FLASH) || defined(CONFIG_ENV_ADDR_REDUND) || \
-	(CONFIG_SYS_MONITOR_BASE >= CONFIG_SYS_FLASH_BASE)
+	(defined(CONFIG_SYS_MONITOR_BASE) && \
+	(CONFIG_SYS_MONITOR_BASE >= CONFIG_SYS_FLASH_BASE))
 static flash_info_t *flash_get_info(ulong base)
 {
 	int i;
@@ -2329,7 +2330,8 @@  static void flash_protect_default(void)
 #endif
 
 	/* Monitor protection ON by default */
-#if (CONFIG_SYS_MONITOR_BASE >= CONFIG_SYS_FLASH_BASE) && \
+#if defined(CONFIG_SYS_MONITOR_BASE) && \
+	(CONFIG_SYS_MONITOR_BASE >= CONFIG_SYS_FLASH_BASE) && \
 	(!defined(CONFIG_MONITOR_IS_IN_RAM))
 	flash_protect(FLAG_PROTECT_SET,
 		      CONFIG_SYS_MONITOR_BASE,