[U-Boot] [PATCH v2] armv8: fsl-layerscape: fix warning if no hwconfig is defined

Pankaj Bansal pankaj.bansal at nxp.com
Thu Oct 31 05:41:09 UTC 2019


if no hwconfig variable is defined for a platform and we try to get the
subarg of hwconfig, we receive a warning:
WARNING: Calling __hwconfig without a buffer and before environment is ready

Therefore, if hwconfig is not found return without further processing.

Signed-off-by: Pankaj Bansal <pankaj.bansal at nxp.com>
---

Notes:
    V2:
    - Add copyright year in file that has been updated

 arch/arm/cpu/armv8/fsl-layerscape/cpu.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/arm/cpu/armv8/fsl-layerscape/cpu.c b/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
index 8fd6c751c6..b42beca6e1 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
+++ b/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * Copyright 2017 NXP
+ * Copyright 2017, 2019 NXP
  * Copyright 2014-2015 Freescale Semiconductor, Inc.
  */
 
@@ -1072,6 +1072,8 @@ static void config_core_prefetch(void)
 
 	if (env_get_f("hwconfig", buffer, sizeof(buffer)) > 0)
 		buf = buffer;
+	else
+		return;
 
 	prefetch_arg = hwconfig_subarg_f("core_prefetch", "disable",
 					 &arglen, buf);
-- 
2.17.1



More information about the U-Boot mailing list