Skip to contentSkip to conversation

imx8: cpu: fix warning for cpu_imx_get_temp

PATCH New Igor Opaniuk 1 participant 2 messages May 13, 2019 – May 14, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 imx8: cpu: fix warning for cpu_imx_get_temp

cpu_imx_get_temp() definition is wrapped with a ifdef macro, which leads to warnings if CONFIG_IMX_SCU_THERMAL isn't defined and there are still references to this function, as, for example, in cpu_imx_get_desc(). Drop ifdef as linker will automatically remove the function in case CONFIG_IMX_SCU_THERMAL is not enabled.

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")

---

v2:
- address Stefan's comments and drop the ifdef instead

 arch/arm/mach-imx/imx8/cpu.c | 2 --
 1 file changed, 2 deletions(-)
arch/arm/mach-imx/imx8/cpu.c +0 -2
index 12596c6387..1be63af7f3 100644
@@ -574,7 +574,6 @@ const char *get_core_name(void)
 		return "?";
 }
 
-#if defined(CONFIG_IMX_SCU_THERMAL)
 static int cpu_imx_get_temp(void)
 {
 	struct udevice *thermal_dev;
@@ -593,7 +592,6 @@ static int cpu_imx_get_temp(void)
 
 	return cpu_tmp;
 }
-#endif
 
 int cpu_imx_get_desc(struct udevice *dev, char *buf, int size)
 {
Signature · 1 line
2.17.1
#1 lore raw

PATCH v2 1/1 imx8: cpu: fix warning for cpu_imx_get_temp

Quoted 48 lines · Igor Opaniuk

cpu_imx_get_temp() definition is wrapped with a ifdef macro, which leads to warnings if CONFIG_IMX_SCU_THERMAL isn't defined and there are still references to this function, as, for example, in cpu_imx_get_desc(). Drop ifdef as linker will automatically remove the function in case CONFIG_IMX_SCU_THERMAL is not enabled.

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")

---

v2:
- address Stefan's comments and drop the ifdef instead

 arch/arm/mach-imx/imx8/cpu.c | 2 --
 1 file changed, 2 deletions(-)
arch/arm/mach-imx/imx8/cpu.c +0 -3
index 12596c6387..1be63af7f3 100644
@@ -574,7 +574,6 @@ const char *get_core_name(void)
                return "?";
 }
 
-#if defined(CONFIG_IMX_SCU_THERMAL)
 static int cpu_imx_get_temp(void)
 {
        struct udevice *thermal_dev;
@@ -593,7 +592,6 @@ static int cpu_imx_get_temp(void)
 
        return cpu_tmp;
 }
-#endif
 
 int cpu_imx_get_desc(struct udevice *dev, char *buf, int size)
 {
--
Quoted 2 lines

2.17.1

Please ignore this patch

Signature · 8 lines
Best regards - Freundliche Grüsse - Meilleures salutations

Senior Development Engineer,
Igor Opaniuk

Toradex AG
Altsagenstrasse 5 | 6048 Horw/Luzern | Switzerland | T: +41 41 500 48
00 (main line)