Search Linux Wireless

Re: [wireless-drivers-next:master 91/97] include/linux/bits.h:23:11: warning: right shift count is negative

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



+ linux-wireless

Tony, can you send a followup patch to fix this warning?

Kalle

kbuild test robot <lkp@xxxxxxxxx> writes:

> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git master
> head:   b298800dd8ee7250bf04b4dbd151e1a971b6df91
> commit: f39e9bd49a3d612a2489b774265107f61ffd82fa [91/97] rtw88: add set_bitrate_mask support
> config: mips-allmodconfig (attached as .config)
> compiler: mips-linux-gcc (GCC) 7.4.0
> reproduce:
>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         git checkout f39e9bd49a3d612a2489b774265107f61ffd82fa
>         # save the attached .config to linux build tree
>         GCC_VERSION=7.4.0 make.cross ARCH=mips 
>
> If you fix the issue, kindly add following tag
> Reported-by: kbuild test robot <lkp@xxxxxxxxx>
>
> All warnings (new ones prefixed by >>):
>
>    In file included from include/linux/bitops.h:5:0,
>                     from include/linux/kernel.h:12,
>                     from include/asm-generic/bug.h:19,
>                     from arch/mips/include/asm/bug.h:42,
>                     from include/linux/bug.h:5,
>                     from include/net/mac80211.h:16,
>                     from drivers/net//wireless/realtek/rtw88/main.h:8,
>                     from drivers/net//wireless/realtek/rtw88/main.c:5:
>    drivers/net//wireless/realtek/rtw88/main.c: In function 'rtw_update_rate_mask':
>>> include/linux/bits.h:23:11: warning: right shift count is negative
>>> [-Wshift-count-negative]
>       (~UL(0) >> (BITS_PER_LONG - 1 - (h))))
>               ^
>>> drivers/net//wireless/realtek/rtw88/main.c:622:17: note: in
>>> expansion of macro 'GENMASK'
>      u64 cfg_mask = GENMASK(63, 0);
>                     ^~~~~~~
> --
>    In file included from include/linux/bitops.h:5:0,
>                     from include/linux/kernel.h:12,
>                     from include/asm-generic/bug.h:19,
>                     from arch/mips/include/asm/bug.h:42,
>                     from include/linux/bug.h:5,
>                     from include/net/mac80211.h:16,
>                     from drivers/net/wireless/realtek/rtw88/main.h:8,
>                     from drivers/net/wireless/realtek/rtw88/main.c:5:
>    drivers/net/wireless/realtek/rtw88/main.c: In function 'rtw_update_rate_mask':
>>> include/linux/bits.h:23:11: warning: right shift count is negative [-Wshift-count-negative]
>       (~UL(0) >> (BITS_PER_LONG - 1 - (h))))
>               ^
>    drivers/net/wireless/realtek/rtw88/main.c:622:17: note: in expansion of macro 'GENMASK'
>      u64 cfg_mask = GENMASK(63, 0);
>                     ^~~~~~~
>
> vim +23 include/linux/bits.h
>
> 8bd9cb51daac89 Will Deacon     2018-06-19  15  
> 8bd9cb51daac89 Will Deacon     2018-06-19  16  /*
> 8bd9cb51daac89 Will Deacon     2018-06-19  17   * Create a contiguous bitmask starting at bit position @l and ending at
> 8bd9cb51daac89 Will Deacon     2018-06-19  18   * position @h. For example
> 8bd9cb51daac89 Will Deacon     2018-06-19  19   * GENMASK_ULL(39, 21) gives us the 64bit vector 0x000000ffffe00000.
> 8bd9cb51daac89 Will Deacon     2018-06-19  20   */
> 8bd9cb51daac89 Will Deacon     2018-06-19  21  #define GENMASK(h, l) \
> 95b980d62d52c4 Masahiro Yamada 2019-07-16  22  	(((~UL(0)) - (UL(1) << (l)) + 1) & \
> 95b980d62d52c4 Masahiro Yamada 2019-07-16 @23  	 (~UL(0) >> (BITS_PER_LONG - 1 - (h))))
> 8bd9cb51daac89 Will Deacon     2018-06-19  24  
>
> :::::: The code at line 23 was first introduced by commit
> :::::: 95b980d62d52c4c1768ee719e8db3efe27ef52b2 linux/bits.h: make BIT(), GENMASK(), and friends available in assembly
>
> :::::: TO: Masahiro Yamada <yamada.masahiro@xxxxxxxxxxxxx>
> :::::: CC: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
>
> ---
> 0-DAY kernel test infrastructure                Open Source Technology Center
> https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
>

-- 
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches



[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux