lkml.org 
[lkml]   [2021]   [Nov]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectdrivers/md/bcache/util.c:280:16: warning: comparison of distinct pointer types ('typeof (size) *' (aka 'unsigned int *') and 'typeof (((1UL) << 12) - offset) *' (aka 'unsigned long *'))
tree:   https://github.com/0day-ci/linux/commits/UPDATE-20211105-042601/Coly-Li/bcache-Revert-bcache-use-bvec_virt/20211103-231427
head: d9060ab757bd509ac3746469f23bf3e22a53f8ea
commit: d9060ab757bd509ac3746469f23bf3e22a53f8ea bcache: Revert "bcache: use bvec_virt"
date: 11 days ago
config: i386-randconfig-a005-20211105 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 847a6807332b13f43704327c2d30103ec0347c77)
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/0day-ci/linux/commit/d9060ab757bd509ac3746469f23bf3e22a53f8ea
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review UPDATE-20211105-042601/Coly-Li/bcache-Revert-bcache-use-bvec_virt/20211103-231427
git checkout d9060ab757bd509ac3746469f23bf3e22a53f8ea
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=i386

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 >>):

>> drivers/md/bcache/util.c:280:16: warning: comparison of distinct pointer types ('typeof (size) *' (aka 'unsigned int *') and 'typeof (((1UL) << 12) - offset) *' (aka 'unsigned long *')) [-Wcompare-distinct-pointer-types]
size_t len = min(size, PAGE_SIZE - offset);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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 +280 drivers/md/bcache/util.c

257
258 /**
259 * bch_bio_alloc_pages - allocates a single page for each bvec in a bio
260 * @bio: bio to allocate pages for
261 * @data: if non-NULL copy data from here into the newly allocate pages
262 * @size: size to allocate
263 * @gfp_mask: flags for allocation
264 *
265 * Allocates pages up to @bio->bi_vcnt.
266 *
267 * Returns 0 on success, -ENOMEM on failure. On failure, any allocated pages are
268 * freed.
269 */
270 int bch_bio_alloc_pages(struct bio *bio, void *data, size_t size, gfp_t gfp)
271 {
272 struct bvec_iter iter;
273 struct bio_vec bv;
274
275 BUG_ON(bio->bi_vcnt);
276
277 while (size) {
278 struct page *page = alloc_page(gfp);
279 unsigned int offset = offset_in_page(page);
> 280 size_t len = min(size, PAGE_SIZE - offset);

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[unhandled content-type:application/gzip]
\
 
 \ /
  Last update: 2021-11-16 01:11    [W:0.413 / U:0.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site