[U-Boot] [PATCH 1/1] imx8: cpu: fix warning for cpu_imx_get_temp

Igor Opaniuk igor.opaniuk at toradex.com
Mon May 13 10:46:38 UTC 2019


cpu_imx_get_temp() definition is wrapped with a ifdef macro,
therefore all function references should be also wrapped the same way
instead IS_ENABLED() usage.

Fix warning:
arch/arm/mach-imx/imx8/cpu.c: In function ‘cpu_imx_get_desc’:
arch/arm/mach-imx/imx8/cpu.c:612:40: warning: implicit declaration of
function ‘cpu_imx_get_temp’; did you mean ‘cpu_imx_get_desc’?
[-Wimplicit-function-declaration]
   ret = snprintf(buf, size, " at %dC", cpu_imx_get_temp());
                                        ^~~~~~~~~~~~~~~~
                                        cpu_imx_get_desc
                                        cpu_imx_get_desc

Fixes: 82467cb217 ("imx8: cpu: get temperature when print cpu desc")
Signed-off-by: Igor Opaniuk <igor.opaniuk at toradex.com>
---
 arch/arm/mach-imx/imx8/cpu.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-imx/imx8/cpu.c b/arch/arm/mach-imx/imx8/cpu.c
index 12596c6387..616baed7cc 100644
--- a/arch/arm/mach-imx/imx8/cpu.c
+++ b/arch/arm/mach-imx/imx8/cpu.c
@@ -606,11 +606,11 @@ int cpu_imx_get_desc(struct udevice *dev, char *buf, int size)
 	ret = snprintf(buf, size, "NXP i.MX8%s Rev%s %s at %u MHz",
 		       plat->type, plat->rev, plat->name, plat->freq_mhz);
 
-	if (IS_ENABLED(CONFIG_IMX_SCU_THERMAL)) {
-		buf = buf + ret;
-		size = size - ret;
-		ret = snprintf(buf, size, " at %dC", cpu_imx_get_temp());
-	}
+#if defined(CONFIG_IMX_SCU_THERMAL)
+	buf = buf + ret;
+	size = size - ret;
+	ret = snprintf(buf, size, " at %dC", cpu_imx_get_temp());
+#endif
 
 	snprintf(buf + ret, size - ret, "\n");
 
-- 
2.17.1



More information about the U-Boot mailing list