Thread (14 messages) 14 messages, 5 authors, 2020-08-01

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

From: Anson Huang <hidden>
Date: 2020-07-30 01:14:16
Also in: linux-clk, lkml

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:
quoted
Hi, Randy

quoted
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:
quoted
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))
quoted
Signed-off-by: Anson Huang <redacted>
Reported-by: kernel test robot <redacted>
---
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




_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help