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] [day] [month] [year] [list]
Message-ID: <AANLkTimaHGczcj=Ot=KkBvbA=VcRFztE8jMv3REOex8K@mail.gmail.com>
Date:	Tue, 2 Nov 2010 21:15:42 +0800
From:	Eric Miao <eric.y.miao@...il.com>
To:	Nicolas Kaiser <nikai@...ai.net>
Cc:	Russell King <linux@....linux.org.uk>,
	linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mach-pxa: sharpsl_pm: simplify conditional

On Sat, Oct 30, 2010 at 5:31 AM, Nicolas Kaiser <nikai@...ai.net> wrote:
> Simplify: ((a && b) || !a) => (b || !a)
>

This is a good catch, I believe this could be generally applied elsewhere
in the kernel. The problem with sharpsl_pm is that it's currently a mess
and needs a fully rewrite, I'd really like this issue being addressed in that
rewritten version.

> Signed-off-by: Nicolas Kaiser <nikai@...ai.net>
> ---
>  arch/arm/mach-pxa/sharpsl_pm.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/arch/arm/mach-pxa/sharpsl_pm.c b/arch/arm/mach-pxa/sharpsl_pm.c
> index 8fed027..d08763c 100644
> --- a/arch/arm/mach-pxa/sharpsl_pm.c
> +++ b/arch/arm/mach-pxa/sharpsl_pm.c
> @@ -619,7 +619,7 @@ static void corgi_goto_sleep(unsigned long alarm_time, unsigned int alarm_enable
>        PEDR = 0xffffffff; /* clear it */
>
>        sharpsl_pm.flags &= ~SHARPSL_ALARM_ACTIVE;
> -       if ((sharpsl_pm.charge_mode == CHRG_ON) && ((alarm_enable && ((alarm_time - RCNR) > (SHARPSL_BATCHK_TIME_SUSPEND + 30))) || !alarm_enable)) {
> +       if ((sharpsl_pm.charge_mode == CHRG_ON) && (((alarm_time - RCNR) > (SHARPSL_BATCHK_TIME_SUSPEND + 30)) || !alarm_enable)) {
>                RTSR &= RTSR_ALE;
>                RTAR = RCNR + SHARPSL_BATCHK_TIME_SUSPEND;
>                dev_dbg(sharpsl_pm.dev, "Charging alarm at: %08x\n", RTAR);
> --
> 1.7.2.2
>
--
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