Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752868AbbETH2Q (ORCPT ); Wed, 20 May 2015 03:28:16 -0400 Received: from mail.kapsi.fi ([217.30.184.167]:51211 "EHLO mail.kapsi.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750966AbbETH2O (ORCPT ); Wed, 20 May 2015 03:28:14 -0400 Message-ID: <555C3781.6090005@kapsi.fi> Date: Wed, 20 May 2015 10:28:01 +0300 From: Mikko Perttunen User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Sascha Hauer , linux-pm@vger.kernel.org CC: Zhang Rui , Eduardo Valentin , linux-kernel@vger.kernel.org, Stephen Warren , kernel@pengutronix.de, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Brian Norris Subject: Re: [PATCH 06/15] thermal: inline only once used function References: <1431507163-19933-1-git-send-email-s.hauer@pengutronix.de> <1431507163-19933-7-git-send-email-s.hauer@pengutronix.de> In-Reply-To: <1431507163-19933-7-git-send-email-s.hauer@pengutronix.de> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 2001:708:30:12d0:beee:7bff:fe5b:f272 X-SA-Exim-Mail-From: mikko.perttunen@kapsi.fi X-SA-Exim-Scanned: No (on mail.kapsi.fi); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1810 Lines: 57 On 05/13/15 11:52, Sascha Hauer wrote: > Inline update_temperature into its only caller to make the code > more readable. > > Signed-off-by: Sascha Hauer > --- > drivers/thermal/thermal_core.c | 17 +++++------------ > 1 file changed, 5 insertions(+), 12 deletions(-) > > diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c > index e204deb..19da022 100644 > --- 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 thermal_zone_device *tz) > 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); > This is a slight change in that if get_temp fails, governors were updated before but aren't now. But I don't know why that would matter. Reviewed-by: Mikko Perttunen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/