[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
by kernel test robot
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/com...
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(a)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(a)suse.de>
:::::: CC: Ilya Dryomov <idryomov(a)gmail.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 2 months
[mcgrof-next:20210708-block-fixes-v2 88/89] drivers/md/dm.c:1795:2: warning: ignoring return value of function declared with 'warn_unused_result' attribute
by kernel test robot
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: powerpc-randconfig-r005-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 powerpc cross compiling tool for clang build
# apt-get install binutils-powerpc-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux-next.git/com...
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=powerpc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> drivers/md/dm.c:1795:2: warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result]
add_disk_no_queue_reg(md->disk);
^~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~
1 warning generated.
vim +/warn_unused_result +1795 drivers/md/dm.c
0f20972f7bf692 Mike Snitzer 2015-04-28 1715
^1da177e4c3f41 Linus Torvalds 2005-04-16 1716 /*
^1da177e4c3f41 Linus Torvalds 2005-04-16 1717 * Allocate and initialise a blank device with a given minor.
^1da177e4c3f41 Linus Torvalds 2005-04-16 1718 */
2b06cfff12f0f8 Alasdair G Kergon 2006-06-26 1719 static struct mapped_device *alloc_dev(int minor)
^1da177e4c3f41 Linus Torvalds 2005-04-16 1720 {
115485e83f497f Mike Snitzer 2016-02-22 1721 int r, numa_node_id = dm_get_numa_node();
115485e83f497f Mike Snitzer 2016-02-22 1722 struct mapped_device *md;
ba61fdd17d73dd Jeff Mahoney 2006-06-26 1723 void *old_md;
^1da177e4c3f41 Linus Torvalds 2005-04-16 1724
856eb0916d181d Mikulas Patocka 2017-10-31 1725 md = kvzalloc_node(sizeof(*md), GFP_KERNEL, numa_node_id);
^1da177e4c3f41 Linus Torvalds 2005-04-16 1726 if (!md) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 1727 DMWARN("unable to allocate device, out of memory.");
^1da177e4c3f41 Linus Torvalds 2005-04-16 1728 return NULL;
^1da177e4c3f41 Linus Torvalds 2005-04-16 1729 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 1730
10da4f795f965f Jeff Mahoney 2006-06-26 1731 if (!try_module_get(THIS_MODULE))
6ed7ade89657e7 Milan Broz 2008-02-08 1732 goto bad_module_get;
10da4f795f965f Jeff Mahoney 2006-06-26 1733
^1da177e4c3f41 Linus Torvalds 2005-04-16 1734 /* get a minor number for the dev */
2b06cfff12f0f8 Alasdair G Kergon 2006-06-26 1735 if (minor == DM_ANY_MINOR)
cf13ab8e02d452 Frederik Deweerdt 2008-04-24 1736 r = next_free_minor(&minor);
2b06cfff12f0f8 Alasdair G Kergon 2006-06-26 1737 else
cf13ab8e02d452 Frederik Deweerdt 2008-04-24 1738 r = specific_minor(minor);
^1da177e4c3f41 Linus Torvalds 2005-04-16 1739 if (r < 0)
6ed7ade89657e7 Milan Broz 2008-02-08 1740 goto bad_minor;
^1da177e4c3f41 Linus Torvalds 2005-04-16 1741
83d5e5b0af907d Mikulas Patocka 2013-07-10 1742 r = init_srcu_struct(&md->io_barrier);
83d5e5b0af907d Mikulas Patocka 2013-07-10 1743 if (r < 0)
83d5e5b0af907d Mikulas Patocka 2013-07-10 1744 goto bad_io_barrier;
83d5e5b0af907d Mikulas Patocka 2013-07-10 1745
115485e83f497f Mike Snitzer 2016-02-22 1746 md->numa_node_id = numa_node_id;
591ddcfc4bfad2 Mike Snitzer 2016-01-31 1747 md->init_tio_pdu = false;
a5664dad7e1a27 Mike Snitzer 2010-08-12 1748 md->type = DM_TYPE_NONE;
e61290a4a23c3f Daniel Walker 2008-02-08 1749 mutex_init(&md->suspend_lock);
a5664dad7e1a27 Mike Snitzer 2010-08-12 1750 mutex_init(&md->type_lock);
86f1152b117a40 Benjamin Marzinski 2014-08-13 1751 mutex_init(&md->table_devices_lock);
022c261100e156 Mikulas Patocka 2009-04-02 1752 spin_lock_init(&md->deferred_lock);
^1da177e4c3f41 Linus Torvalds 2005-04-16 1753 atomic_set(&md->holders, 1);
5c6bd75d06db51 Alasdair G Kergon 2006-06-26 1754 atomic_set(&md->open_count, 0);
^1da177e4c3f41 Linus Torvalds 2005-04-16 1755 atomic_set(&md->event_nr, 0);
7a8c3d3b928837 Mike Anderson 2007-10-19 1756 atomic_set(&md->uevent_seq, 0);
7a8c3d3b928837 Mike Anderson 2007-10-19 1757 INIT_LIST_HEAD(&md->uevent_list);
86f1152b117a40 Benjamin Marzinski 2014-08-13 1758 INIT_LIST_HEAD(&md->table_devices);
7a8c3d3b928837 Mike Anderson 2007-10-19 1759 spin_lock_init(&md->uevent_lock);
^1da177e4c3f41 Linus Torvalds 2005-04-16 1760
47ace7e012b9f7 Mike Snitzer 2020-01-27 1761 /*
c62b37d96b6eb3 Christoph Hellwig 2020-07-01 1762 * default to bio-based until DM table is loaded and md->type
c62b37d96b6eb3 Christoph Hellwig 2020-07-01 1763 * established. If request-based table is loaded: blk-mq will
c62b37d96b6eb3 Christoph Hellwig 2020-07-01 1764 * override accordingly.
47ace7e012b9f7 Mike Snitzer 2020-01-27 1765 */
74fe6ba9239497 Christoph Hellwig 2021-05-21 1766 md->disk = blk_alloc_disk(md->numa_node_id);
^1da177e4c3f41 Linus Torvalds 2005-04-16 1767 if (!md->disk)
0f20972f7bf692 Mike Snitzer 2015-04-28 1768 goto bad;
74fe6ba9239497 Christoph Hellwig 2021-05-21 1769 md->queue = md->disk->queue;
^1da177e4c3f41 Linus Torvalds 2005-04-16 1770
f0b04115368ff3 Jeff Mahoney 2006-06-26 1771 init_waitqueue_head(&md->wait);
53d5914f288b67 Mikulas Patocka 2009-04-02 1772 INIT_WORK(&md->work, dm_wq_work);
f0b04115368ff3 Jeff Mahoney 2006-06-26 1773 init_waitqueue_head(&md->eventq);
2995fa78e423d7 Mikulas Patocka 2014-01-13 1774 init_completion(&md->kobj_holder.completion);
f0b04115368ff3 Jeff Mahoney 2006-06-26 1775
a666e5c05e7c4a Mikulas Patocka 2021-02-10 1776 md->swap_bios = get_swap_bios();
a666e5c05e7c4a Mikulas Patocka 2021-02-10 1777 sema_init(&md->swap_bios_semaphore, md->swap_bios);
a666e5c05e7c4a Mikulas Patocka 2021-02-10 1778 mutex_init(&md->swap_bios_lock);
a666e5c05e7c4a Mikulas Patocka 2021-02-10 1779
^1da177e4c3f41 Linus Torvalds 2005-04-16 1780 md->disk->major = _major;
^1da177e4c3f41 Linus Torvalds 2005-04-16 1781 md->disk->first_minor = minor;
74fe6ba9239497 Christoph Hellwig 2021-05-21 1782 md->disk->minors = 1;
^1da177e4c3f41 Linus Torvalds 2005-04-16 1783 md->disk->fops = &dm_blk_dops;
^1da177e4c3f41 Linus Torvalds 2005-04-16 1784 md->disk->queue = md->queue;
^1da177e4c3f41 Linus Torvalds 2005-04-16 1785 md->disk->private_data = md;
^1da177e4c3f41 Linus Torvalds 2005-04-16 1786 sprintf(md->disk->disk_name, "dm-%d", minor);
f26c5719b2d7b0 Dan Williams 2017-04-12 1787
976431b02c2ef9 Dan Williams 2018-03-29 1788 if (IS_ENABLED(CONFIG_DAX_DRIVER)) {
fefc1d97fa4b5e Pankaj Gupta 2019-07-05 1789 md->dax_dev = alloc_dax(md, md->disk->disk_name,
fefc1d97fa4b5e Pankaj Gupta 2019-07-05 1790 &dm_dax_ops, 0);
4e4ced93794acb Vivek Goyal 2020-04-01 1791 if (IS_ERR(md->dax_dev))
f26c5719b2d7b0 Dan Williams 2017-04-12 1792 goto bad;
976431b02c2ef9 Dan Williams 2018-03-29 1793 }
f26c5719b2d7b0 Dan Williams 2017-04-12 1794
c100ec49fdd222 Mike Snitzer 2018-01-08 @1795 add_disk_no_queue_reg(md->disk);
7e51f257e87297 Mike Anderson 2006-03-27 1796 format_dev_t(md->name, MKDEV(_major, minor));
^1da177e4c3f41 Linus Torvalds 2005-04-16 1797
670368a8ddc5df Tejun Heo 2013-07-30 1798 md->wq = alloc_workqueue("kdmflush", WQ_MEM_RECLAIM, 0);
304f3f6a583013 Milan Broz 2008-02-08 1799 if (!md->wq)
0f20972f7bf692 Mike Snitzer 2015-04-28 1800 goto bad;
304f3f6a583013 Milan Broz 2008-02-08 1801
fd2ed4d252701d Mikulas Patocka 2013-08-16 1802 dm_stats_init(&md->stats);
fd2ed4d252701d Mikulas Patocka 2013-08-16 1803
ba61fdd17d73dd Jeff Mahoney 2006-06-26 1804 /* Populate the mapping, nobody knows we exist yet */
f32c10b09940cf Jeff Mahoney 2006-06-26 1805 spin_lock(&_minor_lock);
ba61fdd17d73dd Jeff Mahoney 2006-06-26 1806 old_md = idr_replace(&_minor_idr, md, minor);
f32c10b09940cf Jeff Mahoney 2006-06-26 1807 spin_unlock(&_minor_lock);
ba61fdd17d73dd Jeff Mahoney 2006-06-26 1808
ba61fdd17d73dd Jeff Mahoney 2006-06-26 1809 BUG_ON(old_md != MINOR_ALLOCED);
ba61fdd17d73dd Jeff Mahoney 2006-06-26 1810
^1da177e4c3f41 Linus Torvalds 2005-04-16 1811 return md;
^1da177e4c3f41 Linus Torvalds 2005-04-16 1812
0f20972f7bf692 Mike Snitzer 2015-04-28 1813 bad:
0f20972f7bf692 Mike Snitzer 2015-04-28 1814 cleanup_mapped_device(md);
83d5e5b0af907d Mikulas Patocka 2013-07-10 1815 bad_io_barrier:
^1da177e4c3f41 Linus Torvalds 2005-04-16 1816 free_minor(minor);
6ed7ade89657e7 Milan Broz 2008-02-08 1817 bad_minor:
10da4f795f965f Jeff Mahoney 2006-06-26 1818 module_put(THIS_MODULE);
6ed7ade89657e7 Milan Broz 2008-02-08 1819 bad_module_get:
856eb0916d181d Mikulas Patocka 2017-10-31 1820 kvfree(md);
^1da177e4c3f41 Linus Torvalds 2005-04-16 1821 return NULL;
^1da177e4c3f41 Linus Torvalds 2005-04-16 1822 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 1823
:::::: The code at line 1795 was first introduced by commit
:::::: c100ec49fdd2222836ff8a17c7bfcc7611d2ee2b dm: fix incomplete request_queue initialization
:::::: TO: Mike Snitzer <snitzer(a)redhat.com>
:::::: CC: Jens Axboe <axboe(a)kernel.dk>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 2 months
[mcgrof-next:20210708-block-fixes-v2 30/89] drivers/block/paride/pcd.c:1039:5: error: label 'pcd_cleanup_disks' used but not defined
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux-next.git 20210708-block-fixes-v2
head: db0174e39de7dc941f158ce53ee3af95b1635b62
commit: 9269ac480e815943f78054c276117d8300d92854 [30/89] paride/pcd: capture errors on cdrom_register()
config: arm-randconfig-r003-20210715 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 10.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/mcgrof/linux-next.git/com...
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 9269ac480e815943f78054c276117d8300d92854
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross O=build_dir ARCH=arm SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
drivers/block/paride/pcd.c: In function 'pcd_init':
>> drivers/block/paride/pcd.c:1039:5: error: label 'pcd_cleanup_disks' used but not defined
1039 | goto pcd_cleanup_disks;
| ^~~~
vim +/pcd_cleanup_disks +1039 drivers/block/paride/pcd.c
1013
1014 static int __init pcd_init(void)
1015 {
1016 struct pcd_unit *cd;
1017 int unit;
1018 int err;
1019
1020 if (disable)
1021 return -EINVAL;
1022
1023 pcd_init_units();
1024
1025 if (pcd_detect())
1026 return -ENODEV;
1027
1028 /* get the atapi capabilities page */
1029 pcd_probe_capabilities();
1030
1031 err = register_blkdev(major, name);
1032 if (err)
1033 goto out_cleanup_disk;
1034
1035 for (unit = 0, cd = pcd; unit < PCD_UNITS; unit++, cd++) {
1036 if (cd->present) {
1037 err = register_cdrom(cd->disk, &cd->info);
1038 if (err)
> 1039 goto pcd_cleanup_disks;
1040 cd->disk->private_data = cd;
1041 err = add_disk(cd->disk);
1042 if (err)
1043 goto out_cleanup_disk;
1044 }
1045 }
1046
1047 return 0;
1048
1049 out_cleanup_disk:
1050 pcd_cleanup_disks();
1051 return err;
1052 }
1053
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 2 months
[mcgrof-next:20210708-block-fixes-v2 55/89] drivers/nvdimm/blk.c:271:2: error: use of undeclared identifier 'rc'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux-next.git 20210708-block-fixes-v2
head: db0174e39de7dc941f158ce53ee3af95b1635b62
commit: 32410056e36f4457d51df601c9a6ebc24b564652 [55/89] nvdimm/blk: add error handling support for add_disk()
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/com...
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 32410056e36f4457d51df601c9a6ebc24b564652
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross O=build_dir ARCH=powerpc SHELL=/bin/bash drivers/block/ drivers/nvdimm/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
In file included from arch/powerpc/include/asm/io.h:619:
arch/powerpc/include/asm/io-defs.h:45:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
DEF_PCI_AC_NORET(insw, (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>:184:1: note: expanded from here
__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/nvdimm/blk.c:7:
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>:186: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/nvdimm/blk.c:7:
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>:188: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/nvdimm/blk.c:7:
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>:190: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/nvdimm/blk.c:7:
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>:192: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/nvdimm/blk.c:233:10: error: member reference base type 'void' is not a structure or union
if (disk->flags & GENHD_FL_UP)
~~~~^ ~~~~~
>> drivers/nvdimm/blk.c:271:2: error: use of undeclared identifier 'rc'
rc = device_add_disk(dev, disk, NULL);
^
drivers/nvdimm/blk.c:272:6: error: use of undeclared identifier 'rc'
if (rc)
^
drivers/nvdimm/blk.c:273:10: error: use of undeclared identifier 'rc'
return rc;
^
12 warnings and 4 errors generated.
vim +/rc +271 drivers/nvdimm/blk.c
237
238 static int nsblk_attach_disk(struct nd_namespace_blk *nsblk)
239 {
240 struct device *dev = &nsblk->common.dev;
241 resource_size_t available_disk_size;
242 struct gendisk *disk;
243 u64 internal_nlba;
244
245 internal_nlba = div_u64(nsblk->size, nsblk_internal_lbasize(nsblk));
246 available_disk_size = internal_nlba * nsblk_sector_size(nsblk);
247
248 disk = blk_alloc_disk(NUMA_NO_NODE);
249 if (!disk)
250 return -ENOMEM;
251
252 disk->fops = &nd_blk_fops;
253 disk->private_data = nsblk;
254 nvdimm_namespace_disk_name(&nsblk->common, disk->disk_name);
255
256 blk_queue_max_hw_sectors(disk->queue, UINT_MAX);
257 blk_queue_logical_block_size(disk->queue, nsblk_sector_size(nsblk));
258 blk_queue_flag_set(QUEUE_FLAG_NONROT, disk->queue);
259
260 if (devm_add_action_or_reset(dev, nd_blk_release_disk, disk))
261 return -ENOMEM;
262
263 if (nsblk_meta_size(nsblk)) {
264 int rc = nd_integrity_init(disk, nsblk_meta_size(nsblk));
265
266 if (rc)
267 return rc;
268 }
269
270 set_capacity(disk, available_disk_size >> SECTOR_SHIFT);
> 271 rc = device_add_disk(dev, disk, NULL);
272 if (rc)
273 return rc;
274 nvdimm_check_and_set_ro(disk);
275 return 0;
276 }
277
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 2 months
[mcgrof-next:20210708-block-fixes-v2 61/89] drivers/md/md.c:9592:42: error: incompatible function pointer types passing 'void (dev_t)' (aka 'void (unsigned int)') to parameter of type 'int (*)(dev_t)' (aka 'int (*)(unsigned int)')
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux-next.git 20210708-block-fixes-v2
head: db0174e39de7dc941f158ce53ee3af95b1635b62
commit: b253de076cda99b4968dd20b1a9702de24376152 [61/89] block: make __register_blkdev() return an error
config: powerpc-randconfig-r005-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 powerpc cross compiling tool for clang build
# apt-get install binutils-powerpc-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux-next.git/com...
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 b253de076cda99b4968dd20b1a9702de24376152
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All error/warnings (new ones prefixed by >>):
>> drivers/block/floppy.c:4532:7: warning: variable 'err' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
if (floppy_alloc_disk(drive, type) == 0) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/block/floppy.c:4540:9: note: uninitialized use occurs here
return err;
^~~
drivers/block/floppy.c:4532:3: note: remove the 'if' if its condition is always true
if (floppy_alloc_disk(drive, type) == 0) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/block/floppy.c:4531:6: warning: variable 'err' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
if (!disks[drive][type]) {
^~~~~~~~~~~~~~~~~~~
drivers/block/floppy.c:4540:9: note: uninitialized use occurs here
return err;
^~~
drivers/block/floppy.c:4531:2: note: remove the 'if' if its condition is always true
if (!disks[drive][type]) {
^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/block/floppy.c:4524:9: note: initialize the variable 'err' to silence this warning
int err;
^
= 0
2 warnings generated.
--
>> drivers/md/md.c:9592:42: error: incompatible function pointer types passing 'void (dev_t)' (aka 'void (unsigned int)') to parameter of type 'int (*)(dev_t)' (aka 'int (*)(unsigned int)') [-Werror,-Wincompatible-function-pointer-types]
ret = __register_blkdev(MD_MAJOR, "md", md_probe);
^~~~~~~~
include/linux/genhd.h:315:9: note: passing argument to parameter 'probe' here
int (*probe)(dev_t devt));
^
drivers/md/md.c:9596:36: error: incompatible function pointer types passing 'void (dev_t)' (aka 'void (unsigned int)') to parameter of type 'int (*)(dev_t)' (aka 'int (*)(unsigned int)') [-Werror,-Wincompatible-function-pointer-types]
ret = __register_blkdev(0, "mdp", md_probe);
^~~~~~~~
include/linux/genhd.h:315:9: note: passing argument to parameter 'probe' here
int (*probe)(dev_t devt));
^
2 errors generated.
vim +9592 drivers/md/md.c
^1da177e4c3f41 Linus Torvalds 2005-04-16 9575
75c96f85845a67 Adrian Bunk 2005-05-05 9576 static int __init md_init(void)
^1da177e4c3f41 Linus Torvalds 2005-04-16 9577 {
e804ac780e2f01 Tejun Heo 2010-10-15 9578 int ret = -ENOMEM;
e804ac780e2f01 Tejun Heo 2010-10-15 9579
ada609ee2ac2e0 Tejun Heo 2011-01-25 9580 md_wq = alloc_workqueue("md", WQ_MEM_RECLAIM, 0);
e804ac780e2f01 Tejun Heo 2010-10-15 9581 if (!md_wq)
e804ac780e2f01 Tejun Heo 2010-10-15 9582 goto err_wq;
e804ac780e2f01 Tejun Heo 2010-10-15 9583
e804ac780e2f01 Tejun Heo 2010-10-15 9584 md_misc_wq = alloc_workqueue("md_misc", 0, 0);
e804ac780e2f01 Tejun Heo 2010-10-15 9585 if (!md_misc_wq)
e804ac780e2f01 Tejun Heo 2010-10-15 9586 goto err_misc_wq;
e804ac780e2f01 Tejun Heo 2010-10-15 9587
cc1ffe61c026e2 Guoqing Jiang 2020-04-04 9588 md_rdev_misc_wq = alloc_workqueue("md_rdev_misc", 0, 0);
cf0b9b4821a295 Guoqing Jiang 2020-10-08 9589 if (!md_rdev_misc_wq)
cc1ffe61c026e2 Guoqing Jiang 2020-04-04 9590 goto err_rdev_misc_wq;
cc1ffe61c026e2 Guoqing Jiang 2020-04-04 9591
28144f9998e047 Christoph Hellwig 2020-10-29 @9592 ret = __register_blkdev(MD_MAJOR, "md", md_probe);
28144f9998e047 Christoph Hellwig 2020-10-29 9593 if (ret < 0)
e804ac780e2f01 Tejun Heo 2010-10-15 9594 goto err_md;
e804ac780e2f01 Tejun Heo 2010-10-15 9595
28144f9998e047 Christoph Hellwig 2020-10-29 9596 ret = __register_blkdev(0, "mdp", md_probe);
28144f9998e047 Christoph Hellwig 2020-10-29 9597 if (ret < 0)
e804ac780e2f01 Tejun Heo 2010-10-15 9598 goto err_mdp;
e804ac780e2f01 Tejun Heo 2010-10-15 9599 mdp_major = ret;
e804ac780e2f01 Tejun Heo 2010-10-15 9600
^1da177e4c3f41 Linus Torvalds 2005-04-16 9601 register_reboot_notifier(&md_notifier);
0b4d414714f0d2 Eric W. Biederman 2007-02-14 9602 raid_table_header = register_sysctl_table(raid_root_table);
^1da177e4c3f41 Linus Torvalds 2005-04-16 9603
^1da177e4c3f41 Linus Torvalds 2005-04-16 9604 md_geninit();
d710e138126000 NeilBrown 2008-10-13 9605 return 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16 9606
e804ac780e2f01 Tejun Heo 2010-10-15 9607 err_mdp:
e804ac780e2f01 Tejun Heo 2010-10-15 9608 unregister_blkdev(MD_MAJOR, "md");
e804ac780e2f01 Tejun Heo 2010-10-15 9609 err_md:
cc1ffe61c026e2 Guoqing Jiang 2020-04-04 9610 destroy_workqueue(md_rdev_misc_wq);
cc1ffe61c026e2 Guoqing Jiang 2020-04-04 9611 err_rdev_misc_wq:
e804ac780e2f01 Tejun Heo 2010-10-15 9612 destroy_workqueue(md_misc_wq);
e804ac780e2f01 Tejun Heo 2010-10-15 9613 err_misc_wq:
e804ac780e2f01 Tejun Heo 2010-10-15 9614 destroy_workqueue(md_wq);
e804ac780e2f01 Tejun Heo 2010-10-15 9615 err_wq:
e804ac780e2f01 Tejun Heo 2010-10-15 9616 return ret;
e804ac780e2f01 Tejun Heo 2010-10-15 9617 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 9618
:::::: The code at line 9592 was first introduced by commit
:::::: 28144f9998e047a9bac31421914335c6bc6eaa67 md: use __register_blkdev to allocate devices on demand
:::::: TO: Christoph Hellwig <hch(a)lst.de>
:::::: CC: Jens Axboe <axboe(a)kernel.dk>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 2 months
[iwlwifi-next:iwlmei 2/6] drivers/net/wireless/intel/iwlwifi/mei/main.c:972:5: warning: format '%ld' expects argument of type 'long int', but argument 3 has type 'ssize_t' {aka 'int'}
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next.git iwlmei
head: aad614fbd0f4eee40f731cff93b5366b1f3153f3
commit: 056acc96d6063163ecad5fc458caa92afd647512 [2/6] iwlwifi: mei: add the driver to allow cooperation with CSME
config: i386-allyesconfig (attached as .config)
compiler: gcc-10 (Ubuntu 10.3.0-1ubuntu1~20.04) 10.3.0
reproduce (this is a W=1 build):
# https://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next.git/...
git remote add iwlwifi-next https://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next.git
git fetch --no-tags iwlwifi-next iwlmei
git checkout 056acc96d6063163ecad5fc458caa92afd647512
# save the attached .config to linux build tree
make W=1 ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
In file included from include/linux/device.h:15,
from include/linux/dma-mapping.h:7,
from include/linux/skbuff.h:31,
from include/linux/if_ether.h:19,
from include/linux/etherdevice.h:20,
from drivers/net/wireless/intel/iwlwifi/mei/main.c:6:
drivers/net/wireless/intel/iwlwifi/mei/main.c: In function 'iwl_mei_handle_sap_data':
>> drivers/net/wireless/intel/iwlwifi/mei/main.c:972:5: warning: format '%ld' expects argument of type 'long int', but argument 3 has type 'ssize_t' {aka 'int'} [-Wformat=]
972 | "Data queue is corrupted: valid data len %ld, len %d\n",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:19:22: note: in definition of macro 'dev_fmt'
19 | #define dev_fmt(fmt) fmt
| ^~~
drivers/net/wireless/intel/iwlwifi/mei/main.c:971:4: note: in expansion of macro 'dev_err'
971 | dev_err(&cldev->dev,
| ^~~~~~~
drivers/net/wireless/intel/iwlwifi/mei/main.c:972:48: note: format string is defined here
972 | "Data queue is corrupted: valid data len %ld, len %d\n",
| ~~^
| |
| long int
| %d
In file included from include/linux/device.h:15,
from include/linux/dma-mapping.h:7,
from include/linux/skbuff.h:31,
from include/linux/if_ether.h:19,
from include/linux/etherdevice.h:20,
from drivers/net/wireless/intel/iwlwifi/mei/main.c:6:
drivers/net/wireless/intel/iwlwifi/mei/main.c: In function 'iwl_mei_rx':
drivers/net/wireless/intel/iwlwifi/mei/main.c:1160:24: warning: format '%ld' expects argument of type 'long int', but argument 3 has type 'ssize_t' {aka 'int'} [-Wformat=]
1160 | dev_err(&cldev->dev, "failed to receive data: %ld\n", ret);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:19:22: note: in definition of macro 'dev_fmt'
19 | #define dev_fmt(fmt) fmt
| ^~~
drivers/net/wireless/intel/iwlwifi/mei/main.c:1160:3: note: in expansion of macro 'dev_err'
1160 | dev_err(&cldev->dev, "failed to receive data: %ld\n", ret);
| ^~~~~~~
drivers/net/wireless/intel/iwlwifi/mei/main.c:1160:51: note: format string is defined here
1160 | dev_err(&cldev->dev, "failed to receive data: %ld\n", ret);
| ~~^
| |
| long int
| %d
vim +972 drivers/net/wireless/intel/iwlwifi/mei/main.c
946
947 static void iwl_mei_handle_sap_data(struct mei_cl_device *cldev,
948 const u8 *q_head, u32 q_sz,
949 u32 rd, u32 wr, ssize_t valid_rx_sz,
950 struct sk_buff_head *tx_skbs)
951 {
952 struct iwl_sap_hdr hdr;
953 struct net_device *netdev =
954 rcu_dereference_protected(iwl_mei_cache.netdev,
955 lockdep_is_held(&iwl_mei_mutex));
956
957 if (!netdev)
958 return;
959
960 while (valid_rx_sz >= sizeof(hdr)) {
961 struct ethhdr *ethhdr;
962 unsigned char *data;
963 struct sk_buff *skb;
964 u16 len;
965
966 iwl_mei_read_from_q(q_head, q_sz, &rd, wr, &hdr, sizeof(hdr));
967 valid_rx_sz -= sizeof(hdr);
968 len = le16_to_cpu(hdr.len);
969
970 if (valid_rx_sz < len) {
971 dev_err(&cldev->dev,
> 972 "Data queue is corrupted: valid data len %ld, len %d\n",
973 valid_rx_sz, len);
974 break;
975 }
976
977 if (len < sizeof(*ethhdr)) {
978 dev_err(&cldev->dev,
979 "Data len is smaller than an ethernet header? len = %d\n",
980 len);
981 }
982
983 valid_rx_sz -= len;
984
985 if (le16_to_cpu(hdr.type) != SAP_MSG_DATA_PACKET) {
986 dev_err(&cldev->dev, "Unsupported Rx data: type %d, len %d\n",
987 le16_to_cpu(hdr.type), len);
988 continue;
989 }
990
991 /* We need enough room for the WiFi header + SNAP + IV */
992 skb = netdev_alloc_skb(netdev, len + 26 + 8 + 8);
993
994 skb_reserve(skb, 26 + 8 + 8);
995 ethhdr = skb_push(skb, sizeof(*ethhdr));
996
997 iwl_mei_read_from_q(q_head, q_sz, &rd, wr,
998 ethhdr, sizeof(*ethhdr));
999 len -= sizeof(*ethhdr);
1000
1001 skb_reset_mac_header(skb);
1002 skb_reset_network_header(skb);
1003 skb->protocol = ethhdr->h_proto;
1004
1005 data = skb_put(skb, len);
1006 iwl_mei_read_from_q(q_head, q_sz, &rd, wr, data, len);
1007
1008 /*
1009 * Enqueue the skb here so that it can be sent later when we
1010 * do not hold the mutex. TX'ing a packet with a mutex held is
1011 * possible, but it wouldn't be nice to forbid the TX path to
1012 * call any of iwlmei's functions, since every API from iwlmei
1013 * needs the mutex.
1014 */
1015 __skb_queue_tail(tx_skbs, skb);
1016 }
1017 }
1018
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 2 months
[mcgrof-next:20210708-block-fixes-v2 65/89] drivers/memstick/core/ms_block.c:2166:19: error: incompatible pointer types passing 'struct request_queue *' to parameter of type 'struct gendisk *'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux-next.git 20210708-block-fixes-v2
head: db0174e39de7dc941f158ce53ee3af95b1635b62
commit: 521765ac9bd8d3911b79b1c7a232d35391cc64af [65/89] ms_block: add error handling support for add_disk()
config: arm64-randconfig-r036-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 arm64 cross compiling tool for clang build
# apt-get install binutils-aarch64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux-next.git/com...
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 521765ac9bd8d3911b79b1c7a232d35391cc64af
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
>> drivers/memstick/core/ms_block.c:2166:19: error: incompatible pointer types passing 'struct request_queue *' to parameter of type 'struct gendisk *' [-Werror,-Wincompatible-pointer-types]
blk_cleanup_disk(msb->queue);
^~~~~~~~~~
include/linux/genhd.h:312:39: note: passing argument to parameter 'disk' here
void blk_cleanup_disk(struct gendisk *disk);
^
1 error generated.
vim +2166 drivers/memstick/core/ms_block.c
2108
2109 /* Registers the block device */
2110 static int msb_init_disk(struct memstick_dev *card)
2111 {
2112 struct msb_data *msb = memstick_get_drvdata(card);
2113 int rc;
2114 unsigned long capacity;
2115
2116 mutex_lock(&msb_disk_lock);
2117 msb->disk_id = idr_alloc(&msb_disk_idr, card, 0, 256, GFP_KERNEL);
2118 mutex_unlock(&msb_disk_lock);
2119
2120 if (msb->disk_id < 0)
2121 return msb->disk_id;
2122
2123 rc = blk_mq_alloc_sq_tag_set(&msb->tag_set, &msb_mq_ops, 2,
2124 BLK_MQ_F_SHOULD_MERGE);
2125 if (rc)
2126 goto out_release_id;
2127
2128 msb->disk = blk_mq_alloc_disk(&msb->tag_set, card);
2129 if (IS_ERR(msb->disk)) {
2130 rc = PTR_ERR(msb->disk);
2131 goto out_free_tag_set;
2132 }
2133 msb->queue = msb->disk->queue;
2134
2135 blk_queue_max_hw_sectors(msb->queue, MS_BLOCK_MAX_PAGES);
2136 blk_queue_max_segments(msb->queue, MS_BLOCK_MAX_SEGS);
2137 blk_queue_max_segment_size(msb->queue,
2138 MS_BLOCK_MAX_PAGES * msb->page_size);
2139 blk_queue_logical_block_size(msb->queue, msb->page_size);
2140
2141 sprintf(msb->disk->disk_name, "msblk%d", msb->disk_id);
2142 msb->disk->fops = &msb_bdops;
2143 msb->disk->private_data = msb;
2144
2145 capacity = msb->pages_in_block * msb->logical_block_count;
2146 capacity *= (msb->page_size / 512);
2147 set_capacity(msb->disk, capacity);
2148 dbg("Set total disk size to %lu sectors", capacity);
2149
2150 msb->usage_count = 1;
2151 msb->io_queue = alloc_ordered_workqueue("ms_block", WQ_MEM_RECLAIM);
2152 INIT_WORK(&msb->io_work, msb_io_work);
2153 sg_init_table(msb->prealloc_sg, MS_BLOCK_MAX_SEGS+1);
2154
2155 if (msb->read_only)
2156 set_disk_ro(msb->disk, 1);
2157
2158 msb_start(card);
2159 rc = device_add_disk(&card->dev, msb->disk, NULL);
2160 if (rc)
2161 goto out_cleanup_disk;
2162 dbg("Disk added");
2163 return 0;
2164
2165 out_cleanup_disk:
> 2166 blk_cleanup_disk(msb->queue);
2167 out_free_tag_set:
2168 blk_mq_free_tag_set(&msb->tag_set);
2169 out_release_id:
2170 mutex_lock(&msb_disk_lock);
2171 idr_remove(&msb_disk_idr, msb->disk_id);
2172 mutex_unlock(&msb_disk_lock);
2173 return rc;
2174 }
2175
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 2 months
[gustavoars-linux:for-next/Warray-bounds 1/1] arch/sparc/kernel/irq_32.c:258:7: error: array subscript [16, 79] is outside array bounds of 'struct tt_entry[1]'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git for-next/Warray-bounds
head: 0d6455c92b82b36e29e5206a46329058d75fbc33
commit: 0d6455c92b82b36e29e5206a46329058d75fbc33 [1/1] Makefile: Enable -Warray-bounds
config: sparc-randconfig-p002-20210715 (attached as .config)
compiler: sparc-linux-gcc (GCC) 10.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/gustavoars/linux.git/comm...
git remote add gustavoars-linux https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git
git fetch --no-tags gustavoars-linux for-next/Warray-bounds
git checkout 0d6455c92b82b36e29e5206a46329058d75fbc33
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross ARCH=sparc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
arch/sparc/kernel/irq_32.c: In function 'sparc_floppy_request_irq':
>> arch/sparc/kernel/irq_32.c:258:7: error: array subscript [16, 79] is outside array bounds of 'struct tt_entry[1]' [-Werror=array-bounds]
258 | table[SP_TRAP_IRQ1+(cpu_irq-1)].inst_one = SPARC_RD_PSR_L0; \
| ^
arch/sparc/kernel/irq_32.c:272:3: note: in expansion of macro 'INSTANTIATE'
272 | INSTANTIATE(trap_table)
| ^~~~~~~~~~~
In file included from arch/sparc/kernel/irq_32.c:25:
arch/sparc/kernel/kernel.h:143:24: note: while referencing 'trapbase_cpu1'
143 | extern struct tt_entry trapbase_cpu1;
| ^~~~~~~~~~~~~
In file included from arch/sparc/include/asm/traps.h:10,
from arch/sparc/kernel/kernel.h:8,
from arch/sparc/kernel/irq_32.c:25:
arch/sparc/kernel/irq_32.c:261:25: error: array subscript [16, 79] is outside array bounds of 'struct tt_entry[1]' [-Werror=array-bounds]
261 | (unsigned long) &table[SP_TRAP_IRQ1+(cpu_irq-1)].inst_two);\
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/sparc/include/uapi/asm/traps.h:27:38: note: in definition of macro 'SPARC_BRANCH'
27 | (0x10800000 | (((dest_addr-inst_addr)>>2)&0x3fffff))
| ^~~~~~~~~
arch/sparc/kernel/irq_32.c:272:3: note: in expansion of macro 'INSTANTIATE'
272 | INSTANTIATE(trap_table)
| ^~~~~~~~~~~
In file included from arch/sparc/kernel/irq_32.c:25:
arch/sparc/kernel/kernel.h:143:24: note: while referencing 'trapbase_cpu1'
143 | extern struct tt_entry trapbase_cpu1;
| ^~~~~~~~~~~~~
arch/sparc/kernel/irq_32.c:259:7: error: array subscript [16, 79] is outside array bounds of 'struct tt_entry[1]' [-Werror=array-bounds]
259 | table[SP_TRAP_IRQ1+(cpu_irq-1)].inst_two = \
| ^
arch/sparc/kernel/irq_32.c:272:3: note: in expansion of macro 'INSTANTIATE'
272 | INSTANTIATE(trap_table)
| ^~~~~~~~~~~
In file included from arch/sparc/kernel/irq_32.c:25:
arch/sparc/kernel/kernel.h:143:24: note: while referencing 'trapbase_cpu1'
143 | extern struct tt_entry trapbase_cpu1;
| ^~~~~~~~~~~~~
arch/sparc/kernel/irq_32.c:262:7: error: array subscript [16, 79] is outside array bounds of 'struct tt_entry[1]' [-Werror=array-bounds]
262 | table[SP_TRAP_IRQ1+(cpu_irq-1)].inst_three = SPARC_RD_WIM_L3; \
| ^
arch/sparc/kernel/irq_32.c:272:3: note: in expansion of macro 'INSTANTIATE'
272 | INSTANTIATE(trap_table)
| ^~~~~~~~~~~
In file included from arch/sparc/kernel/irq_32.c:25:
arch/sparc/kernel/kernel.h:143:24: note: while referencing 'trapbase_cpu1'
143 | extern struct tt_entry trapbase_cpu1;
| ^~~~~~~~~~~~~
arch/sparc/kernel/irq_32.c:263:7: error: array subscript [16, 79] is outside array bounds of 'struct tt_entry[1]' [-Werror=array-bounds]
263 | table[SP_TRAP_IRQ1+(cpu_irq-1)].inst_four = SPARC_NOP;
| ^
arch/sparc/kernel/irq_32.c:272:3: note: in expansion of macro 'INSTANTIATE'
272 | INSTANTIATE(trap_table)
| ^~~~~~~~~~~
In file included from arch/sparc/kernel/irq_32.c:25:
arch/sparc/kernel/kernel.h:143:24: note: while referencing 'trapbase_cpu1'
143 | extern struct tt_entry trapbase_cpu1;
| ^~~~~~~~~~~~~
>> arch/sparc/kernel/irq_32.c:258:7: error: array subscript [16, 79] is outside array bounds of 'struct tt_entry[1]' [-Werror=array-bounds]
258 | table[SP_TRAP_IRQ1+(cpu_irq-1)].inst_one = SPARC_RD_PSR_L0; \
| ^
arch/sparc/kernel/irq_32.c:274:3: note: in expansion of macro 'INSTANTIATE'
274 | INSTANTIATE(trap_table)
| ^~~~~~~~~~~
In file included from arch/sparc/kernel/irq_32.c:25:
arch/sparc/kernel/kernel.h:144:24: note: while referencing 'trapbase_cpu2'
144 | extern struct tt_entry trapbase_cpu2;
| ^~~~~~~~~~~~~
In file included from arch/sparc/include/asm/traps.h:10,
from arch/sparc/kernel/kernel.h:8,
from arch/sparc/kernel/irq_32.c:25:
arch/sparc/kernel/irq_32.c:261:25: error: array subscript [16, 79] is outside array bounds of 'struct tt_entry[1]' [-Werror=array-bounds]
261 | (unsigned long) &table[SP_TRAP_IRQ1+(cpu_irq-1)].inst_two);\
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/sparc/include/uapi/asm/traps.h:27:38: note: in definition of macro 'SPARC_BRANCH'
27 | (0x10800000 | (((dest_addr-inst_addr)>>2)&0x3fffff))
| ^~~~~~~~~
arch/sparc/kernel/irq_32.c:274:3: note: in expansion of macro 'INSTANTIATE'
274 | INSTANTIATE(trap_table)
| ^~~~~~~~~~~
In file included from arch/sparc/kernel/irq_32.c:25:
arch/sparc/kernel/kernel.h:144:24: note: while referencing 'trapbase_cpu2'
144 | extern struct tt_entry trapbase_cpu2;
| ^~~~~~~~~~~~~
arch/sparc/kernel/irq_32.c:259:7: error: array subscript [16, 79] is outside array bounds of 'struct tt_entry[1]' [-Werror=array-bounds]
259 | table[SP_TRAP_IRQ1+(cpu_irq-1)].inst_two = \
| ^
arch/sparc/kernel/irq_32.c:274:3: note: in expansion of macro 'INSTANTIATE'
274 | INSTANTIATE(trap_table)
| ^~~~~~~~~~~
In file included from arch/sparc/kernel/irq_32.c:25:
arch/sparc/kernel/kernel.h:144:24: note: while referencing 'trapbase_cpu2'
144 | extern struct tt_entry trapbase_cpu2;
| ^~~~~~~~~~~~~
arch/sparc/kernel/irq_32.c:262:7: error: array subscript [16, 79] is outside array bounds of 'struct tt_entry[1]' [-Werror=array-bounds]
262 | table[SP_TRAP_IRQ1+(cpu_irq-1)].inst_three = SPARC_RD_WIM_L3; \
| ^
arch/sparc/kernel/irq_32.c:274:3: note: in expansion of macro 'INSTANTIATE'
274 | INSTANTIATE(trap_table)
| ^~~~~~~~~~~
In file included from arch/sparc/kernel/irq_32.c:25:
arch/sparc/kernel/kernel.h:144:24: note: while referencing 'trapbase_cpu2'
144 | extern struct tt_entry trapbase_cpu2;
| ^~~~~~~~~~~~~
arch/sparc/kernel/irq_32.c:263:7: error: array subscript [16, 79] is outside array bounds of 'struct tt_entry[1]' [-Werror=array-bounds]
263 | table[SP_TRAP_IRQ1+(cpu_irq-1)].inst_four = SPARC_NOP;
| ^
arch/sparc/kernel/irq_32.c:274:3: note: in expansion of macro 'INSTANTIATE'
274 | INSTANTIATE(trap_table)
| ^~~~~~~~~~~
In file included from arch/sparc/kernel/irq_32.c:25:
arch/sparc/kernel/kernel.h:144:24: note: while referencing 'trapbase_cpu2'
144 | extern struct tt_entry trapbase_cpu2;
| ^~~~~~~~~~~~~
>> arch/sparc/kernel/irq_32.c:258:7: error: array subscript [16, 79] is outside array bounds of 'struct tt_entry[1]' [-Werror=array-bounds]
258 | table[SP_TRAP_IRQ1+(cpu_irq-1)].inst_one = SPARC_RD_PSR_L0; \
| ^
arch/sparc/kernel/irq_32.c:276:3: note: in expansion of macro 'INSTANTIATE'
276 | INSTANTIATE(trap_table)
| ^~~~~~~~~~~
In file included from arch/sparc/kernel/irq_32.c:25:
arch/sparc/kernel/kernel.h:145:24: note: while referencing 'trapbase_cpu3'
145 | extern struct tt_entry trapbase_cpu3;
| ^~~~~~~~~~~~~
In file included from arch/sparc/include/asm/traps.h:10,
from arch/sparc/kernel/kernel.h:8,
from arch/sparc/kernel/irq_32.c:25:
arch/sparc/kernel/irq_32.c:261:25: error: array subscript [16, 79] is outside array bounds of 'struct tt_entry[1]' [-Werror=array-bounds]
261 | (unsigned long) &table[SP_TRAP_IRQ1+(cpu_irq-1)].inst_two);\
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/sparc/include/uapi/asm/traps.h:27:38: note: in definition of macro 'SPARC_BRANCH'
27 | (0x10800000 | (((dest_addr-inst_addr)>>2)&0x3fffff))
| ^~~~~~~~~
arch/sparc/kernel/irq_32.c:276:3: note: in expansion of macro 'INSTANTIATE'
276 | INSTANTIATE(trap_table)
| ^~~~~~~~~~~
In file included from arch/sparc/kernel/irq_32.c:25:
arch/sparc/kernel/kernel.h:145:24: note: while referencing 'trapbase_cpu3'
145 | extern struct tt_entry trapbase_cpu3;
| ^~~~~~~~~~~~~
arch/sparc/kernel/irq_32.c:259:7: error: array subscript [16, 79] is outside array bounds of 'struct tt_entry[1]' [-Werror=array-bounds]
259 | table[SP_TRAP_IRQ1+(cpu_irq-1)].inst_two = \
| ^
arch/sparc/kernel/irq_32.c:276:3: note: in expansion of macro 'INSTANTIATE'
276 | INSTANTIATE(trap_table)
| ^~~~~~~~~~~
In file included from arch/sparc/kernel/irq_32.c:25:
arch/sparc/kernel/kernel.h:145:24: note: while referencing 'trapbase_cpu3'
145 | extern struct tt_entry trapbase_cpu3;
| ^~~~~~~~~~~~~
arch/sparc/kernel/irq_32.c:262:7: error: array subscript [16, 79] is outside array bounds of 'struct tt_entry[1]' [-Werror=array-bounds]
262 | table[SP_TRAP_IRQ1+(cpu_irq-1)].inst_three = SPARC_RD_WIM_L3; \
| ^
arch/sparc/kernel/irq_32.c:276:3: note: in expansion of macro 'INSTANTIATE'
276 | INSTANTIATE(trap_table)
| ^~~~~~~~~~~
In file included from arch/sparc/kernel/irq_32.c:25:
arch/sparc/kernel/kernel.h:145:24: note: while referencing 'trapbase_cpu3'
145 | extern struct tt_entry trapbase_cpu3;
| ^~~~~~~~~~~~~
arch/sparc/kernel/irq_32.c:263:7: error: array subscript [16, 79] is outside array bounds of 'struct tt_entry[1]' [-Werror=array-bounds]
263 | table[SP_TRAP_IRQ1+(cpu_irq-1)].inst_four = SPARC_NOP;
| ^
arch/sparc/kernel/irq_32.c:276:3: note: in expansion of macro 'INSTANTIATE'
276 | INSTANTIATE(trap_table)
| ^~~~~~~~~~~
In file included from arch/sparc/kernel/irq_32.c:25:
arch/sparc/kernel/kernel.h:145:24: note: while referencing 'trapbase_cpu3'
145 | extern struct tt_entry trapbase_cpu3;
| ^~~~~~~~~~~~~
cc1: all warnings being treated as errors
vim +258 arch/sparc/kernel/irq_32.c
^1da177e4c3f41 arch/sparc/kernel/irq.c Linus Torvalds 2005-04-16 240
6baa9b20a68a88 arch/sparc/kernel/irq_32.c Sam Ravnborg 2011-04-18 241 int sparc_floppy_request_irq(unsigned int irq, irq_handler_t irq_handler)
^1da177e4c3f41 arch/sparc/kernel/irq.c Linus Torvalds 2005-04-16 242 {
^1da177e4c3f41 arch/sparc/kernel/irq.c Linus Torvalds 2005-04-16 243 unsigned int cpu_irq;
6baa9b20a68a88 arch/sparc/kernel/irq_32.c Sam Ravnborg 2011-04-18 244 int err;
6baa9b20a68a88 arch/sparc/kernel/irq_32.c Sam Ravnborg 2011-04-18 245
^1da177e4c3f41 arch/sparc/kernel/irq.c Linus Torvalds 2005-04-16 246
6baa9b20a68a88 arch/sparc/kernel/irq_32.c Sam Ravnborg 2011-04-18 247 err = request_irq(irq, irq_handler, 0, "floppy", NULL);
6baa9b20a68a88 arch/sparc/kernel/irq_32.c Sam Ravnborg 2011-04-18 248 if (err)
6baa9b20a68a88 arch/sparc/kernel/irq_32.c Sam Ravnborg 2011-04-18 249 return -1;
^1da177e4c3f41 arch/sparc/kernel/irq.c Linus Torvalds 2005-04-16 250
6baa9b20a68a88 arch/sparc/kernel/irq_32.c Sam Ravnborg 2011-04-18 251 /* Save for later use in floppy interrupt handler */
6baa9b20a68a88 arch/sparc/kernel/irq_32.c Sam Ravnborg 2011-04-18 252 floppy_irq = irq;
^1da177e4c3f41 arch/sparc/kernel/irq.c Linus Torvalds 2005-04-16 253
6baa9b20a68a88 arch/sparc/kernel/irq_32.c Sam Ravnborg 2011-04-18 254 cpu_irq = (irq & (NR_IRQS - 1));
^1da177e4c3f41 arch/sparc/kernel/irq.c Linus Torvalds 2005-04-16 255
^1da177e4c3f41 arch/sparc/kernel/irq.c Linus Torvalds 2005-04-16 256 /* Dork with trap table if we get this far. */
^1da177e4c3f41 arch/sparc/kernel/irq.c Linus Torvalds 2005-04-16 257 #define INSTANTIATE(table) \
^1da177e4c3f41 arch/sparc/kernel/irq.c Linus Torvalds 2005-04-16 @258 table[SP_TRAP_IRQ1+(cpu_irq-1)].inst_one = SPARC_RD_PSR_L0; \
^1da177e4c3f41 arch/sparc/kernel/irq.c Linus Torvalds 2005-04-16 259 table[SP_TRAP_IRQ1+(cpu_irq-1)].inst_two = \
6baa9b20a68a88 arch/sparc/kernel/irq_32.c Sam Ravnborg 2011-04-18 260 SPARC_BRANCH((unsigned long) floppy_hardint, \
^1da177e4c3f41 arch/sparc/kernel/irq.c Linus Torvalds 2005-04-16 261 (unsigned long) &table[SP_TRAP_IRQ1+(cpu_irq-1)].inst_two);\
^1da177e4c3f41 arch/sparc/kernel/irq.c Linus Torvalds 2005-04-16 262 table[SP_TRAP_IRQ1+(cpu_irq-1)].inst_three = SPARC_RD_WIM_L3; \
^1da177e4c3f41 arch/sparc/kernel/irq.c Linus Torvalds 2005-04-16 263 table[SP_TRAP_IRQ1+(cpu_irq-1)].inst_four = SPARC_NOP;
^1da177e4c3f41 arch/sparc/kernel/irq.c Linus Torvalds 2005-04-16 264
^1da177e4c3f41 arch/sparc/kernel/irq.c Linus Torvalds 2005-04-16 265 INSTANTIATE(sparc_ttable)
b08b5c9c9b35c9 arch/sparc/kernel/irq_32.c Sam Ravnborg 2012-05-25 266
:::::: The code at line 258 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2
:::::: TO: Linus Torvalds <torvalds(a)ppc970.osdl.org>
:::::: CC: Linus Torvalds <torvalds(a)ppc970.osdl.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 2 months
[chrome-os:chromeos-5.10 54/157] drivers/net/wireless/mediatek/mt76/mt7915/init.c:203:2: error: expected expression before '}' token
by kernel test robot
tree: https://chromium.googlesource.com/chromiumos/third_party/kernel chromeos-5.10
head: 4624b046123614fbe6e00807cef98d1d7eb90382
commit: 3f9a790d9b017221350793f97c01ed8df45b7579 [54/157] UPSTREAM: mt76: mt7915: support 32 station interfaces
config: x86_64-randconfig-a014-20210715 (attached as .config)
compiler: gcc-10 (Ubuntu 10.3.0-1ubuntu1~20.04) 10.3.0
reproduce (this is a W=1 build):
git remote add chrome-os https://chromium.googlesource.com/chromiumos/third_party/kernel
git fetch --no-tags chrome-os chromeos-5.10
git checkout 3f9a790d9b017221350793f97c01ed8df45b7579
# save the attached .config to linux build tree
mkdir build_dir
make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
>> drivers/net/wireless/mediatek/mt76/mt7915/init.c:203:2: error: expected expression before '}' token
203 | }, {
| ^
vim +203 drivers/net/wireless/mediatek/mt76/mt7915/init.c
192
193 static const struct ieee80211_iface_limit if_limits[] = {
194 {
195 .max = 1,
196 .types = BIT(NL80211_IFTYPE_ADHOC)
197 }, {
198 .max = 16,
199 .types = BIT(NL80211_IFTYPE_AP) |
200 #ifdef CONFIG_MAC80211_MESH
201 BIT(NL80211_IFTYPE_MESH_POINT)
202 #endif
> 203 }, {
204 .max = MT7915_MAX_INTERFACES,
205 .types = BIT(NL80211_IFTYPE_STATION)
206 }
207 };
208
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 2 months