From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753341AbbCZPyb (ORCPT ); Thu, 26 Mar 2015 11:54:31 -0400 Received: from metis.ext.pengutronix.de ([92.198.50.35]:56473 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753292AbbCZPyZ (ORCPT ); Thu, 26 Mar 2015 11:54:25 -0400 From: Sascha Hauer To: linux-pm@vger.kernel.org Cc: Zhang Rui , Eduardo Valentin , linux-kernel@vger.kernel.org, Stephen Warren , Mikko Perttunen , kernel@pengutronix.de, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Sascha Hauer Subject: [PATCH 05/13] thermal: inline only once used function Date: Thu, 26 Mar 2015 16:53:52 +0100 Message-Id: <1427385240-6086-6-git-send-email-s.hauer@pengutronix.de> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1427385240-6086-1-git-send-email-s.hauer@pengutronix.de> References: <1427385240-6086-1-git-send-email-s.hauer@pengutronix.de> X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::7 X-SA-Exim-Mail-From: sha@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Inline update_temperature into its only caller to make the code more readable. Signed-off-by: Sascha Hauer --- drivers/thermal/thermal_core.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index ebca854..6d0fdad 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -431,11 +431,15 @@ 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 count; unsigned long temp; int ret; + if (!tz->ops->get_temp) + return; + ret = thermal_zone_get_temp(tz, &temp); if (ret) { dev_warn(&tz->device, "failed to read out thermal zone %d\n", @@ -451,16 +455,6 @@ static void update_temperature(struct thermal_zone_device *tz) trace_thermal_temperature(tz); dev_dbg(&tz->device, "last_temperature=%lu, current_temperature=%lu\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); -- 2.1.4 From mboxrd@z Thu Jan 1 00:00:00 1970 From: s.hauer@pengutronix.de (Sascha Hauer) Date: Thu, 26 Mar 2015 16:53:52 +0100 Subject: [PATCH 05/13] thermal: inline only once used function In-Reply-To: <1427385240-6086-1-git-send-email-s.hauer@pengutronix.de> References: <1427385240-6086-1-git-send-email-s.hauer@pengutronix.de> Message-ID: <1427385240-6086-6-git-send-email-s.hauer@pengutronix.de> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Inline update_temperature into its only caller to make the code more readable. Signed-off-by: Sascha Hauer --- drivers/thermal/thermal_core.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index ebca854..6d0fdad 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -431,11 +431,15 @@ 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 count; unsigned long temp; int ret; + if (!tz->ops->get_temp) + return; + ret = thermal_zone_get_temp(tz, &temp); if (ret) { dev_warn(&tz->device, "failed to read out thermal zone %d\n", @@ -451,16 +455,6 @@ static void update_temperature(struct thermal_zone_device *tz) trace_thermal_temperature(tz); dev_dbg(&tz->device, "last_temperature=%lu, current_temperature=%lu\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); -- 2.1.4