lkml.org 
[lkml]   [2020]   [Jul]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH V7 1/6] clk: imx6sl: Use BIT(x) to avoid shifting signed 32-bit value by 31 bits
From
Date
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@nxp.com>
>>> Reported-by: kernel test robot <lkp@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.

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.


--
~Randy

\
 
 \ /
  Last update: 2020-07-30 02:30    [W:0.050 / U:1.376 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site