fsl-layerscape: fix warning if no hwconfig is defined
authorPankaj Bansal <pankaj.bansal@nxp.com>
Thu, 31 Oct 2019 05:41:09 +0000 (05:41 +0000)
committerPriyanka Jain <priyanka.jain@nxp.com>
Fri, 8 Nov 2019 10:20:12 +0000 (15:50 +0530)
While getting the 'subarg' of 'hwconfig' env variable in
config_core_prefetch(), if no hwconfig variable is defined,
below warning is received:
WARNING: Calling __hwconfig without a buffer and
before environment is ready

Fix this by checking 'hwconfig' env variable.
If not found return without further processing.

Signed-off-by: Pankaj Bansal <pankaj.bansal@nxp.com>
Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
Tested-by: Michael Walle <michael@walle.cc>
arch/arm/cpu/armv8/fsl-layerscape/cpu.c

index 1f4c0b29a373d79961aaa97bd62447191cf3b4b5..83a33193211e8671010a88ce611d316460145ebc 100644 (file)
@@ -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);