Skip to contentSkip to conversation

thermal: Fix build warning of !defined(CONFIG_THERMAL_OF)

PATCH Applied Anson Huang 3 participants 5 messages Mar 3, 2020 Thermal

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 thermal: Fix build warning of !defined(CONFIG_THERMAL_OF)

Add "inline" to thermal_zone_of_get_sensor_id() function to avoid below build warning of !defined(CONFIG_THERMAL_OF).

In file included from drivers/hwmon/hwmon.c:22:
include/linux/thermal.h:382:12: warning: 'thermal_zone_of_get_sensor_id' defined but not used [-Wunused-function]
382 | static int thermal_zone_of_get_sensor_id(struct device_node *tz_np,

---
 include/linux/thermal.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/thermal.h +1 -1
index 53e6f67..c91b1e3 100644
@@ -379,7 +379,7 @@ void devm_thermal_zone_of_sensor_unregister(struct device *dev,
 					    struct thermal_zone_device *tz);
 #else
 
-static int thermal_zone_of_get_sensor_id(struct device_node *tz_np,
+static inline int thermal_zone_of_get_sensor_id(struct device_node *tz_np,
 					 struct device_node *sensor_np,
 					 u32 *id)
 {
Signature · 1 line
2.7.4
#1 lore raw

PATCH 2/2 thermal: Remove COMPILE_TEST for IMX_SC_THERMAL

i.MX SCU thermal driver depends on IMX_SCU which does NOT have COMPILE_TEST enabled, so need to remove COMPILE_TEST for i.MX SCU thermal as well.

---
 drivers/thermal/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thermal/Kconfig +1 -1
index 165b7d6..4fb87df 100644
@@ -253,7 +253,7 @@ config IMX_THERMAL
 
 config IMX_SC_THERMAL
 	tristate "Temperature sensor driver for NXP i.MX SoCs with System Controller"
-	depends on IMX_SCU || COMPILE_TEST
+	depends on IMX_SCU
 	depends on OF
 	help
 	  Support for Temperature Monitor (TEMPMON) found on NXP i.MX SoCs with
Signature · 1 line
2.7.4
#2 lore raw

Re: [PATCH 2/2] thermal: Remove COMPILE_TEST for IMX_SC_THERMAL

Quoted 4 lines · Anson Huang

i.MX SCU thermal driver depends on IMX_SCU which does NOT have COMPILE_TEST enabled, so need to remove COMPILE_TEST for i.MX SCU thermal as well.

Wouldn't a better solution be to add COMPILE_TEST to IMX_SCU to improve compile coverage?

Quoted 21 lines
---
 drivers/thermal/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thermal/Kconfig +1 -2
index 165b7d6..4fb87df 100644
@@ -253,7 +253,7 @@ config IMX_THERMAL
 
 config IMX_SC_THERMAL
        tristate "Temperature sensor driver for NXP i.MX SoCs with System Controller"
-       depends on IMX_SCU || COMPILE_TEST
+       depends on IMX_SCU
        depends on OF
        help
          Support for Temperature Monitor (TEMPMON) found on NXP i.MX SoCs with
--

2.7.4

#3 lore raw

RE: [PATCH 2/2] thermal: Remove COMPILE_TEST for IMX_SC_THERMAL

Hi, Amit

Quoted 6 lines

Subject: Re: [PATCH 2/2] thermal: Remove COMPILE_TEST for IMX_SC_THERMAL

Quoted 1 line · Anson Huang
Quoted 6 lines
Quoted 3 lines

i.MX SCU thermal driver depends on IMX_SCU which does NOT have COMPILE_TEST enabled, so need to remove COMPILE_TEST for i.MX SCU thermal as well.

Wouldn't a better solution be to add COMPILE_TEST to IMX_SCU to improve compile coverage?

It is a good idea, but I think since there are many i.MX8 modules driver also depend on IMX_SCU, It would be better to cut another patch set to enable COMPILE_TEST for IMX_SCU as well as all those modules that depend on it, then the compile coverage will cover all i.MX8 modules depend on IMX_SCU.

Thanks,
Anson

#4 lore raw
In reply to Anson Huang
Quoted 10 lines · Anson Huang

Add "inline" to thermal_zone_of_get_sensor_id() function to avoid below build warning of !defined(CONFIG_THERMAL_OF).

In file included from drivers/hwmon/hwmon.c:22:
include/linux/thermal.h:382:12: warning: 'thermal_zone_of_get_sensor_id' defined but not used [-Wunused-function]
382 | static int thermal_zone_of_get_sensor_id(struct device_node *tz_np,

---

Applied, thanks

Signature · 5 lines
 <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog