From: kernel test robot <lkp@intel.com>
To: Christoph Hellwig <hch@lst.de>
Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org,
linux-kernel@vger.kernel.org, 0day robot <lkp@intel.com>
Subject: 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 *'))
Date: Tue, 16 Nov 2021 05:02:58 +0800 [thread overview]
Message-ID: <202111160549.rod7bw9c-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 3345 bytes --]
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
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 32005 bytes --]
reply other threads:[~2021-11-16 0:09 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202111160549.rod7bw9c-lkp@intel.com \
--to=lkp@intel.com \
--cc=hch@lst.de \
--cc=kbuild-all@lists.01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox