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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ec5ce50bc3e14f62bbf13c00a661e136@AcuMS.aculab.com>
Date:   Wed, 14 Jun 2023 10:17:10 +0000
From:   David Laight <David.Laight@...LAB.COM>
To:     "'GONG, Ruiqi'" <gongruiqi@...weicloud.com>,
        Geert Uytterhoeven <geert+renesas@...der.be>
CC:     Michael Turquette <mturquette@...libre.com>,
        Stephen Boyd <sboyd@...nel.org>,
        "linux-renesas-soc@...r.kernel.org" 
        <linux-renesas-soc@...r.kernel.org>,
        "linux-clk@...r.kernel.org" <linux-clk@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "gongruiqi1@...wei.com" <gongruiqi1@...wei.com>
Subject: RE: [PATCH] clk: renesas: r8a7778: remove checker warnings: x | !y

From: GONG, Ruiqi
> Sent: 13 June 2023 03:54
> 
> Eliminate the following Sparse reports when building with C=1:
> 
> drivers/clk/renesas/clk-r8a7778.c:85:52: warning: dubious: x | !y
> drivers/clk/renesas/clk-r8a7778.c:87:50: warning: dubious: x | !y
> 
> Signed-off-by: GONG, Ruiqi <gongruiqi@...weicloud.com>
> ---
>  drivers/clk/renesas/clk-r8a7778.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/clk/renesas/clk-r8a7778.c b/drivers/clk/renesas/clk-r8a7778.c
> index 797556259370..ad1a50f3b0cd 100644
> --- a/drivers/clk/renesas/clk-r8a7778.c
> +++ b/drivers/clk/renesas/clk-r8a7778.c
> @@ -81,11 +81,11 @@ static void __init r8a7778_cpg_clocks_init(struct device_node *np)
> 
>  	BUG_ON(!(mode & BIT(19)));
> 
> -	cpg_mode_rates = (!!(mode & BIT(18)) << 2) |
> -			 (!!(mode & BIT(12)) << 1) |
> -			 (!!(mode & BIT(11)));

Try just adding a << 0 on the last line.

Recent gcc and clang optimise the code to 'shift + and'.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ