[colyli-bcache:nvdimm-meta 16/16] drivers/md/bcache/alloc.c:488:9: warning: argument 1 null where non-null expected

From: kernel test robot
Date: Tue Jul 05 2022 - 13:28:16 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/colyli/linux-bcache.git nvdimm-meta
head: 5c8259ab2129816fc49fd6d060206ba61b0594d1
commit: 5c8259ab2129816fc49fd6d060206ba61b0594d1 [16/16] bcache: support storing bcache btree nodes into NVDIMM meta device
config: parisc-allyesconfig (https://download.01.org/0day-ci/archive/20220706/202207060104.rBjNku9y-lkp@xxxxxxxxx/config)
compiler: hppa-linux-gcc (GCC) 11.3.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=5c8259ab2129816fc49fd6d060206ba61b0594d1
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 5c8259ab2129816fc49fd6d060206ba61b0594d1
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross W=1 O=build_dir ARCH=parisc SHELL=/bin/bash drivers/md/

If you fix the issue, kindly add following tag where applicable
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/alloc.c:66:
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_bucket_free',
inlined from 'bch_bucket_free' at drivers/md/bcache/alloc.c:497:3:
>> drivers/md/bcache/alloc.c:488:9: warning: argument 1 null where non-null expected [-Wnonnull]
488 | memset(bch_nvmpg_offset_to_ptr(nvmpg_offset), 0, 1<<order);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from include/linux/string.h:20,
from include/linux/uuid.h:12,
from include/linux/mod_devicetable.h:13,
from arch/parisc/include/asm/hardware.h:5,
from arch/parisc/include/asm/processor.h:17,
from arch/parisc/include/asm/spinlock.h:7,
from arch/parisc/include/asm/atomic.h:22,
from include/linux/atomic.h:7,
from arch/parisc/include/asm/bitops.h:13,
from include/linux/bitops.h:33,
from include/linux/kernel.h:22,
from arch/parisc/include/asm/bug.h:5,
from include/linux/bug.h:5,
from include/linux/thread_info.h:13,
from include/asm-generic/preempt.h:5,
from ./arch/parisc/include/generated/asm/preempt.h:1,
from include/linux/preempt.h:78,
from include/linux/spinlock.h:55,
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/alloc.c:64:
drivers/md/bcache/alloc.c: In function 'bch_bucket_free':
arch/parisc/include/asm/string.h:6:15: note: in a call to function 'memset' declared 'nonnull'
6 | extern void * memset(void *, int, size_t);
| ^~~~~~
--
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:308:3:
>> drivers/md/bcache/btree.c:295:9: warning: argument 2 null where non-null expected [-Wnonnull]
295 | memcpy(b->keys.set[0].data, ptr, KEY_SIZE(&b->key) << 9);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from include/linux/string.h:20,
from include/linux/uuid.h:12,
from include/linux/mod_devicetable.h:13,
from arch/parisc/include/asm/hardware.h:5,
from arch/parisc/include/asm/processor.h:17,
from arch/parisc/include/asm/spinlock.h:7,
from arch/parisc/include/asm/atomic.h:22,
from include/linux/atomic.h:7,
from arch/parisc/include/asm/bitops.h:13,
from include/linux/bitops.h:33,
from include/linux/kernel.h:22,
from arch/parisc/include/asm/bug.h:5,
from include/linux/bug.h:5,
from include/linux/thread_info.h:13,
from include/asm-generic/preempt.h:5,
from ./arch/parisc/include/generated/asm/preempt.h:1,
from include/linux/preempt.h:78,
from include/linux/spinlock.h:55,
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/parisc/include/asm/string.h:9:8: note: in a call to function 'memcpy' declared 'nonnull'
9 | void * memcpy(void * dest,const void *src,size_t count);
| ^~~~~~


vim +488 drivers/md/bcache/alloc.c

480
481 static void __bch_nvmpg_bucket_free(struct cache_set *c, struct bkey *k)
482 {
483 int order;
484 unsigned long nvmpg_offset;
485
486 order = ilog2(c->cache->sb.bucket_size / PAGE_SECTORS);
487 nvmpg_offset = bkey_offset_to_nvmpg_offset(PTR_OFFSET(k, 0));
> 488 memset(bch_nvmpg_offset_to_ptr(nvmpg_offset), 0, 1<<order);
489 bch_nvmpg_free_pages(nvmpg_offset, order, c->set_uuid);
490 }
491

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