[colyli-bcache:nvdimm-meta 23/23] drivers/md/bcache/btree.c:287:9: warning: argument 2 null where non-null expected
From: kernel test robot
Date: Fri Oct 29 2021 - 05:55:59 EST
tree: https://git.kernel.org/pub/scm/linux/kernel/git/colyli/linux-bcache.git nvdimm-meta
head: 544e57301b9adc7628556f4b709f65c35142df47
commit: 544e57301b9adc7628556f4b709f65c35142df47 [23/23] bcache: store btree nodes on nvdimm
config: ia64-randconfig-r002-20211028 (attached as .config)
compiler: ia64-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://git.kernel.org/pub/scm/linux/kernel/git/colyli/linux-bcache.git/commit/?id=544e57301b9adc7628556f4b709f65c35142df47
git remote add colyli-bcache https://git.kernel.org/pub/scm/linux/kernel/git/colyli/linux-bcache.git
git fetch --no-tags colyli-bcache nvdimm-meta
git checkout 544e57301b9adc7628556f4b709f65c35142df47
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=ia64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>
All warnings (new ones prefixed by >>):
In file included from drivers/md/bcache/nvmpg.h:8,
from drivers/md/bcache/btree.c:29:
drivers/md/bcache/nvmpg_format.h:132:19: warning: 'bch_nvmpg_recs_magic' defined but not used [-Wunused-const-variable=]
132 | static const __u8 bch_nvmpg_recs_magic[] = {
| ^~~~~~~~~~~~~~~~~~~~
drivers/md/bcache/nvmpg_format.h:129:19: warning: 'bch_nvmpg_magic' defined but not used [-Wunused-const-variable=]
129 | static const __u8 bch_nvmpg_magic[] = {
| ^~~~~~~~~~~~~~~
In function '__bch_nvmpg_btree_node_read',
inlined from 'bch_btree_node_read' at drivers/md/bcache/btree.c:307:3:
>> drivers/md/bcache/btree.c:287:9: warning: argument 2 null where non-null expected [-Wnonnull]
287 | memcpy(b->keys.set[0].data, ptr, KEY_SIZE(&b->key) << 9);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from include/linux/string.h:20,
from include/linux/bitmap.h:10,
from include/linux/cpumask.h:12,
from include/linux/smp.h:13,
from include/linux/lockdep.h:14,
from include/linux/spinlock.h:63,
from include/linux/wait.h:9,
from include/linux/mempool.h:8,
from include/linux/bio.h:8,
from drivers/md/bcache/bcache.h:181,
from drivers/md/bcache/btree.c:24:
drivers/md/bcache/btree.c: In function 'bch_btree_node_read':
arch/ia64/include/asm/string.h:19:14: note: in a call to function 'memcpy' declared 'nonnull'
19 | extern void *memcpy (void *, const void *, __kernel_size_t);
| ^~~~~~
In file included from include/linux/bitmap.h:10,
from include/linux/cpumask.h:12,
from include/linux/smp.h:13,
from include/linux/lockdep.h:14,
from include/linux/spinlock.h:63,
from include/linux/wait.h:9,
from include/linux/mempool.h:8,
from include/linux/bio.h:8,
from drivers/md/bcache/bcache.h:181,
from drivers/md/bcache/btree.c:24:
In function 'memcpy_flushcache',
inlined from '__do_nvmpg_btree_node_write' at drivers/md/bcache/btree.c:475:2,
inlined from 'do_btree_node_write' at drivers/md/bcache/btree.c:491:3,
inlined from '__bch_btree_node_write' at drivers/md/bcache/btree.c:517:2:
>> include/linux/string.h:167:9: warning: argument 1 null where non-null expected [-Wnonnull]
167 | memcpy(dst, src, cnt);
| ^~~~~~~~~~~~~~~~~~~~~
In file included from include/linux/string.h:20,
from include/linux/bitmap.h:10,
from include/linux/cpumask.h:12,
from include/linux/smp.h:13,
from include/linux/lockdep.h:14,
from include/linux/spinlock.h:63,
from include/linux/wait.h:9,
from include/linux/mempool.h:8,
from include/linux/bio.h:8,
from drivers/md/bcache/bcache.h:181,
from drivers/md/bcache/btree.c:24:
drivers/md/bcache/btree.c: In function '__bch_btree_node_write':
arch/ia64/include/asm/string.h:19:14: note: in a call to function 'memcpy' declared 'nonnull'
19 | extern void *memcpy (void *, const void *, __kernel_size_t);
| ^~~~~~
vim +287 drivers/md/bcache/btree.c
280
281 static void __bch_nvmpg_btree_node_read(struct btree *b)
282 {
283 uint64_t start_time = local_clock();
284 void *ptr;
285
286 ptr = bkey_offset_to_nvmpg_ptr(PTR_OFFSET(&b->key, 0));
> 287 memcpy(b->keys.set[0].data, ptr, KEY_SIZE(&b->key) << 9);
288
289 if (btree_node_io_error(b))
290 goto err;
291
292 bch_btree_node_read_done(b);
293 bch_time_stats_update(&b->c->btree_read_time, start_time);
294
295 err:
296 bch_cache_set_error(b->c,
297 "io error reading NVDIMM pages at 0x%p\n", ptr);
298 }
299
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx
Attachment:
.config.gz
Description: application/gzip