[PATCH V7 1/6] clk: imx6sl: Use BIT(x) to avoid shifting signed 32-bit value by 31 bits

Anson Huang anson.huang at nxp.com
Wed Jul 29 19:51:06 EDT 2020


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 at nxp.com>
> > Reported-by: kernel test robot <lkp at intel.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.

Thanks,
Anson






More information about the linux-arm-kernel mailing list