Re: Sparse warnings on GENMASK + arm32

2017-07-26 Thread Christopher Li
On Wed, Jul 26, 2017 at 9:33 AM, Lance Richardson wrote: > Hmm, it seems sparse is incorrectly taking ~0UL to be a 64-bit value > while BITS_PER_LONG is (correctly) evaluated to be 32. > > #define GENMASK(h, l) \ > (((~0UL) << (l)) & (~0UL >> (BITS_PER_LONG - 1 -

Re: Sparse warnings on GENMASK + arm32

2017-07-26 Thread Christopher Li
On Wed, Jul 26, 2017 at 9:33 AM, Lance Richardson wrote: > Hmm, it seems sparse is incorrectly taking ~0UL to be a 64-bit value > while BITS_PER_LONG is (correctly) evaluated to be 32. > > #define GENMASK(h, l) \ > (((~0UL) << (l)) & (~0UL >> (BITS_PER_LONG - 1 - (h > What is the

Re: Sparse warnings on GENMASK + arm32

2017-07-26 Thread Luc Van Oostenryck
On Wed, Jul 26, 2017 at 09:33:01AM -0400, Lance Richardson wrote: > > From: "Stephen Boyd" > > I see sparse warning when I check a clk driver file in the kernel > > on a 32-bit ARM build. > > > > drivers/clk/sunxi/clk-sun6i-ar100.c:65:20: warning: cast truncates bits from >

Re: Sparse warnings on GENMASK + arm32

2017-07-26 Thread Luc Van Oostenryck
On Wed, Jul 26, 2017 at 09:33:01AM -0400, Lance Richardson wrote: > > From: "Stephen Boyd" > > I see sparse warning when I check a clk driver file in the kernel > > on a 32-bit ARM build. > > > > drivers/clk/sunxi/clk-sun6i-ar100.c:65:20: warning: cast truncates bits from > > constant value

Re: Sparse warnings on GENMASK + arm32

2017-07-26 Thread Lance Richardson
> From: "Stephen Boyd" <sb...@codeaurora.org> > To: linux-spa...@vger.kernel.org > Cc: linux-kernel@vger.kernel.org > Sent: Tuesday, 25 July, 2017 9:30:20 PM > Subject: Sparse warnings on GENMASK + arm32 > > I see sparse warning when I check a clk driver file

Re: Sparse warnings on GENMASK + arm32

2017-07-26 Thread Lance Richardson
> From: "Stephen Boyd" > To: linux-spa...@vger.kernel.org > Cc: linux-kernel@vger.kernel.org > Sent: Tuesday, 25 July, 2017 9:30:20 PM > Subject: Sparse warnings on GENMASK + arm32 > > I see sparse warning when I check a clk driver file in the kernel > on a

Sparse warnings on GENMASK + arm32

2017-07-25 Thread Stephen Boyd
I see sparse warning when I check a clk driver file in the kernel on a 32-bit ARM build. drivers/clk/sunxi/clk-sun6i-ar100.c:65:20: warning: cast truncates bits from constant value (3 becomes ) The code in question looks like: static const struct factors_data sun6i_ar100_data =

Sparse warnings on GENMASK + arm32

2017-07-25 Thread Stephen Boyd
I see sparse warning when I check a clk driver file in the kernel on a 32-bit ARM build. drivers/clk/sunxi/clk-sun6i-ar100.c:65:20: warning: cast truncates bits from constant value (3 becomes ) The code in question looks like: static const struct factors_data sun6i_ar100_data =