[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202203261918.97wQ7aCy-lkp@intel.com>
Date: Sat, 26 Mar 2022 19:14:39 +0800
From: kernel test robot <lkp@...el.com>
To: Yury Norov <yury.norov@...il.com>
Cc: llvm@...ts.linux.dev, kbuild-all@...ts.01.org,
linux-kernel@...r.kernel.org
Subject: [norov:bitmap 5/49]
drivers/net/ethernet/qlogic/qed/qed_rdma.c:338:11: warning: comparison of
distinct pointer types ('typeof (bmap->max_count - bit) *' (aka 'unsigned
int *') and 'typeof (512UL) *' (aka 'unsigned long *'))
tree: https://github.com/norov/linux bitmap
head: 0bce39e45f86107fcce7f816fe51d73e6f78a3df
commit: 5c602c9efc42ae865431c9d685858e0b8d1665d0 [5/49] qed: rework qed_rdma_bmap_free()
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20220326/202203261918.97wQ7aCy-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 0f6d9501cf49ce02937099350d08f20c4af86f3d)
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/5c602c9efc42ae865431c9d685858e0b8d1665d0
git remote add norov https://github.com/norov/linux
git fetch --no-tags norov bitmap
git checkout 5c602c9efc42ae865431c9d685858e0b8d1665d0
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash arch/x86/kernel/ drivers/net/ethernet/qlogic/qed/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>
All warnings (new ones prefixed by >>):
>> drivers/net/ethernet/qlogic/qed/qed_rdma.c:338:11: warning: comparison of distinct pointer types ('typeof (bmap->max_count - bit) *' (aka 'unsigned int *') and 'typeof (512UL) *' (aka 'unsigned long *')) [-Wcompare-distinct-pointer-types]
nbits = min(bmap->max_count - bit, 512UL);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/minmax.h:45:19: note: expanded from macro 'min'
#define min(x, y) __careful_cmp(x, y, <)
^~~~~~~~~~~~~~~~~~~~~~
include/linux/minmax.h:36:24: note: expanded from macro '__careful_cmp'
__builtin_choose_expr(__safe_cmp(x, y), \
^~~~~~~~~~~~~~~~
include/linux/minmax.h:26:4: note: expanded from macro '__safe_cmp'
(__typecheck(x, y) && __no_side_effects(x, y))
^~~~~~~~~~~~~~~~~
include/linux/minmax.h:20:28: note: expanded from macro '__typecheck'
(!!(sizeof((typeof(x) *)1 == (typeof(y) *)1)))
~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~
1 warning generated.
vim +338 drivers/net/ethernet/qlogic/qed/qed_rdma.c
318
319 void qed_rdma_bmap_free(struct qed_hwfn *p_hwfn,
320 struct qed_bmap *bmap, bool check)
321 {
322 unsigned int bit, weight, nbits;
323 unsigned long *b;
324
325 if (!check)
326 goto end;
327
328 weight = bitmap_weight(bmap->bitmap, bmap->max_count);
329 if (!weight)
330 goto end;
331
332 DP_NOTICE(p_hwfn,
333 "%s bitmap not free - size=%d, weight=%d, 512 bits per line\n",
334 bmap->name, bmap->max_count, weight);
335
336 for (bit = 0; bit < bmap->max_count; bit += 512) {
337 b = bmap->bitmap + BITS_TO_LONGS(bit);
> 338 nbits = min(bmap->max_count - bit, 512UL);
339
340 if (!bitmap_empty(b, nbits))
341 DP_NOTICE(p_hwfn,
342 "line 0x%04x: %*pb\n", bit / 512, nbits, b);
343 }
344
345 end:
346 kfree(bmap->bitmap);
347 bmap->bitmap = NULL;
348 }
349
--
0-DAY CI Kernel Test Service
https://01.org/lkp
Powered by blists - more mailing lists