openwrtv4/target/linux/mediatek/patches/0015-thermal-inline-only-once-used-function.patch
Hauke Mehrtens f0a5f24217 kernel: update 4.1 to 4.1.13
- two upstreamed patches removed
- compile tested all targets using 4.1
- run tested ar71xx

Signed-off-by: Roman Yeryomin <roman@advem.lv>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>

SVN-Revision: 47694
2015-12-02 21:52:41 +00:00

48 lines
1.3 KiB
Diff

From 0b729a98127ef045096edf20dfe5c4eadac21d44 Mon Sep 17 00:00:00 2001
From: Sascha Hauer <s.hauer@pengutronix.de>
Date: Wed, 13 May 2015 10:52:34 +0200
Subject: [PATCH 15/76] thermal: inline only once used function
Inline update_temperature into its only caller to make the code
more readable.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
---
drivers/thermal/thermal_core.c | 17 +++++------------
1 file changed, 5 insertions(+), 12 deletions(-)
--- a/drivers/thermal/thermal_core.c
+++ b/drivers/thermal/thermal_core.c
@@ -450,9 +450,12 @@ exit:
}
EXPORT_SYMBOL_GPL(thermal_zone_get_temp);
-static void update_temperature(struct thermal_zone_device *tz)
+void thermal_zone_device_update(struct thermal_zone_device *tz)
{
- int temp, ret;
+ int temp, ret, count;
+
+ if (!tz->ops->get_temp)
+ return;
ret = thermal_zone_get_temp(tz, &temp);
if (ret) {
@@ -471,16 +474,6 @@ static void update_temperature(struct th
trace_thermal_temperature(tz);
dev_dbg(&tz->device, "last_temperature=%d, current_temperature=%d\n",
tz->last_temperature, tz->temperature);
-}
-
-void thermal_zone_device_update(struct thermal_zone_device *tz)
-{
- int count;
-
- if (!tz->ops->get_temp)
- return;
-
- update_temperature(tz);
for (count = 0; count < tz->trips; count++)
handle_thermal_trip(tz, count);