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]
Message-ID: <1547465.PvRbYVlVrB@aspire.rjw.lan>
Date:   Sat, 28 Jan 2017 12:32:56 +0100
From:   "Rafael J. Wysocki" <rjw@...ysocki.net>
To:     Viresh Kumar <viresh.kumar@...aro.org>
Cc:     Len Brown <lenb@...nel.org>, linaro-kernel@...ts.linaro.org,
        linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org,
        Vincent Guittot <vincent.guittot@...aro.org>,
        linux-acpi@...r.kernel.org
Subject: Re: [PATCH 1/2] ACPI: processor_perflib: Simplify code and stop using CPUFREQ_START

On Thursday, January 05, 2017 11:34:30 AM Viresh Kumar wrote:
> acpi_processor_ppc_notifier() can live without using CPUFREQ_START
> (which is gonna be removed soon).

That should be "acpi_processor_ppc_notifier() can live without using CPUFREQ_START ...,
because X".

X is obviously missing.

> Simplify it a bit.
> 
> Signed-off-by: Viresh Kumar <viresh.kumar@...aro.org>
> ---
> Rebased over: https://marc.info/?l=linux-kernel&m=148359167516831&w=2
> 
>  drivers/acpi/processor_perflib.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/acpi/processor_perflib.c b/drivers/acpi/processor_perflib.c
> index f0b4a981b8d3..1ceea1143a1c 100644
> --- a/drivers/acpi/processor_perflib.c
> +++ b/drivers/acpi/processor_perflib.c
> @@ -75,14 +75,12 @@ static int acpi_processor_ppc_notifier(struct notifier_block *nb,
>  	struct acpi_processor *pr;
>  	unsigned int ppc = 0;
>  
> -	if (event == CPUFREQ_START && ignore_ppc <= 0) {
> -		ignore_ppc = 0;
> -		return 0;
> -	}
> -
>  	if (ignore_ppc)
>  		return 0;
>  
> +	if (ignore_ppc < 0)
> +		ignore_ppc = 0;
> +

And the above looks like dead code to me (we have returned already if ignore_ppc
is negative), so in particular ignore_ppc is never going to become 0 when it was
negative initially.

>  	if (event != CPUFREQ_ADJUST)
>  		return 0;
>  
> 

Thanks,
Rafael

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ