All of lore.kernel.org
 help / color / mirror / Atom feed
* [riscv:for-next 2/2] net/ipv4/fib_trie.c:324:13: warning: implicit conversion from 'unsigned long' to 'u32' (aka 'unsigned int') changes value from 2305843009213693946 to 4294967290
@ 2021-05-24  4:52 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-05-24  4:52 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 18420 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git for-next
head:   11c2f6c1b30392d366e84bbe9937616e79279bca
commit: 11c2f6c1b30392d366e84bbe9937616e79279bca [2/2] Merge remote-tracking branches 'riscv/next-misc' and 'riscv/fixes' into for-next
config: riscv-randconfig-r013-20210524 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 93d1e5822ed64abd777eb94ea9899e96c4c39fbe)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install riscv cross compiling tool for clang build
        # apt-get install binutils-riscv64-linux-gnu
        # https://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git/commit/?id=11c2f6c1b30392d366e84bbe9937616e79279bca
        git remote add riscv https://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git
        git fetch --no-tags riscv for-next
        git checkout 11c2f6c1b30392d366e84bbe9937616e79279bca
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   In file included from net/ipv4/fib_trie.c:39:
   In file included from include/linux/uaccess.h:11:
   In file included from arch/riscv/include/asm/uaccess.h:11:
   arch/riscv/include/asm/pgtable.h:579:20: error: redefinition of 'set_pmd_at'
   static inline void set_pmd_at(struct mm_struct *mm, unsigned long addr,
                      ^
   arch/riscv/include/asm/pgtable.h:420:20: note: previous definition is here
   static inline void set_pmd_at(struct mm_struct *mm, unsigned long addr,
                      ^
>> net/ipv4/fib_trie.c:324:13: warning: implicit conversion from 'unsigned long' to 'u32' (aka 'unsigned int') changes value from 2305843009213693946 to 4294967290 [-Wconstant-conversion]
           if (bits > TNODE_VMALLOC_MAX)
                      ^~~~~~~~~~~~~~~~~
   net/ipv4/fib_trie.c:305:35: note: expanded from macro 'TNODE_VMALLOC_MAX'
           ilog2((SIZE_MAX - TNODE_SIZE(0)) / sizeof(struct key_vector *))
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/log2.h:162:14: note: expanded from macro 'ilog2'
           __ilog2_u32(n) :                \
           ~~~~~~~~~~~ ^
   1 warning and 1 error generated.
--
   In file included from drivers/char/xillybus/xillybus_pcie.c:11:
   In file included from include/linux/pci.h:38:
   In file included from include/linux/interrupt.h:11:
   In file included from include/linux/hardirq.h:11:
   In file included from ./arch/riscv/include/generated/asm/hardirq.h:1:
   In file included from include/asm-generic/hardirq.h:17:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/riscv/include/asm/io.h:15:
   In file included from include/linux/pgtable.h:6:
   arch/riscv/include/asm/pgtable.h:579:20: error: redefinition of 'set_pmd_at'
   static inline void set_pmd_at(struct mm_struct *mm, unsigned long addr,
                      ^
   arch/riscv/include/asm/pgtable.h:420:20: note: previous definition is here
   static inline void set_pmd_at(struct mm_struct *mm, unsigned long addr,
                      ^
>> drivers/char/xillybus/xillybus_pcie.c:191:37: warning: shift count >= width of type [-Wshift-count-overflow]
           } else if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) {
                                              ^~~~~~~~~~~~~~~~
   include/linux/dma-mapping.h:76:54: note: expanded from macro 'DMA_BIT_MASK'
   #define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
                                                        ^ ~~~
   1 warning and 1 error generated.
--
   In file included from drivers/crypto/cavium/nitrox/nitrox_main.c:8:
   In file included from include/linux/pci.h:38:
   In file included from include/linux/interrupt.h:11:
   In file included from include/linux/hardirq.h:11:
   In file included from ./arch/riscv/include/generated/asm/hardirq.h:1:
   In file included from include/asm-generic/hardirq.h:17:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/riscv/include/asm/io.h:15:
   In file included from include/linux/pgtable.h:6:
   arch/riscv/include/asm/pgtable.h:579:20: error: redefinition of 'set_pmd_at'
   static inline void set_pmd_at(struct mm_struct *mm, unsigned long addr,
                      ^
   arch/riscv/include/asm/pgtable.h:420:20: note: previous definition is here
   static inline void set_pmd_at(struct mm_struct *mm, unsigned long addr,
                      ^
>> drivers/crypto/cavium/nitrox/nitrox_main.c:431:45: warning: shift count >= width of type [-Wshift-count-overflow]
           if (!dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64))) {
                                                      ^~~~~~~~~~~~~~~~
   include/linux/dma-mapping.h:76:54: note: expanded from macro 'DMA_BIT_MASK'
   #define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
                                                        ^ ~~~
   1 warning and 1 error generated.
--
   In file included from drivers/crypto/inside-secure/safexcel.c:10:
   In file included from include/linux/dma-mapping.h:10:
   In file included from include/linux/scatterlist.h:8:
   In file included from include/linux/mm.h:33:
   In file included from include/linux/pgtable.h:6:
   arch/riscv/include/asm/pgtable.h:579:20: error: redefinition of 'set_pmd_at'
   static inline void set_pmd_at(struct mm_struct *mm, unsigned long addr,
                      ^
   arch/riscv/include/asm/pgtable.h:420:20: note: previous definition is here
   static inline void set_pmd_at(struct mm_struct *mm, unsigned long addr,
                      ^
   drivers/crypto/inside-secure/safexcel.c:1734:18: warning: cast to smaller integer type 'enum safexcel_eip_version' from 'const void *' [-Wvoid-pointer-to-enum-cast]
           priv->version = (enum safexcel_eip_version)of_device_get_match_data(dev);
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/crypto/inside-secure/safexcel.c:1772:39: warning: shift count >= width of type [-Wshift-count-overflow]
           ret = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(64));
                                                ^~~~~~~~~~~~~~~~
   include/linux/dma-mapping.h:76:54: note: expanded from macro 'DMA_BIT_MASK'
   #define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
                                                        ^ ~~~
   2 warnings and 1 error generated.
--
   In file included from drivers/dma/dw-edma/dw-edma-pcie.c:11:
   In file included from include/linux/pci.h:38:
   In file included from include/linux/interrupt.h:11:
   In file included from include/linux/hardirq.h:11:
   In file included from ./arch/riscv/include/generated/asm/hardirq.h:1:
   In file included from include/asm-generic/hardirq.h:17:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/riscv/include/asm/io.h:15:
   In file included from include/linux/pgtable.h:6:
   arch/riscv/include/asm/pgtable.h:579:20: error: redefinition of 'set_pmd_at'
   static inline void set_pmd_at(struct mm_struct *mm, unsigned long addr,
                      ^
   arch/riscv/include/asm/pgtable.h:420:20: note: previous definition is here
   static inline void set_pmd_at(struct mm_struct *mm, unsigned long addr,
                      ^
>> drivers/dma/dw-edma/dw-edma-pcie.c:189:31: warning: shift count >= width of type [-Wshift-count-overflow]
           err = pci_set_dma_mask(pdev, DMA_BIT_MASK(64));
                                        ^~~~~~~~~~~~~~~~
   include/linux/dma-mapping.h:76:54: note: expanded from macro 'DMA_BIT_MASK'
   #define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
                                                        ^ ~~~
   drivers/dma/dw-edma/dw-edma-pcie.c:191:43: warning: shift count >= width of type [-Wshift-count-overflow]
                   err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64));
                                                           ^~~~~~~~~~~~~~~~
   include/linux/dma-mapping.h:76:54: note: expanded from macro 'DMA_BIT_MASK'
   #define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
                                                        ^ ~~~
   2 warnings and 1 error generated.
--
   In file included from drivers/misc/genwqe/card_base.c:20:
   In file included from include/linux/pci.h:38:
   In file included from include/linux/interrupt.h:11:
   In file included from include/linux/hardirq.h:11:
   In file included from ./arch/riscv/include/generated/asm/hardirq.h:1:
   In file included from include/asm-generic/hardirq.h:17:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/riscv/include/asm/io.h:15:
   In file included from include/linux/pgtable.h:6:
   arch/riscv/include/asm/pgtable.h:579:20: error: redefinition of 'set_pmd_at'
   static inline void set_pmd_at(struct mm_struct *mm, unsigned long addr,
                      ^
   arch/riscv/include/asm/pgtable.h:420:20: note: previous definition is here
   static inline void set_pmd_at(struct mm_struct *mm, unsigned long addr,
                      ^
>> drivers/misc/genwqe/card_base.c:1093:47: warning: shift count >= width of type [-Wshift-count-overflow]
           if (dma_set_mask_and_coherent(&pci_dev->dev, DMA_BIT_MASK(64)) ||
                                                        ^~~~~~~~~~~~~~~~
   include/linux/dma-mapping.h:76:54: note: expanded from macro 'DMA_BIT_MASK'
   #define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
                                                        ^ ~~~
   1 warning and 1 error generated.
--
   In file included from drivers/pci/switch/switchtec.c:7:
   In file included from include/linux/switchtec.h:10:
   In file included from include/linux/pci.h:38:
   In file included from include/linux/interrupt.h:11:
   In file included from include/linux/hardirq.h:11:
   In file included from ./arch/riscv/include/generated/asm/hardirq.h:1:
   In file included from include/asm-generic/hardirq.h:17:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/riscv/include/asm/io.h:15:
   In file included from include/linux/pgtable.h:6:
   arch/riscv/include/asm/pgtable.h:579:20: error: redefinition of 'set_pmd_at'
   static inline void set_pmd_at(struct mm_struct *mm, unsigned long addr,
                      ^
   arch/riscv/include/asm/pgtable.h:420:20: note: previous definition is here
   static inline void set_pmd_at(struct mm_struct *mm, unsigned long addr,
                      ^
>> drivers/pci/switch/switchtec.c:1524:45: warning: shift count >= width of type [-Wshift-count-overflow]
           rc = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
                                                      ^~~~~~~~~~~~~~~~
   include/linux/dma-mapping.h:76:54: note: expanded from macro 'DMA_BIT_MASK'
   #define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
                                                        ^ ~~~
   1 warning and 1 error generated.
--
   In file included from drivers/net/vmxnet3/vmxnet3_drv.c:28:
   In file included from include/net/ip6_checksum.h:27:
   In file included from include/net/ip.h:22:
   In file included from include/linux/ip.h:16:
   In file included from include/linux/skbuff.h:17:
   In file included from include/linux/bvec.h:14:
   In file included from include/linux/mm.h:33:
   In file included from include/linux/pgtable.h:6:
   arch/riscv/include/asm/pgtable.h:579:20: error: redefinition of 'set_pmd_at'
   static inline void set_pmd_at(struct mm_struct *mm, unsigned long addr,
                      ^
   arch/riscv/include/asm/pgtable.h:420:20: note: previous definition is here
   static inline void set_pmd_at(struct mm_struct *mm, unsigned long addr,
                      ^
>> drivers/net/vmxnet3/vmxnet3_drv.c:3413:29: warning: shift count >= width of type [-Wshift-count-overflow]
           if (pci_set_dma_mask(pdev, DMA_BIT_MASK(64)) == 0) {
                                      ^~~~~~~~~~~~~~~~
   include/linux/dma-mapping.h:76:54: note: expanded from macro 'DMA_BIT_MASK'
   #define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
                                                        ^ ~~~
   drivers/net/vmxnet3/vmxnet3_drv.c:3414:41: warning: shift count >= width of type [-Wshift-count-overflow]
                   if (pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64)) != 0) {
                                                         ^~~~~~~~~~~~~~~~
   include/linux/dma-mapping.h:76:54: note: expanded from macro 'DMA_BIT_MASK'
   #define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
                                                        ^ ~~~
   2 warnings and 1 error generated.
--
   In file included from drivers/net/wireless/quantenna/qtnfmac/pcie/pearl_pcie.c:6:
   In file included from include/linux/pci.h:38:
   In file included from include/linux/interrupt.h:11:
   In file included from include/linux/hardirq.h:11:
   In file included from ./arch/riscv/include/generated/asm/hardirq.h:1:
   In file included from include/asm-generic/hardirq.h:17:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/riscv/include/asm/io.h:15:
   In file included from include/linux/pgtable.h:6:
   arch/riscv/include/asm/pgtable.h:579:20: error: redefinition of 'set_pmd_at'
   static inline void set_pmd_at(struct mm_struct *mm, unsigned long addr,
                      ^
   arch/riscv/include/asm/pgtable.h:420:20: note: previous definition is here
   static inline void set_pmd_at(struct mm_struct *mm, unsigned long addr,
                      ^
>> drivers/net/wireless/quantenna/qtnfmac/pcie/pearl_pcie.c:1105:9: warning: shift count >= width of type [-Wshift-count-overflow]
           return DMA_BIT_MASK(64);
                  ^~~~~~~~~~~~~~~~
   include/linux/dma-mapping.h:76:54: note: expanded from macro 'DMA_BIT_MASK'
   #define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
                                                        ^ ~~~
   1 warning and 1 error generated.
--
   In file included from drivers/net/wireless/realtek/rtlwifi/pci.c:4:
   In file included from drivers/net/wireless/realtek/rtlwifi/wifi.h:11:
   In file included from include/linux/etherdevice.h:20:
   In file included from include/linux/if_ether.h:19:
   In file included from include/linux/skbuff.h:17:
   In file included from include/linux/bvec.h:14:
   In file included from include/linux/mm.h:33:
   In file included from include/linux/pgtable.h:6:
   arch/riscv/include/asm/pgtable.h:579:20: error: redefinition of 'set_pmd_at'
   static inline void set_pmd_at(struct mm_struct *mm, unsigned long addr,
                      ^
   arch/riscv/include/asm/pgtable.h:420:20: note: previous definition is here
   static inline void set_pmd_at(struct mm_struct *mm, unsigned long addr,
                      ^
>> drivers/net/wireless/realtek/rtlwifi/pci.c:2168:32: warning: shift count >= width of type [-Wshift-count-overflow]
               !dma_set_mask(&pdev->dev, DMA_BIT_MASK(64))) {
                                         ^~~~~~~~~~~~~~~~
   include/linux/dma-mapping.h:76:54: note: expanded from macro 'DMA_BIT_MASK'
   #define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
                                                        ^ ~~~
   drivers/net/wireless/realtek/rtlwifi/pci.c:2169:41: warning: shift count >= width of type [-Wshift-count-overflow]
                   if (dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(64))) {
                                                         ^~~~~~~~~~~~~~~~
   include/linux/dma-mapping.h:76:54: note: expanded from macro 'DMA_BIT_MASK'
   #define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
                                                        ^ ~~~
   2 warnings and 1 error generated.


vim +324 net/ipv4/fib_trie.c

37fd30f2da573c Alexander Duyck   2014-12-31  318  
dc35dbeda3e00a Alexander Duyck   2015-03-06  319  static struct tnode *tnode_alloc(int bits)
f0e36f8cee8101 Patrick McHardy   2005-07-05  320  {
1de3d87bcd2c2e Alexander Duyck   2015-03-04  321  	size_t size;
1de3d87bcd2c2e Alexander Duyck   2015-03-04  322  
1de3d87bcd2c2e Alexander Duyck   2015-03-04  323  	/* verify bits is within bounds */
1de3d87bcd2c2e Alexander Duyck   2015-03-04 @324  	if (bits > TNODE_VMALLOC_MAX)
1de3d87bcd2c2e Alexander Duyck   2015-03-04  325  		return NULL;
1de3d87bcd2c2e Alexander Duyck   2015-03-04  326  
1de3d87bcd2c2e Alexander Duyck   2015-03-04  327  	/* determine size and verify it is non-zero and didn't overflow */
1de3d87bcd2c2e Alexander Duyck   2015-03-04  328  	size = TNODE_SIZE(1ul << bits);
1de3d87bcd2c2e Alexander Duyck   2015-03-04  329  
2373ce1ca04dd4 Robert Olsson     2005-08-25  330  	if (size <= PAGE_SIZE)
8d96544475b236 Eric Dumazet      2008-01-13  331  		return kzalloc(size, GFP_KERNEL);
15be75cdb5db44 Stephen Hemminger 2008-04-10  332  	else
7a1c8e5ab120a5 Eric Dumazet      2010-11-20  333  		return vzalloc(size);
15be75cdb5db44 Stephen Hemminger 2008-04-10  334  }
2373ce1ca04dd4 Robert Olsson     2005-08-25  335  

:::::: The code@line 324 was first introduced by commit
:::::: 1de3d87bcd2c2e631500b9e4f0c40b38ce0d0d57 fib_trie: Prevent allocating tnode if bits is too big for size_t

:::::: TO: Alexander Duyck <alexander.h.duyck@redhat.com>
:::::: CC: David S. Miller <davem@davemloft.net>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 30484 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-05-24  4:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-24  4:52 [riscv:for-next 2/2] net/ipv4/fib_trie.c:324:13: warning: implicit conversion from 'unsigned long' to 'u32' (aka 'unsigned int') changes value from 2305843009213693946 to 4294967290 kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.