All of lore.kernel.org
 help / color / mirror / Atom feed
* [norov:bitmap 45/47] include/linux/bitmap.h:259:9: warning: 'memcpy' forming offset [20, 23] is out of the bounds [0, 20]
@ 2022-04-18 10:44 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2022-04-18 10:44 UTC (permalink / raw)
  To: Yury Norov; +Cc: kbuild-all, linux-kernel

tree:   https://github.com/norov/linux bitmap
head:   45a9e3feb171ccf077979b7ff6a0c6a732cfc17b
commit: 1a21df17d726b4f3c19a148e10d09ec632603f1c [45/47] lib: add bitmap_{from,to}_arr64
config: arm-randconfig-c002-20220418 (https://download.01.org/0day-ci/archive/20220418/202204181840.J2i3sYYd-lkp@intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 11.2.0
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
        # https://github.com/norov/linux/commit/1a21df17d726b4f3c19a148e10d09ec632603f1c
        git remote add norov https://github.com/norov/linux
        git fetch --no-tags norov bitmap
        git checkout 1a21df17d726b4f3c19a148e10d09ec632603f1c
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arm SHELL=/bin/bash

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 include/linux/cpumask.h:12,
                    from include/linux/smp.h:13,
                    from include/linux/lockdep.h:14,
                    from include/linux/mutex.h:17,
                    from include/linux/rfkill.h:35,
                    from net/bluetooth/hci_core.c:29:
   include/linux/bitmap.h: In function 'bitmap_from_u64':
   include/linux/bitmap.h:305:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     305 |                         (const unsigned long *) (buf), (nbits))
         |                         ^
   include/linux/bitmap.h:615:16: note: in expansion of macro 'bitmap_from_arr64'
     615 |         return bitmap_from_arr64(dst, mask, 64);
         |                ^~~~~~~~~~~~~~~~~
   In file included from include/linux/cpumask.h:12,
                    from include/linux/smp.h:13,
                    from include/linux/lockdep.h:14,
                    from include/linux/mutex.h:17,
                    from include/linux/rfkill.h:35,
                    from net/bluetooth/hci_core.c:29:
   In function 'bitmap_copy',
       inlined from 'bitmap_copy_clear_tail' at include/linux/bitmap.h:268:2,
       inlined from 'bitmap_from_u64' at include/linux/bitmap.h:615:9,
       inlined from 'hci_bdaddr_list_add_with_flags' at net/bluetooth/hci_core.c:2156:2:
>> include/linux/bitmap.h:259:9: warning: 'memcpy' forming offset [20, 23] is out of the bounds [0, 20] [-Warray-bounds]
     259 |         memcpy(dst, src, len);
         |         ^~~~~~~~~~~~~~~~~~~~~


vim +/memcpy +259 include/linux/bitmap.h

^1da177e4c3f41 Linus Torvalds   2005-04-16  254  
^1da177e4c3f41 Linus Torvalds   2005-04-16  255  static inline void bitmap_copy(unsigned long *dst, const unsigned long *src,
8b4daad52fee77 Rasmus Villemoes 2015-02-12  256  			unsigned int nbits)
^1da177e4c3f41 Linus Torvalds   2005-04-16  257  {
8b4daad52fee77 Rasmus Villemoes 2015-02-12  258  	unsigned int len = BITS_TO_LONGS(nbits) * sizeof(unsigned long);
^1da177e4c3f41 Linus Torvalds   2005-04-16 @259  	memcpy(dst, src, len);
^1da177e4c3f41 Linus Torvalds   2005-04-16  260  }
^1da177e4c3f41 Linus Torvalds   2005-04-16  261  

:::::: The code at line 259 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2

:::::: TO: Linus Torvalds <torvalds@ppc970.osdl.org>
:::::: CC: Linus Torvalds <torvalds@ppc970.osdl.org>

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

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

only message in thread, other threads:[~2022-04-18 10:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-18 10:44 [norov:bitmap 45/47] include/linux/bitmap.h:259:9: warning: 'memcpy' forming offset [20, 23] is out of the bounds [0, 20] 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.