lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 20 May 2015 10:28:01 +0300
From:	Mikko Perttunen <mikko.perttunen@...si.fi>
To:	Sascha Hauer <s.hauer@...gutronix.de>, linux-pm@...r.kernel.org
CC:	Zhang Rui <rui.zhang@...el.com>,
	Eduardo Valentin <edubezval@...il.com>,
	linux-kernel@...r.kernel.org,
	Stephen Warren <swarren@...dotorg.org>, kernel@...gutronix.de,
	linux-mediatek@...ts.infradead.org,
	linux-arm-kernel@...ts.infradead.org,
	Brian Norris <computersforpeace@...il.com>
Subject: Re: [PATCH 06/15] thermal: inline only once used function

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 <s.hauer@...gutronix.de>
> ---
>   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 <mperttunen@...dia.com>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ