2020-03-03 08:11:45

by Anson Huang

[permalink] [raw]
Subject: [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,

Signed-off-by: Anson Huang <[email protected]>
---
include/linux/thermal.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/thermal.h b/include/linux/thermal.h
index 53e6f67..c91b1e3 100644
--- a/include/linux/thermal.h
+++ b/include/linux/thermal.h
@@ -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)
{
--
2.7.4


2020-03-03 09:03:13

by Daniel Lezcano

[permalink] [raw]
Subject: Re: [PATCH 1/2] thermal: Fix build warning of !defined(CONFIG_THERMAL_OF)

On 03/03/2020 09:04, Anson Huang wrote:
> 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,
>
> Signed-off-by: Anson Huang <[email protected]>
> ---

Applied, thanks

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