lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202204181517.43MrUpzS-lkp@intel.com>
Date:   Mon, 18 Apr 2022 16:04:56 +0800
From:   kernel test robot <lkp@...el.com>
To:     Yury Norov <yury.norov@...il.com>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org
Subject: [norov:bitmap 45/47] include/linux/bitmap.h:615:39: error: passing
 argument 2 of 'bitmap_from_arr64' makes pointer from integer without a cast

tree:   https://github.com/norov/linux bitmap
head:   45a9e3feb171ccf077979b7ff6a0c6a732cfc17b
commit: 1a21df17d726b4f3c19a148e10d09ec632603f1c [45/47] lib: add bitmap_{from,to}_arr64
config: powerpc-randconfig-m031-20220417 (https://download.01.org/0day-ci/archive/20220418/202204181517.43MrUpzS-lkp@intel.com/config)
compiler: powerpc-linux-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=powerpc SHELL=/bin/bash arch/powerpc/platforms/powermac/ drivers/w1/masters/ lib/

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

All error/warnings (new ones prefixed by >>):

   In file included from include/linux/cpumask.h:12,
                    from include/linux/mm_types_task.h:14,
                    from include/linux/mm_types.h:5,
                    from include/linux/buildid.h:5,
                    from include/linux/module.h:14,
                    from drivers/w1/masters/ds2490.c:8:
   include/linux/bitmap.h: In function 'bitmap_from_u64':
>> include/linux/bitmap.h:615:39: warning: passing argument 2 of 'bitmap_from_arr64' makes pointer from integer without a cast [-Wint-conversion]
     615 |         return bitmap_from_arr64(dst, mask, 64);
         |                                       ^~~~
         |                                       |
         |                                       u64 {aka long long unsigned int}
   include/linux/bitmap.h:300:58: note: expected 'const u64 *' {aka 'const long long unsigned int *'} but argument is of type 'u64' {aka 'long long unsigned int'}
     300 | void bitmap_from_arr64(unsigned long *bitmap, const u64 *buf, unsigned int nbits);
         |                                               ~~~~~~~~~~~^~~
--
   In file included from include/linux/cpumask.h:12,
                    from include/linux/mm_types_task.h:14,
                    from include/linux/mm_types.h:5,
                    from include/linux/buildid.h:5,
                    from include/linux/module.h:14,
                    from lib/oid_registry.c:8:
   include/linux/bitmap.h: In function 'bitmap_from_u64':
>> include/linux/bitmap.h:615:39: warning: passing argument 2 of 'bitmap_from_arr64' makes pointer from integer without a cast [-Wint-conversion]
     615 |         return bitmap_from_arr64(dst, mask, 64);
         |                                       ^~~~
         |                                       |
         |                                       u64 {aka long long unsigned int}
   include/linux/bitmap.h:300:58: note: expected 'const u64 *' {aka 'const long long unsigned int *'} but argument is of type 'u64' {aka 'long long unsigned int'}
     300 | void bitmap_from_arr64(unsigned long *bitmap, const u64 *buf, unsigned int nbits);
         |                                               ~~~~~~~~~~~^~~
   lib/oid_registry.c: At top level:
   lib/oid_registry.c:15:10: fatal error: oid_registry_data.c: No such file or directory
      15 | #include "oid_registry_data.c"
         |          ^~~~~~~~~~~~~~~~~~~~~
   compilation terminated.
--
   In file included from include/linux/cpumask.h:12,
                    from include/linux/mm_types_task.h:14,
                    from include/linux/mm_types.h:5,
                    from include/linux/buildid.h:5,
                    from include/linux/module.h:14,
                    from lib/crc64.c:36:
   include/linux/bitmap.h: In function 'bitmap_from_u64':
>> include/linux/bitmap.h:615:39: warning: passing argument 2 of 'bitmap_from_arr64' makes pointer from integer without a cast [-Wint-conversion]
     615 |         return bitmap_from_arr64(dst, mask, 64);
         |                                       ^~~~
         |                                       |
         |                                       u64 {aka long long unsigned int}
   include/linux/bitmap.h:300:58: note: expected 'const u64 *' {aka 'const long long unsigned int *'} but argument is of type 'u64' {aka 'long long unsigned int'}
     300 | void bitmap_from_arr64(unsigned long *bitmap, const u64 *buf, unsigned int nbits);
         |                                               ~~~~~~~~~~~^~~
   lib/crc64.c: At top level:
   lib/crc64.c:39:10: fatal error: crc64table.h: No such file or directory
      39 | #include "crc64table.h"
         |          ^~~~~~~~~~~~~~
   compilation terminated.
--
   In file included from include/linux/cpumask.h:12,
                    from include/linux/smp.h:13,
                    from include/linux/lockdep.h:14,
                    from include/linux/rcupdate.h:29,
                    from include/linux/rculist.h:11,
                    from include/linux/pid.h:5,
                    from include/linux/sched.h:14,
                    from arch/powerpc/platforms/powermac/pic.c:15:
   include/linux/bitmap.h: In function 'bitmap_from_u64':
>> include/linux/bitmap.h:615:39: error: passing argument 2 of 'bitmap_from_arr64' makes pointer from integer without a cast [-Werror=int-conversion]
     615 |         return bitmap_from_arr64(dst, mask, 64);
         |                                       ^~~~
         |                                       |
         |                                       u64 {aka long long unsigned int}
   include/linux/bitmap.h:300:58: note: expected 'const u64 *' {aka 'const long long unsigned int *'} but argument is of type 'u64' {aka 'long long unsigned int'}
     300 | void bitmap_from_arr64(unsigned long *bitmap, const u64 *buf, unsigned int nbits);
         |                                               ~~~~~~~~~~~^~~
   cc1: all warnings being treated as errors
--
   In file included from include/linux/cpumask.h:12,
                    from include/linux/smp.h:13,
                    from include/linux/lockdep.h:14,
                    from include/linux/rcupdate.h:29,
                    from include/linux/rculist.h:11,
                    from include/linux/pid.h:5,
                    from include/linux/sched.h:14,
                    from arch/powerpc/platforms/powermac/smp.c:21:
   include/linux/bitmap.h: In function 'bitmap_from_u64':
>> include/linux/bitmap.h:615:39: error: passing argument 2 of 'bitmap_from_arr64' makes pointer from integer without a cast [-Werror=int-conversion]
     615 |         return bitmap_from_arr64(dst, mask, 64);
         |                                       ^~~~
         |                                       |
         |                                       u64 {aka long long unsigned int}
   include/linux/bitmap.h:300:58: note: expected 'const u64 *' {aka 'const long long unsigned int *'} but argument is of type 'u64' {aka 'long long unsigned int'}
     300 | void bitmap_from_arr64(unsigned long *bitmap, const u64 *buf, unsigned int nbits);
         |                                               ~~~~~~~~~~~^~~
   arch/powerpc/platforms/powermac/smp.c: At top level:
   arch/powerpc/platforms/powermac/smp.c:416:13: error: no previous prototype for 'smp_psurge_take_timebase' [-Werror=missing-prototypes]
     416 | void __init smp_psurge_take_timebase(void)
         |             ^~~~~~~~~~~~~~~~~~~~~~~~
   arch/powerpc/platforms/powermac/smp.c:432:13: error: no previous prototype for 'smp_psurge_give_timebase' [-Werror=missing-prototypes]
     432 | void __init smp_psurge_give_timebase(void)
         |             ^~~~~~~~~~~~~~~~~~~~~~~~
   cc1: all warnings being treated as errors
--
   In file included from include/linux/cpumask.h:12,
                    from include/linux/mm_types_task.h:14,
                    from include/linux/mm_types.h:5,
                    from include/linux/buildid.h:5,
                    from include/linux/module.h:14,
                    from drivers/w1/masters/ds1wm.c:14:
   include/linux/bitmap.h: In function 'bitmap_from_u64':
>> include/linux/bitmap.h:615:39: warning: passing argument 2 of 'bitmap_from_arr64' makes pointer from integer without a cast [-Wint-conversion]
     615 |         return bitmap_from_arr64(dst, mask, 64);
         |                                       ^~~~
         |                                       |
         |                                       u64 {aka long long unsigned int}
   include/linux/bitmap.h:300:58: note: expected 'const u64 *' {aka 'const long long unsigned int *'} but argument is of type 'u64' {aka 'long long unsigned int'}
     300 | void bitmap_from_arr64(unsigned long *bitmap, const u64 *buf, unsigned int nbits);
         |                                               ~~~~~~~~~~~^~~
   drivers/w1/masters/ds1wm.c: In function 'ds1wm_probe':
   drivers/w1/masters/ds1wm.c:512:12: warning: variable 'inten' set but not used [-Wunused-but-set-variable]
     512 |         u8 inten;
         |            ^~~~~
--
   In file included from include/linux/cpumask.h:12,
                    from include/linux/smp.h:13,
                    from include/linux/lockdep.h:14,
                    from include/linux/rcupdate.h:29,
                    from include/linux/rculist.h:11,
                    from include/linux/pid.h:5,
                    from include/linux/sched.h:14,
                    from lib/ubsan.c:15:
   include/linux/bitmap.h: In function 'bitmap_from_u64':
>> include/linux/bitmap.h:615:39: warning: passing argument 2 of 'bitmap_from_arr64' makes pointer from integer without a cast [-Wint-conversion]
     615 |         return bitmap_from_arr64(dst, mask, 64);
         |                                       ^~~~
         |                                       |
         |                                       u64 {aka long long unsigned int}
   include/linux/bitmap.h:300:58: note: expected 'const u64 *' {aka 'const long long unsigned int *'} but argument is of type 'u64' {aka 'long long unsigned int'}
     300 | void bitmap_from_arr64(unsigned long *bitmap, const u64 *buf, unsigned int nbits);
         |                                               ~~~~~~~~~~~^~~
   lib/ubsan.c: At top level:
   lib/ubsan.c:242:6: warning: no previous prototype for '__ubsan_handle_type_mismatch' [-Wmissing-prototypes]
     242 | void __ubsan_handle_type_mismatch(struct type_mismatch_data *data,
         |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
   In file included from lib/radix-tree.c:12:
   include/linux/bitmap.h: In function 'bitmap_from_u64':
>> include/linux/bitmap.h:615:39: warning: passing argument 2 of 'bitmap_from_arr64' makes pointer from integer without a cast [-Wint-conversion]
     615 |         return bitmap_from_arr64(dst, mask, 64);
         |                                       ^~~~
         |                                       |
         |                                       u64 {aka long long unsigned int}
   include/linux/bitmap.h:300:58: note: expected 'const u64 *' {aka 'const long long unsigned int *'} but argument is of type 'u64' {aka 'long long unsigned int'}
     300 | void bitmap_from_arr64(unsigned long *bitmap, const u64 *buf, unsigned int nbits);
         |                                               ~~~~~~~~~~~^~~
   lib/radix-tree.c: At top level:
   lib/radix-tree.c:288:6: warning: no previous prototype for 'radix_tree_node_rcu_free' [-Wmissing-prototypes]
     288 | void radix_tree_node_rcu_free(struct rcu_head *head)
         |      ^~~~~~~~~~~~~~~~~~~~~~~~
--
   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/notifier.h:14,
                    from include/linux/clk.h:14,
                    from lib/vsprintf.c:22:
   include/linux/bitmap.h: In function 'bitmap_from_u64':
>> include/linux/bitmap.h:615:39: warning: passing argument 2 of 'bitmap_from_arr64' makes pointer from integer without a cast [-Wint-conversion]
     615 |         return bitmap_from_arr64(dst, mask, 64);
         |                                       ^~~~
         |                                       |
         |                                       u64 {aka long long unsigned int}
   include/linux/bitmap.h:300:58: note: expected 'const u64 *' {aka 'const long long unsigned int *'} but argument is of type 'u64' {aka 'long long unsigned int'}
     300 | void bitmap_from_arr64(unsigned long *bitmap, const u64 *buf, unsigned int nbits);
         |                                               ~~~~~~~~~~~^~~
   lib/vsprintf.c: In function 'va_format':
   lib/vsprintf.c:1704:9: warning: function 'va_format' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]
    1704 |         buf += vsnprintf(buf, end > buf ? end - buf : 0, va_fmt->fmt, va);
         |         ^~~
--
   In file included from lib/bitmap.c:7:
   include/linux/bitmap.h: In function 'bitmap_from_u64':
>> include/linux/bitmap.h:615:39: warning: passing argument 2 of 'bitmap_from_arr64' makes pointer from integer without a cast [-Wint-conversion]
     615 |         return bitmap_from_arr64(dst, mask, 64);
         |                                       ^~~~
         |                                       |
         |                                       u64 {aka long long unsigned int}
   include/linux/bitmap.h:300:58: note: expected 'const u64 *' {aka 'const long long unsigned int *'} but argument is of type 'u64' {aka 'long long unsigned int'}
     300 | void bitmap_from_arr64(unsigned long *bitmap, const u64 *buf, unsigned int nbits);
         |                                               ~~~~~~~~~~~^~~
   lib/bitmap.c: In function 'bitmap_to_arr64':
>> lib/bitmap.c:1570:30: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
    1570 |         unsigned long *end = bitmap + BITS_TO_LONGS(nbits);
         |                              ^~~~~~
   lib/bitmap.c:1575:43: warning: left shift count >= width of type [-Wshift-count-overflow]
    1575 |                         *buf |= *bitmap++ << 32;
         |                                           ^~
--
   In file included from include/linux/cpumask.h:12,
                    from include/linux/smp.h:13,
                    from include/linux/lockdep.h:14,
                    from include/linux/spinlock.h:62,
                    from include/linux/mmzone.h:8,
                    from include/linux/gfp.h:6,
                    from include/linux/radix-tree.h:12,
                    from include/linux/idr.h:15,
                    from lib/test_ida.c:9:
   include/linux/bitmap.h: In function 'bitmap_from_u64':
>> include/linux/bitmap.h:615:39: warning: passing argument 2 of 'bitmap_from_arr64' makes pointer from integer without a cast [-Wint-conversion]
     615 |         return bitmap_from_arr64(dst, mask, 64);
         |                                       ^~~~
         |                                       |
         |                                       u64 {aka long long unsigned int}
   include/linux/bitmap.h:300:58: note: expected 'const u64 *' {aka 'const long long unsigned int *'} but argument is of type 'u64' {aka 'long long unsigned int'}
     300 | void bitmap_from_arr64(unsigned long *bitmap, const u64 *buf, unsigned int nbits);
         |                                               ~~~~~~~~~~~^~~
   lib/test_ida.c: At top level:
   lib/test_ida.c:16:6: warning: no previous prototype for 'ida_dump' [-Wmissing-prototypes]
      16 | void ida_dump(struct ida *ida) { }
         |      ^~~~~~~~
..


vim +/bitmap_from_arr64 +615 include/linux/bitmap.h

   602	
   603	/**
   604	 * bitmap_from_u64 - Check and swap words within u64.
   605	 *  @mask: source bitmap
   606	 *  @dst:  destination bitmap
   607	 *
   608	 * In 32-bit Big Endian kernel, when using ``(u32 *)(&val)[*]``
   609	 * to read u64 mask, we will get the wrong word.
   610	 * That is ``(u32 *)(&val)[0]`` gets the upper 32 bits,
   611	 * but we expect the lower 32-bits of u64.
   612	 */
   613	static inline void bitmap_from_u64(unsigned long *dst, u64 mask)
   614	{
 > 615		return bitmap_from_arr64(dst, mask, 64);
   616	}
   617	

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ