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: <DB3PR0402MB3916E18C8B36010D60086EA2F5710@DB3PR0402MB3916.eurprd04.prod.outlook.com>
Date:   Thu, 30 Jul 2020 01:14:08 +0000
From:   Anson Huang <anson.huang@....com>
To:     Randy Dunlap <rdunlap@...radead.org>,
        "mturquette@...libre.com" <mturquette@...libre.com>,
        "sboyd@...nel.org" <sboyd@...nel.org>,
        "shawnguo@...nel.org" <shawnguo@...nel.org>,
        "s.hauer@...gutronix.de" <s.hauer@...gutronix.de>,
        "kernel@...gutronix.de" <kernel@...gutronix.de>,
        "festevam@...il.com" <festevam@...il.com>,
        Aisheng Dong <aisheng.dong@....com>,
        "arnd@...db.de" <arnd@...db.de>, Peng Fan <peng.fan@....com>,
        Abel Vesa <abel.vesa@....com>, Andy Duan <fugang.duan@....com>,
        Daniel Baluta <daniel.baluta@....com>,
        "yuehaibing@...wei.com" <yuehaibing@...wei.com>,
        "linux-clk@...r.kernel.org" <linux-clk@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>
CC:     dl-linux-imx <linux-imx@....com>
Subject: RE: [PATCH V7 1/6] clk: imx6sl: Use BIT(x) to avoid shifting signed
 32-bit value by 31 bits

Hi, Randy


> Subject: Re: [PATCH V7 1/6] clk: imx6sl: Use BIT(x) to avoid shifting signed
> 32-bit value by 31 bits
> 
> On 7/29/20 4:51 PM, Anson Huang wrote:
> > Hi, Randy
> >
> >
> >> Subject: Re: [PATCH V7 1/6] clk: imx6sl: Use BIT(x) to avoid shifting
> >> signed 32-bit value by 31 bits
> >>
> >> On 7/29/20 7:48 AM, Anson Huang wrote:
> >>> Use readl_relaxed() instead of __raw_readl(), and use BIT(x) instead
> >>> of (1 << X) to fix below build warning reported by kernel test robot:
> >>>
> >>> drivers/clk/imx/clk-imx6sl.c:149:49: warning: Shifting signed 32-bit
> >>> value by 31 bits is undefined behaviour [shiftTooManyBitsSigned]
> >>>      while (!(__raw_readl(anatop_base + PLL_ARM) &
> >> BM_PLL_ARM_LOCK))
> >>>
> >>> Signed-off-by: Anson Huang <Anson.Huang@....com>
> >>> Reported-by: kernel test robot <lkp@...el.com>
> >>> ---
> >>> Changes since V6:
> >>> 	- improve the subject.
> >>> ---
> >>>  drivers/clk/imx/clk-imx6sl.c | 15 ++++++++-------
> >>>  1 file changed, 8 insertions(+), 7 deletions(-)
> >>>
> >>> diff --git a/drivers/clk/imx/clk-imx6sl.c
> >>> b/drivers/clk/imx/clk-imx6sl.c index 0f647d1..e69dba1 100644
> >>> --- a/drivers/clk/imx/clk-imx6sl.c
> >>> +++ b/drivers/clk/imx/clk-imx6sl.c
> >>> @@ -3,6 +3,7 @@
> >>>   * Copyright 2013-2014 Freescale Semiconductor, Inc.
> >>>   */
> >>>
> >>> +#include <linux/bitfield.h>
> >>
> >> Hi,
> >> I think you want
> >> #include <linux/bits.h>
> >>
> >> for BIT() usage.
> >
> > Actually, the linux/of.h already includes linux/bitops.h and
> > linux/bitops.h includes linux/bits.h, so I will just drop linux/bitfield.h and
> send a V8.
> 
> or you could read Documentation/process/submit-checklist.rst,
> where rule #1 says:
> 
> 1) If you use a facility then #include the file that defines/declares
>    that facility.  Don't depend on other header files pulling in ones
>    that you use.

Understood, while I search "BIT()" in clk driver, most of the drivers does NOT include
linux/bits.h even they use it.

But OK, I will send V9 to include it.

Thanks,
Anson




Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ