linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [mcgrof-next:20210708-block-fixes-v2 88/89] drivers/block/rbd.c:7076:2: warning: ignoring return value of function declared with 'warn_unused_result' attribute
@ 2021-07-15 14:31 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-07-15 14:31 UTC (permalink / raw)
  To: Luis Chamberlain; +Cc: clang-built-linux, kbuild-all, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 16270 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux-next.git 20210708-block-fixes-v2
head:   db0174e39de7dc941f158ce53ee3af95b1635b62
commit: 5e5cb4297124917e4c9480cef81930ecb092fbb6 [88/89] block: add __must_check for *add_disk*() callers
config: powerpc64-randconfig-r033-20210715 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 0e49c54a8cbd3e779e5526a5888c683c01cc3c50)
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
        # install powerpc64 cross compiling tool for clang build
        # apt-get install binutils-powerpc64-linux-gnu
        # https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux-next.git/commit/?id=5e5cb4297124917e4c9480cef81930ecb092fbb6
        git remote add mcgrof-next https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux-next.git
        git fetch --no-tags mcgrof-next 20210708-block-fixes-v2
        git checkout 5e5cb4297124917e4c9480cef81930ecb092fbb6
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc64 

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

   __do_insw
   ^
   arch/powerpc/include/asm/io.h:557:56: note: expanded from macro '__do_insw'
   #define __do_insw(p, b, n)      readsw((PCI_IO_ADDR)_IO_BASE+(p), (b), (n))
                                          ~~~~~~~~~~~~~~~~~~~~~^
   In file included from drivers/block/rbd.c:31:
   In file included from include/linux/ceph/libceph.h:8:
   In file included from include/linux/backing-dev.h:15:
   In file included from include/linux/blkdev.h:18:
   In file included from include/linux/bio.h:8:
   In file included from include/linux/highmem.h:10:
   In file included from include/linux/hardirq.h:11:
   In file included from arch/powerpc/include/asm/hardirq.h:6:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/powerpc/include/asm/io.h:619:
   arch/powerpc/include/asm/io-defs.h:47:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
   DEF_PCI_AC_NORET(insl, (unsigned long p, void *b, unsigned long c),
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/powerpc/include/asm/io.h:616:3: note: expanded from macro 'DEF_PCI_AC_NORET'
                   __do_##name al;                                 \
                   ^~~~~~~~~~~~~~
   <scratch space>:185:1: note: expanded from here
   __do_insl
   ^
   arch/powerpc/include/asm/io.h:558:56: note: expanded from macro '__do_insl'
   #define __do_insl(p, b, n)      readsl((PCI_IO_ADDR)_IO_BASE+(p), (b), (n))
                                          ~~~~~~~~~~~~~~~~~~~~~^
   In file included from drivers/block/rbd.c:31:
   In file included from include/linux/ceph/libceph.h:8:
   In file included from include/linux/backing-dev.h:15:
   In file included from include/linux/blkdev.h:18:
   In file included from include/linux/bio.h:8:
   In file included from include/linux/highmem.h:10:
   In file included from include/linux/hardirq.h:11:
   In file included from arch/powerpc/include/asm/hardirq.h:6:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/powerpc/include/asm/io.h:619:
   arch/powerpc/include/asm/io-defs.h:49:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
   DEF_PCI_AC_NORET(outsb, (unsigned long p, const void *b, unsigned long c),
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/powerpc/include/asm/io.h:616:3: note: expanded from macro 'DEF_PCI_AC_NORET'
                   __do_##name al;                                 \
                   ^~~~~~~~~~~~~~
   <scratch space>:187:1: note: expanded from here
   __do_outsb
   ^
   arch/powerpc/include/asm/io.h:559:58: note: expanded from macro '__do_outsb'
   #define __do_outsb(p, b, n)     writesb((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
                                           ~~~~~~~~~~~~~~~~~~~~~^
   In file included from drivers/block/rbd.c:31:
   In file included from include/linux/ceph/libceph.h:8:
   In file included from include/linux/backing-dev.h:15:
   In file included from include/linux/blkdev.h:18:
   In file included from include/linux/bio.h:8:
   In file included from include/linux/highmem.h:10:
   In file included from include/linux/hardirq.h:11:
   In file included from arch/powerpc/include/asm/hardirq.h:6:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/powerpc/include/asm/io.h:619:
   arch/powerpc/include/asm/io-defs.h:51:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
   DEF_PCI_AC_NORET(outsw, (unsigned long p, const void *b, unsigned long c),
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/powerpc/include/asm/io.h:616:3: note: expanded from macro 'DEF_PCI_AC_NORET'
                   __do_##name al;                                 \
                   ^~~~~~~~~~~~~~
   <scratch space>:189:1: note: expanded from here
   __do_outsw
   ^
   arch/powerpc/include/asm/io.h:560:58: note: expanded from macro '__do_outsw'
   #define __do_outsw(p, b, n)     writesw((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
                                           ~~~~~~~~~~~~~~~~~~~~~^
   In file included from drivers/block/rbd.c:31:
   In file included from include/linux/ceph/libceph.h:8:
   In file included from include/linux/backing-dev.h:15:
   In file included from include/linux/blkdev.h:18:
   In file included from include/linux/bio.h:8:
   In file included from include/linux/highmem.h:10:
   In file included from include/linux/hardirq.h:11:
   In file included from arch/powerpc/include/asm/hardirq.h:6:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/powerpc/include/asm/io.h:619:
   arch/powerpc/include/asm/io-defs.h:53:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
   DEF_PCI_AC_NORET(outsl, (unsigned long p, const void *b, unsigned long c),
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/powerpc/include/asm/io.h:616:3: note: expanded from macro 'DEF_PCI_AC_NORET'
                   __do_##name al;                                 \
                   ^~~~~~~~~~~~~~
   <scratch space>:191:1: note: expanded from here
   __do_outsl
   ^
   arch/powerpc/include/asm/io.h:561:58: note: expanded from macro '__do_outsl'
   #define __do_outsl(p, b, n)     writesl((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
                                           ~~~~~~~~~~~~~~~~~~~~~^
   drivers/block/rbd.c:6098:17: warning: result of comparison of constant 2305843009213693948 with expression of type 'u32' (aka 'unsigned int') is always false [-Wtautological-constant-out-of-range-compare]
           if (snap_count > (SIZE_MAX - sizeof (struct ceph_snap_context))
               ~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/block/rbd.c:7076:2: warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result]
           device_add_disk(&rbd_dev->dev, rbd_dev->disk, NULL);
           ^~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   14 warnings generated.


vim +/warn_unused_result +7076 drivers/block/rbd.c

83a06263625b82 Alex Elder      2012-10-30  6994  
9b60e70b3b6a8e Ilya Dryomov    2013-12-13  6995  static ssize_t do_rbd_add(struct bus_type *bus,
59c2be1e4d42c0 Yehuda Sadeh    2011-03-21  6996  			  const char *buf,
59c2be1e4d42c0 Yehuda Sadeh    2011-03-21  6997  			  size_t count)
602adf40020163 Yehuda Sadeh    2010-08-12  6998  {
cb8627c76db699 Alex Elder      2012-07-09  6999  	struct rbd_device *rbd_dev = NULL;
dc79b113d6db48 Alex Elder      2012-10-25  7000  	struct ceph_options *ceph_opts = NULL;
4e9afeba7aa9ca Alex Elder      2012-10-25  7001  	struct rbd_options *rbd_opts = NULL;
859c31df9cee9d Alex Elder      2012-10-25  7002  	struct rbd_spec *spec = NULL;
9d3997fdf4c82a Alex Elder      2012-10-25  7003  	struct rbd_client *rbdc;
b51c83c241910f Ilya Dryomov    2015-10-15  7004  	int rc;
602adf40020163 Yehuda Sadeh    2010-08-12  7005  
f44d04e696feaf Ilya Dryomov    2020-09-03  7006  	if (!capable(CAP_SYS_ADMIN))
f44d04e696feaf Ilya Dryomov    2020-09-03  7007  		return -EPERM;
f44d04e696feaf Ilya Dryomov    2020-09-03  7008  
602adf40020163 Yehuda Sadeh    2010-08-12  7009  	if (!try_module_get(THIS_MODULE))
602adf40020163 Yehuda Sadeh    2010-08-12  7010  		return -ENODEV;
602adf40020163 Yehuda Sadeh    2010-08-12  7011  
602adf40020163 Yehuda Sadeh    2010-08-12  7012  	/* parse add command */
859c31df9cee9d Alex Elder      2012-10-25  7013  	rc = rbd_add_parse_args(buf, &ceph_opts, &rbd_opts, &spec);
dc79b113d6db48 Alex Elder      2012-10-25  7014  	if (rc < 0)
dd5ac32d425f88 Ilya Dryomov    2015-10-16  7015  		goto out;
78cea76e0580be Alex Elder      2012-10-25  7016  
9d3997fdf4c82a Alex Elder      2012-10-25  7017  	rbdc = rbd_get_client(ceph_opts);
9d3997fdf4c82a Alex Elder      2012-10-25  7018  	if (IS_ERR(rbdc)) {
9d3997fdf4c82a Alex Elder      2012-10-25  7019  		rc = PTR_ERR(rbdc);
0ddebc0c6c518a Alex Elder      2012-10-25  7020  		goto err_out_args;
9d3997fdf4c82a Alex Elder      2012-10-25  7021  	}
602adf40020163 Yehuda Sadeh    2010-08-12  7022  
602adf40020163 Yehuda Sadeh    2010-08-12  7023  	/* pick the pool */
dd4358550fc524 Ilya Dryomov    2018-02-22  7024  	rc = ceph_pg_poolid_by_name(rbdc->client->osdc.osdmap, spec->pool_name);
1fe480235ad723 Ilya Dryomov    2015-03-05  7025  	if (rc < 0) {
1fe480235ad723 Ilya Dryomov    2015-03-05  7026  		if (rc == -ENOENT)
1fe480235ad723 Ilya Dryomov    2015-03-05  7027  			pr_info("pool %s does not exist\n", spec->pool_name);
602adf40020163 Yehuda Sadeh    2010-08-12  7028  		goto err_out_client;
1fe480235ad723 Ilya Dryomov    2015-03-05  7029  	}
859c31df9cee9d Alex Elder      2012-10-25  7030  	spec->pool_id = (u64)rc;
859c31df9cee9d Alex Elder      2012-10-25  7031  
d147543d7943ea Ilya Dryomov    2015-06-22  7032  	rbd_dev = rbd_dev_create(rbdc, spec, rbd_opts);
b51c83c241910f Ilya Dryomov    2015-10-15  7033  	if (!rbd_dev) {
b51c83c241910f Ilya Dryomov    2015-10-15  7034  		rc = -ENOMEM;
bd4ba6554dcbae Alex Elder      2012-10-25  7035  		goto err_out_client;
b51c83c241910f Ilya Dryomov    2015-10-15  7036  	}
c53d589337e9a2 Alex Elder      2012-10-25  7037  	rbdc = NULL;		/* rbd_dev now owns this */
c53d589337e9a2 Alex Elder      2012-10-25  7038  	spec = NULL;		/* rbd_dev now owns this */
d147543d7943ea Ilya Dryomov    2015-06-22  7039  	rbd_opts = NULL;	/* rbd_dev now owns this */
602adf40020163 Yehuda Sadeh    2010-08-12  7040  
39258aa2db8175 Ilya Dryomov    2019-11-07  7041  	/* if we are mapping a snapshot it will be a read-only mapping */
39258aa2db8175 Ilya Dryomov    2019-11-07  7042  	if (rbd_dev->opts->read_only ||
39258aa2db8175 Ilya Dryomov    2019-11-07  7043  	    strcmp(rbd_dev->spec->snap_name, RBD_SNAP_HEAD_NAME))
39258aa2db8175 Ilya Dryomov    2019-11-07  7044  		__set_bit(RBD_DEV_FLAG_READONLY, &rbd_dev->flags);
39258aa2db8175 Ilya Dryomov    2019-11-07  7045  
0d6d1e9c2e970c Mike Christie   2016-08-18  7046  	rbd_dev->config_info = kstrdup(buf, GFP_KERNEL);
0d6d1e9c2e970c Mike Christie   2016-08-18  7047  	if (!rbd_dev->config_info) {
0d6d1e9c2e970c Mike Christie   2016-08-18  7048  		rc = -ENOMEM;
0d6d1e9c2e970c Mike Christie   2016-08-18  7049  		goto err_out_rbd_dev;
0d6d1e9c2e970c Mike Christie   2016-08-18  7050  	}
0d6d1e9c2e970c Mike Christie   2016-08-18  7051  
6d69bb536bac0d Ilya Dryomov    2015-10-11  7052  	rc = rbd_dev_image_probe(rbd_dev, 0);
0e4e1de5b63fa4 Ilya Dryomov    2020-03-13  7053  	if (rc < 0)
c53d589337e9a2 Alex Elder      2012-10-25  7054  		goto err_out_rbd_dev;
05fd6f6f8c7b07 Alex Elder      2012-08-29  7055  
0c93e1b7a26b41 Ilya Dryomov    2019-01-30  7056  	if (rbd_dev->opts->alloc_size > rbd_dev->layout.object_size) {
0c93e1b7a26b41 Ilya Dryomov    2019-01-30  7057  		rbd_warn(rbd_dev, "alloc_size adjusted to %u",
0c93e1b7a26b41 Ilya Dryomov    2019-01-30  7058  			 rbd_dev->layout.object_size);
0c93e1b7a26b41 Ilya Dryomov    2019-01-30  7059  		rbd_dev->opts->alloc_size = rbd_dev->layout.object_size;
0c93e1b7a26b41 Ilya Dryomov    2019-01-30  7060  	}
0c93e1b7a26b41 Ilya Dryomov    2019-01-30  7061  
b536f69a3a5891 Alex Elder      2013-04-28  7062  	rc = rbd_dev_device_setup(rbd_dev);
fd22aef8b47cfc Ilya Dryomov    2017-04-13  7063  	if (rc)
8b679ec5257eeb Ilya Dryomov    2017-04-13  7064  		goto err_out_image_probe;
3abef3b3585bbc Alex Elder      2013-05-13  7065  
e010dd0ada619e Ilya Dryomov    2017-04-13  7066  	rc = rbd_add_acquire_lock(rbd_dev);
e010dd0ada619e Ilya Dryomov    2017-04-13  7067  	if (rc)
637cd060537d0c Ilya Dryomov    2019-06-06  7068  		goto err_out_image_lock;
3abef3b3585bbc Alex Elder      2013-05-13  7069  
5769ed0cb12dcd Ilya Dryomov    2017-04-13  7070  	/* Everything's ready.  Announce the disk to the world. */
5769ed0cb12dcd Ilya Dryomov    2017-04-13  7071  
5769ed0cb12dcd Ilya Dryomov    2017-04-13  7072  	rc = device_add(&rbd_dev->dev);
5769ed0cb12dcd Ilya Dryomov    2017-04-13  7073  	if (rc)
e010dd0ada619e Ilya Dryomov    2017-04-13  7074  		goto err_out_image_lock;
5769ed0cb12dcd Ilya Dryomov    2017-04-13  7075  
3325322f773bae Hannes Reinecke 2020-01-23 @7076  	device_add_disk(&rbd_dev->dev, rbd_dev->disk, NULL);
5769ed0cb12dcd Ilya Dryomov    2017-04-13  7077  
5769ed0cb12dcd Ilya Dryomov    2017-04-13  7078  	spin_lock(&rbd_dev_list_lock);
5769ed0cb12dcd Ilya Dryomov    2017-04-13  7079  	list_add_tail(&rbd_dev->node, &rbd_dev_list);
5769ed0cb12dcd Ilya Dryomov    2017-04-13  7080  	spin_unlock(&rbd_dev_list_lock);
5769ed0cb12dcd Ilya Dryomov    2017-04-13  7081  
5769ed0cb12dcd Ilya Dryomov    2017-04-13  7082  	pr_info("%s: capacity %llu features 0x%llx\n", rbd_dev->disk->disk_name,
5769ed0cb12dcd Ilya Dryomov    2017-04-13  7083  		(unsigned long long)get_capacity(rbd_dev->disk) << SECTOR_SHIFT,
5769ed0cb12dcd Ilya Dryomov    2017-04-13  7084  		rbd_dev->header.features);
dd5ac32d425f88 Ilya Dryomov    2015-10-16  7085  	rc = count;
dd5ac32d425f88 Ilya Dryomov    2015-10-16  7086  out:
dd5ac32d425f88 Ilya Dryomov    2015-10-16  7087  	module_put(THIS_MODULE);
dd5ac32d425f88 Ilya Dryomov    2015-10-16  7088  	return rc;
b536f69a3a5891 Alex Elder      2013-04-28  7089  
e010dd0ada619e Ilya Dryomov    2017-04-13  7090  err_out_image_lock:
e010dd0ada619e Ilya Dryomov    2017-04-13  7091  	rbd_dev_image_unlock(rbd_dev);
5769ed0cb12dcd Ilya Dryomov    2017-04-13  7092  	rbd_dev_device_release(rbd_dev);
8b679ec5257eeb Ilya Dryomov    2017-04-13  7093  err_out_image_probe:
8b679ec5257eeb Ilya Dryomov    2017-04-13  7094  	rbd_dev_image_release(rbd_dev);
c53d589337e9a2 Alex Elder      2012-10-25  7095  err_out_rbd_dev:
c53d589337e9a2 Alex Elder      2012-10-25  7096  	rbd_dev_destroy(rbd_dev);
bd4ba6554dcbae Alex Elder      2012-10-25  7097  err_out_client:
9d3997fdf4c82a Alex Elder      2012-10-25  7098  	rbd_put_client(rbdc);
0ddebc0c6c518a Alex Elder      2012-10-25  7099  err_out_args:
859c31df9cee9d Alex Elder      2012-10-25  7100  	rbd_spec_put(spec);
d147543d7943ea Ilya Dryomov    2015-06-22  7101  	kfree(rbd_opts);
dd5ac32d425f88 Ilya Dryomov    2015-10-16  7102  	goto out;
602adf40020163 Yehuda Sadeh    2010-08-12  7103  }
602adf40020163 Yehuda Sadeh    2010-08-12  7104  

:::::: The code at line 7076 was first introduced by commit
:::::: 3325322f773bae68b20d8fa0e9e8ebb005271db5 rbd: set the 'device' link in sysfs

:::::: TO: Hannes Reinecke <hare@suse.de>
:::::: CC: Ilya Dryomov <idryomov@gmail.com>

---
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: 32998 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-07-15 14:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-15 14:31 [mcgrof-next:20210708-block-fixes-v2 88/89] drivers/block/rbd.c:7076:2: warning: ignoring return value of function declared with 'warn_unused_result' attribute kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).