* drivers/infiniband/hw/qib/qib_sysfs.c:411:1: warning: performing pointer subtraction with a null pointer has undefined behavior
@ 2021-07-21 4:44 ` kernel test robot
0 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2021-07-21 4:44 UTC (permalink / raw)
To: Jason Gunthorpe
Cc: clang-built-linux, kbuild-all, linux-kernel, Leon Romanovsky
[-- Attachment #1: Type: text/plain, Size: 9584 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 8cae8cd89f05f6de223d63e6d15e31c8ba9cf53b
commit: 4a7aaf88c89f12f8048137e274ce0d40fe1056b2 RDMA/qib: Use attributes for the port sysfs
date: 5 weeks ago
config: x86_64-randconfig-r016-20210720 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project c781eb153bfbd1b52b03efe34f56bbeccbb8aba6)
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 x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=4a7aaf88c89f12f8048137e274ce0d40fe1056b2
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 4a7aaf88c89f12f8048137e274ce0d40fe1056b2
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> drivers/infiniband/hw/qib/qib_sysfs.c:411:1: warning: performing pointer subtraction with a null pointer has undefined behavior [-Wnull-pointer-subtraction]
QIB_DIAGC_ATTR(rc_resends);
^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:408:51: note: expanded from macro 'QIB_DIAGC_ATTR'
.counter = &((struct qib_ibport *)0)->rvp.n_##N - (u64 *)0, \
^ ~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:412:1: warning: performing pointer subtraction with a null pointer has undefined behavior [-Wnull-pointer-subtraction]
QIB_DIAGC_ATTR(seq_naks);
^~~~~~~~~~~~~~~~~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:408:51: note: expanded from macro 'QIB_DIAGC_ATTR'
.counter = &((struct qib_ibport *)0)->rvp.n_##N - (u64 *)0, \
^ ~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:413:1: warning: performing pointer subtraction with a null pointer has undefined behavior [-Wnull-pointer-subtraction]
QIB_DIAGC_ATTR(rdma_seq);
^~~~~~~~~~~~~~~~~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:408:51: note: expanded from macro 'QIB_DIAGC_ATTR'
.counter = &((struct qib_ibport *)0)->rvp.n_##N - (u64 *)0, \
^ ~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:414:1: warning: performing pointer subtraction with a null pointer has undefined behavior [-Wnull-pointer-subtraction]
QIB_DIAGC_ATTR(rnr_naks);
^~~~~~~~~~~~~~~~~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:408:51: note: expanded from macro 'QIB_DIAGC_ATTR'
.counter = &((struct qib_ibport *)0)->rvp.n_##N - (u64 *)0, \
^ ~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:415:1: warning: performing pointer subtraction with a null pointer has undefined behavior [-Wnull-pointer-subtraction]
QIB_DIAGC_ATTR(other_naks);
^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:408:51: note: expanded from macro 'QIB_DIAGC_ATTR'
.counter = &((struct qib_ibport *)0)->rvp.n_##N - (u64 *)0, \
^ ~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:416:1: warning: performing pointer subtraction with a null pointer has undefined behavior [-Wnull-pointer-subtraction]
QIB_DIAGC_ATTR(rc_timeouts);
^~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:408:51: note: expanded from macro 'QIB_DIAGC_ATTR'
.counter = &((struct qib_ibport *)0)->rvp.n_##N - (u64 *)0, \
^ ~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:417:1: warning: performing pointer subtraction with a null pointer has undefined behavior [-Wnull-pointer-subtraction]
QIB_DIAGC_ATTR(loop_pkts);
^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:408:51: note: expanded from macro 'QIB_DIAGC_ATTR'
.counter = &((struct qib_ibport *)0)->rvp.n_##N - (u64 *)0, \
^ ~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:418:1: warning: performing pointer subtraction with a null pointer has undefined behavior [-Wnull-pointer-subtraction]
QIB_DIAGC_ATTR(pkt_drops);
^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:408:51: note: expanded from macro 'QIB_DIAGC_ATTR'
.counter = &((struct qib_ibport *)0)->rvp.n_##N - (u64 *)0, \
^ ~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:419:1: warning: performing pointer subtraction with a null pointer has undefined behavior [-Wnull-pointer-subtraction]
QIB_DIAGC_ATTR(dmawait);
^~~~~~~~~~~~~~~~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:408:51: note: expanded from macro 'QIB_DIAGC_ATTR'
.counter = &((struct qib_ibport *)0)->rvp.n_##N - (u64 *)0, \
^ ~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:420:1: warning: performing pointer subtraction with a null pointer has undefined behavior [-Wnull-pointer-subtraction]
QIB_DIAGC_ATTR(unaligned);
^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:408:51: note: expanded from macro 'QIB_DIAGC_ATTR'
.counter = &((struct qib_ibport *)0)->rvp.n_##N - (u64 *)0, \
^ ~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:421:1: warning: performing pointer subtraction with a null pointer has undefined behavior [-Wnull-pointer-subtraction]
QIB_DIAGC_ATTR(rc_dupreq);
^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:408:51: note: expanded from macro 'QIB_DIAGC_ATTR'
.counter = &((struct qib_ibport *)0)->rvp.n_##N - (u64 *)0, \
^ ~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:422:1: warning: performing pointer subtraction with a null pointer has undefined behavior [-Wnull-pointer-subtraction]
QIB_DIAGC_ATTR(rc_seqnak);
^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:408:51: note: expanded from macro 'QIB_DIAGC_ATTR'
.counter = &((struct qib_ibport *)0)->rvp.n_##N - (u64 *)0, \
^ ~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:423:1: warning: performing pointer subtraction with a null pointer has undefined behavior [-Wnull-pointer-subtraction]
QIB_DIAGC_ATTR(rc_crwaits);
^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:408:51: note: expanded from macro 'QIB_DIAGC_ATTR'
.counter = &((struct qib_ibport *)0)->rvp.n_##N - (u64 *)0, \
^ ~~~~~~~~
13 warnings generated.
vim +411 drivers/infiniband/hw/qib/qib_sysfs.c
f24a6d4887668c Harish Chegondi 2016-01-22 404
4a7aaf88c89f12 Jason Gunthorpe 2021-06-11 405 #define QIB_DIAGC_ATTR(N) \
f24a6d4887668c Harish Chegondi 2016-01-22 406 static struct qib_diagc_attr qib_diagc_attr_##N = { \
4a7aaf88c89f12 Jason Gunthorpe 2021-06-11 407 .attr = __ATTR(N, 0664, diagc_attr_show, diagc_attr_store), \
4a7aaf88c89f12 Jason Gunthorpe 2021-06-11 408 .counter = &((struct qib_ibport *)0)->rvp.n_##N - (u64 *)0, \
f931551bafe1f1 Ralph Campbell 2010-05-23 409 }
f931551bafe1f1 Ralph Campbell 2010-05-23 410
f931551bafe1f1 Ralph Campbell 2010-05-23 @411 QIB_DIAGC_ATTR(rc_resends);
f931551bafe1f1 Ralph Campbell 2010-05-23 412 QIB_DIAGC_ATTR(seq_naks);
f931551bafe1f1 Ralph Campbell 2010-05-23 413 QIB_DIAGC_ATTR(rdma_seq);
f931551bafe1f1 Ralph Campbell 2010-05-23 414 QIB_DIAGC_ATTR(rnr_naks);
f931551bafe1f1 Ralph Campbell 2010-05-23 415 QIB_DIAGC_ATTR(other_naks);
f931551bafe1f1 Ralph Campbell 2010-05-23 416 QIB_DIAGC_ATTR(rc_timeouts);
f931551bafe1f1 Ralph Campbell 2010-05-23 417 QIB_DIAGC_ATTR(loop_pkts);
f931551bafe1f1 Ralph Campbell 2010-05-23 418 QIB_DIAGC_ATTR(pkt_drops);
f931551bafe1f1 Ralph Campbell 2010-05-23 419 QIB_DIAGC_ATTR(dmawait);
f931551bafe1f1 Ralph Campbell 2010-05-23 420 QIB_DIAGC_ATTR(unaligned);
f931551bafe1f1 Ralph Campbell 2010-05-23 421 QIB_DIAGC_ATTR(rc_dupreq);
f931551bafe1f1 Ralph Campbell 2010-05-23 422 QIB_DIAGC_ATTR(rc_seqnak);
7199435414868b Kaike Wan 2019-09-11 423 QIB_DIAGC_ATTR(rc_crwaits);
f931551bafe1f1 Ralph Campbell 2010-05-23 424
:::::: The code at line 411 was first introduced by commit
:::::: f931551bafe1f10ded7f5282e2aa162c267a2e5d IB/qib: Add new qib driver for QLogic PCIe InfiniBand adapters
:::::: TO: Ralph Campbell <ralph.campbell@qlogic.com>
:::::: CC: Roland Dreier <rolandd@cisco.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: 45690 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* drivers/infiniband/hw/qib/qib_sysfs.c:411:1: warning: performing pointer subtraction with a null pointer has undefined behavior
@ 2021-07-21 4:44 ` kernel test robot
0 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2021-07-21 4:44 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 9723 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 8cae8cd89f05f6de223d63e6d15e31c8ba9cf53b
commit: 4a7aaf88c89f12f8048137e274ce0d40fe1056b2 RDMA/qib: Use attributes for the port sysfs
date: 5 weeks ago
config: x86_64-randconfig-r016-20210720 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project c781eb153bfbd1b52b03efe34f56bbeccbb8aba6)
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 x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=4a7aaf88c89f12f8048137e274ce0d40fe1056b2
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 4a7aaf88c89f12f8048137e274ce0d40fe1056b2
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> drivers/infiniband/hw/qib/qib_sysfs.c:411:1: warning: performing pointer subtraction with a null pointer has undefined behavior [-Wnull-pointer-subtraction]
QIB_DIAGC_ATTR(rc_resends);
^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:408:51: note: expanded from macro 'QIB_DIAGC_ATTR'
.counter = &((struct qib_ibport *)0)->rvp.n_##N - (u64 *)0, \
^ ~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:412:1: warning: performing pointer subtraction with a null pointer has undefined behavior [-Wnull-pointer-subtraction]
QIB_DIAGC_ATTR(seq_naks);
^~~~~~~~~~~~~~~~~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:408:51: note: expanded from macro 'QIB_DIAGC_ATTR'
.counter = &((struct qib_ibport *)0)->rvp.n_##N - (u64 *)0, \
^ ~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:413:1: warning: performing pointer subtraction with a null pointer has undefined behavior [-Wnull-pointer-subtraction]
QIB_DIAGC_ATTR(rdma_seq);
^~~~~~~~~~~~~~~~~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:408:51: note: expanded from macro 'QIB_DIAGC_ATTR'
.counter = &((struct qib_ibport *)0)->rvp.n_##N - (u64 *)0, \
^ ~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:414:1: warning: performing pointer subtraction with a null pointer has undefined behavior [-Wnull-pointer-subtraction]
QIB_DIAGC_ATTR(rnr_naks);
^~~~~~~~~~~~~~~~~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:408:51: note: expanded from macro 'QIB_DIAGC_ATTR'
.counter = &((struct qib_ibport *)0)->rvp.n_##N - (u64 *)0, \
^ ~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:415:1: warning: performing pointer subtraction with a null pointer has undefined behavior [-Wnull-pointer-subtraction]
QIB_DIAGC_ATTR(other_naks);
^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:408:51: note: expanded from macro 'QIB_DIAGC_ATTR'
.counter = &((struct qib_ibport *)0)->rvp.n_##N - (u64 *)0, \
^ ~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:416:1: warning: performing pointer subtraction with a null pointer has undefined behavior [-Wnull-pointer-subtraction]
QIB_DIAGC_ATTR(rc_timeouts);
^~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:408:51: note: expanded from macro 'QIB_DIAGC_ATTR'
.counter = &((struct qib_ibport *)0)->rvp.n_##N - (u64 *)0, \
^ ~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:417:1: warning: performing pointer subtraction with a null pointer has undefined behavior [-Wnull-pointer-subtraction]
QIB_DIAGC_ATTR(loop_pkts);
^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:408:51: note: expanded from macro 'QIB_DIAGC_ATTR'
.counter = &((struct qib_ibport *)0)->rvp.n_##N - (u64 *)0, \
^ ~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:418:1: warning: performing pointer subtraction with a null pointer has undefined behavior [-Wnull-pointer-subtraction]
QIB_DIAGC_ATTR(pkt_drops);
^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:408:51: note: expanded from macro 'QIB_DIAGC_ATTR'
.counter = &((struct qib_ibport *)0)->rvp.n_##N - (u64 *)0, \
^ ~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:419:1: warning: performing pointer subtraction with a null pointer has undefined behavior [-Wnull-pointer-subtraction]
QIB_DIAGC_ATTR(dmawait);
^~~~~~~~~~~~~~~~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:408:51: note: expanded from macro 'QIB_DIAGC_ATTR'
.counter = &((struct qib_ibport *)0)->rvp.n_##N - (u64 *)0, \
^ ~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:420:1: warning: performing pointer subtraction with a null pointer has undefined behavior [-Wnull-pointer-subtraction]
QIB_DIAGC_ATTR(unaligned);
^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:408:51: note: expanded from macro 'QIB_DIAGC_ATTR'
.counter = &((struct qib_ibport *)0)->rvp.n_##N - (u64 *)0, \
^ ~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:421:1: warning: performing pointer subtraction with a null pointer has undefined behavior [-Wnull-pointer-subtraction]
QIB_DIAGC_ATTR(rc_dupreq);
^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:408:51: note: expanded from macro 'QIB_DIAGC_ATTR'
.counter = &((struct qib_ibport *)0)->rvp.n_##N - (u64 *)0, \
^ ~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:422:1: warning: performing pointer subtraction with a null pointer has undefined behavior [-Wnull-pointer-subtraction]
QIB_DIAGC_ATTR(rc_seqnak);
^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:408:51: note: expanded from macro 'QIB_DIAGC_ATTR'
.counter = &((struct qib_ibport *)0)->rvp.n_##N - (u64 *)0, \
^ ~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:423:1: warning: performing pointer subtraction with a null pointer has undefined behavior [-Wnull-pointer-subtraction]
QIB_DIAGC_ATTR(rc_crwaits);
^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:408:51: note: expanded from macro 'QIB_DIAGC_ATTR'
.counter = &((struct qib_ibport *)0)->rvp.n_##N - (u64 *)0, \
^ ~~~~~~~~
13 warnings generated.
vim +411 drivers/infiniband/hw/qib/qib_sysfs.c
f24a6d4887668c Harish Chegondi 2016-01-22 404
4a7aaf88c89f12 Jason Gunthorpe 2021-06-11 405 #define QIB_DIAGC_ATTR(N) \
f24a6d4887668c Harish Chegondi 2016-01-22 406 static struct qib_diagc_attr qib_diagc_attr_##N = { \
4a7aaf88c89f12 Jason Gunthorpe 2021-06-11 407 .attr = __ATTR(N, 0664, diagc_attr_show, diagc_attr_store), \
4a7aaf88c89f12 Jason Gunthorpe 2021-06-11 408 .counter = &((struct qib_ibport *)0)->rvp.n_##N - (u64 *)0, \
f931551bafe1f1 Ralph Campbell 2010-05-23 409 }
f931551bafe1f1 Ralph Campbell 2010-05-23 410
f931551bafe1f1 Ralph Campbell 2010-05-23 @411 QIB_DIAGC_ATTR(rc_resends);
f931551bafe1f1 Ralph Campbell 2010-05-23 412 QIB_DIAGC_ATTR(seq_naks);
f931551bafe1f1 Ralph Campbell 2010-05-23 413 QIB_DIAGC_ATTR(rdma_seq);
f931551bafe1f1 Ralph Campbell 2010-05-23 414 QIB_DIAGC_ATTR(rnr_naks);
f931551bafe1f1 Ralph Campbell 2010-05-23 415 QIB_DIAGC_ATTR(other_naks);
f931551bafe1f1 Ralph Campbell 2010-05-23 416 QIB_DIAGC_ATTR(rc_timeouts);
f931551bafe1f1 Ralph Campbell 2010-05-23 417 QIB_DIAGC_ATTR(loop_pkts);
f931551bafe1f1 Ralph Campbell 2010-05-23 418 QIB_DIAGC_ATTR(pkt_drops);
f931551bafe1f1 Ralph Campbell 2010-05-23 419 QIB_DIAGC_ATTR(dmawait);
f931551bafe1f1 Ralph Campbell 2010-05-23 420 QIB_DIAGC_ATTR(unaligned);
f931551bafe1f1 Ralph Campbell 2010-05-23 421 QIB_DIAGC_ATTR(rc_dupreq);
f931551bafe1f1 Ralph Campbell 2010-05-23 422 QIB_DIAGC_ATTR(rc_seqnak);
7199435414868b Kaike Wan 2019-09-11 423 QIB_DIAGC_ATTR(rc_crwaits);
f931551bafe1f1 Ralph Campbell 2010-05-23 424
:::::: The code at line 411 was first introduced by commit
:::::: f931551bafe1f10ded7f5282e2aa162c267a2e5d IB/qib: Add new qib driver for QLogic PCIe InfiniBand adapters
:::::: TO: Ralph Campbell <ralph.campbell@qlogic.com>
:::::: CC: Roland Dreier <rolandd@cisco.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 45690 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* drivers/infiniband/hw/qib/qib_sysfs.c:411:1: warning: performing pointer subtraction with a null pointer has undefined behavior
@ 2021-09-02 14:50 ` kernel test robot
0 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2021-09-02 14:50 UTC (permalink / raw)
To: Jason Gunthorpe; +Cc: llvm, kbuild-all, linux-kernel, Leon Romanovsky
[-- Attachment #1: Type: text/plain, Size: 9521 bytes --]
Hi Jason,
FYI, the error/warning still remains.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 4ac6d90867a4de2e12117e755dbd76e08d88697f
commit: 4a7aaf88c89f12f8048137e274ce0d40fe1056b2 RDMA/qib: Use attributes for the port sysfs
date: 3 months ago
config: x86_64-randconfig-r023-20210902 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project c9948e9254fbb6ea00f66c7b4542311d21e060be)
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/torvalds/linux.git/commit/?id=4a7aaf88c89f12f8048137e274ce0d40fe1056b2
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 4a7aaf88c89f12f8048137e274ce0d40fe1056b2
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> drivers/infiniband/hw/qib/qib_sysfs.c:411:1: warning: performing pointer subtraction with a null pointer has undefined behavior [-Wnull-pointer-subtraction]
QIB_DIAGC_ATTR(rc_resends);
^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:408:51: note: expanded from macro 'QIB_DIAGC_ATTR'
.counter = &((struct qib_ibport *)0)->rvp.n_##N - (u64 *)0, \
^ ~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:412:1: warning: performing pointer subtraction with a null pointer has undefined behavior [-Wnull-pointer-subtraction]
QIB_DIAGC_ATTR(seq_naks);
^~~~~~~~~~~~~~~~~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:408:51: note: expanded from macro 'QIB_DIAGC_ATTR'
.counter = &((struct qib_ibport *)0)->rvp.n_##N - (u64 *)0, \
^ ~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:413:1: warning: performing pointer subtraction with a null pointer has undefined behavior [-Wnull-pointer-subtraction]
QIB_DIAGC_ATTR(rdma_seq);
^~~~~~~~~~~~~~~~~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:408:51: note: expanded from macro 'QIB_DIAGC_ATTR'
.counter = &((struct qib_ibport *)0)->rvp.n_##N - (u64 *)0, \
^ ~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:414:1: warning: performing pointer subtraction with a null pointer has undefined behavior [-Wnull-pointer-subtraction]
QIB_DIAGC_ATTR(rnr_naks);
^~~~~~~~~~~~~~~~~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:408:51: note: expanded from macro 'QIB_DIAGC_ATTR'
.counter = &((struct qib_ibport *)0)->rvp.n_##N - (u64 *)0, \
^ ~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:415:1: warning: performing pointer subtraction with a null pointer has undefined behavior [-Wnull-pointer-subtraction]
QIB_DIAGC_ATTR(other_naks);
^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:408:51: note: expanded from macro 'QIB_DIAGC_ATTR'
.counter = &((struct qib_ibport *)0)->rvp.n_##N - (u64 *)0, \
^ ~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:416:1: warning: performing pointer subtraction with a null pointer has undefined behavior [-Wnull-pointer-subtraction]
QIB_DIAGC_ATTR(rc_timeouts);
^~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:408:51: note: expanded from macro 'QIB_DIAGC_ATTR'
.counter = &((struct qib_ibport *)0)->rvp.n_##N - (u64 *)0, \
^ ~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:417:1: warning: performing pointer subtraction with a null pointer has undefined behavior [-Wnull-pointer-subtraction]
QIB_DIAGC_ATTR(loop_pkts);
^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:408:51: note: expanded from macro 'QIB_DIAGC_ATTR'
.counter = &((struct qib_ibport *)0)->rvp.n_##N - (u64 *)0, \
^ ~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:418:1: warning: performing pointer subtraction with a null pointer has undefined behavior [-Wnull-pointer-subtraction]
QIB_DIAGC_ATTR(pkt_drops);
^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:408:51: note: expanded from macro 'QIB_DIAGC_ATTR'
.counter = &((struct qib_ibport *)0)->rvp.n_##N - (u64 *)0, \
^ ~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:419:1: warning: performing pointer subtraction with a null pointer has undefined behavior [-Wnull-pointer-subtraction]
QIB_DIAGC_ATTR(dmawait);
^~~~~~~~~~~~~~~~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:408:51: note: expanded from macro 'QIB_DIAGC_ATTR'
.counter = &((struct qib_ibport *)0)->rvp.n_##N - (u64 *)0, \
^ ~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:420:1: warning: performing pointer subtraction with a null pointer has undefined behavior [-Wnull-pointer-subtraction]
QIB_DIAGC_ATTR(unaligned);
^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:408:51: note: expanded from macro 'QIB_DIAGC_ATTR'
.counter = &((struct qib_ibport *)0)->rvp.n_##N - (u64 *)0, \
^ ~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:421:1: warning: performing pointer subtraction with a null pointer has undefined behavior [-Wnull-pointer-subtraction]
QIB_DIAGC_ATTR(rc_dupreq);
^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:408:51: note: expanded from macro 'QIB_DIAGC_ATTR'
.counter = &((struct qib_ibport *)0)->rvp.n_##N - (u64 *)0, \
^ ~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:422:1: warning: performing pointer subtraction with a null pointer has undefined behavior [-Wnull-pointer-subtraction]
QIB_DIAGC_ATTR(rc_seqnak);
^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:408:51: note: expanded from macro 'QIB_DIAGC_ATTR'
.counter = &((struct qib_ibport *)0)->rvp.n_##N - (u64 *)0, \
^ ~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:423:1: warning: performing pointer subtraction with a null pointer has undefined behavior [-Wnull-pointer-subtraction]
QIB_DIAGC_ATTR(rc_crwaits);
^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:408:51: note: expanded from macro 'QIB_DIAGC_ATTR'
.counter = &((struct qib_ibport *)0)->rvp.n_##N - (u64 *)0, \
^ ~~~~~~~~
13 warnings generated.
vim +411 drivers/infiniband/hw/qib/qib_sysfs.c
f24a6d4887668c Harish Chegondi 2016-01-22 404
4a7aaf88c89f12 Jason Gunthorpe 2021-06-11 405 #define QIB_DIAGC_ATTR(N) \
f24a6d4887668c Harish Chegondi 2016-01-22 406 static struct qib_diagc_attr qib_diagc_attr_##N = { \
4a7aaf88c89f12 Jason Gunthorpe 2021-06-11 407 .attr = __ATTR(N, 0664, diagc_attr_show, diagc_attr_store), \
4a7aaf88c89f12 Jason Gunthorpe 2021-06-11 408 .counter = &((struct qib_ibport *)0)->rvp.n_##N - (u64 *)0, \
f931551bafe1f1 Ralph Campbell 2010-05-23 409 }
f931551bafe1f1 Ralph Campbell 2010-05-23 410
f931551bafe1f1 Ralph Campbell 2010-05-23 @411 QIB_DIAGC_ATTR(rc_resends);
f931551bafe1f1 Ralph Campbell 2010-05-23 412 QIB_DIAGC_ATTR(seq_naks);
f931551bafe1f1 Ralph Campbell 2010-05-23 413 QIB_DIAGC_ATTR(rdma_seq);
f931551bafe1f1 Ralph Campbell 2010-05-23 414 QIB_DIAGC_ATTR(rnr_naks);
f931551bafe1f1 Ralph Campbell 2010-05-23 415 QIB_DIAGC_ATTR(other_naks);
f931551bafe1f1 Ralph Campbell 2010-05-23 416 QIB_DIAGC_ATTR(rc_timeouts);
f931551bafe1f1 Ralph Campbell 2010-05-23 417 QIB_DIAGC_ATTR(loop_pkts);
f931551bafe1f1 Ralph Campbell 2010-05-23 418 QIB_DIAGC_ATTR(pkt_drops);
f931551bafe1f1 Ralph Campbell 2010-05-23 419 QIB_DIAGC_ATTR(dmawait);
f931551bafe1f1 Ralph Campbell 2010-05-23 420 QIB_DIAGC_ATTR(unaligned);
f931551bafe1f1 Ralph Campbell 2010-05-23 421 QIB_DIAGC_ATTR(rc_dupreq);
f931551bafe1f1 Ralph Campbell 2010-05-23 422 QIB_DIAGC_ATTR(rc_seqnak);
7199435414868b Kaike Wan 2019-09-11 423 QIB_DIAGC_ATTR(rc_crwaits);
f931551bafe1f1 Ralph Campbell 2010-05-23 424
:::::: The code at line 411 was first introduced by commit
:::::: f931551bafe1f10ded7f5282e2aa162c267a2e5d IB/qib: Add new qib driver for QLogic PCIe InfiniBand adapters
:::::: TO: Ralph Campbell <ralph.campbell@qlogic.com>
:::::: CC: Roland Dreier <rolandd@cisco.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: 42879 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* drivers/infiniband/hw/qib/qib_sysfs.c:411:1: warning: performing pointer subtraction with a null pointer has undefined behavior
@ 2021-09-02 14:50 ` kernel test robot
0 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2021-09-02 14:50 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 9662 bytes --]
Hi Jason,
FYI, the error/warning still remains.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 4ac6d90867a4de2e12117e755dbd76e08d88697f
commit: 4a7aaf88c89f12f8048137e274ce0d40fe1056b2 RDMA/qib: Use attributes for the port sysfs
date: 3 months ago
config: x86_64-randconfig-r023-20210902 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project c9948e9254fbb6ea00f66c7b4542311d21e060be)
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/torvalds/linux.git/commit/?id=4a7aaf88c89f12f8048137e274ce0d40fe1056b2
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 4a7aaf88c89f12f8048137e274ce0d40fe1056b2
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> drivers/infiniband/hw/qib/qib_sysfs.c:411:1: warning: performing pointer subtraction with a null pointer has undefined behavior [-Wnull-pointer-subtraction]
QIB_DIAGC_ATTR(rc_resends);
^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:408:51: note: expanded from macro 'QIB_DIAGC_ATTR'
.counter = &((struct qib_ibport *)0)->rvp.n_##N - (u64 *)0, \
^ ~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:412:1: warning: performing pointer subtraction with a null pointer has undefined behavior [-Wnull-pointer-subtraction]
QIB_DIAGC_ATTR(seq_naks);
^~~~~~~~~~~~~~~~~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:408:51: note: expanded from macro 'QIB_DIAGC_ATTR'
.counter = &((struct qib_ibport *)0)->rvp.n_##N - (u64 *)0, \
^ ~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:413:1: warning: performing pointer subtraction with a null pointer has undefined behavior [-Wnull-pointer-subtraction]
QIB_DIAGC_ATTR(rdma_seq);
^~~~~~~~~~~~~~~~~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:408:51: note: expanded from macro 'QIB_DIAGC_ATTR'
.counter = &((struct qib_ibport *)0)->rvp.n_##N - (u64 *)0, \
^ ~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:414:1: warning: performing pointer subtraction with a null pointer has undefined behavior [-Wnull-pointer-subtraction]
QIB_DIAGC_ATTR(rnr_naks);
^~~~~~~~~~~~~~~~~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:408:51: note: expanded from macro 'QIB_DIAGC_ATTR'
.counter = &((struct qib_ibport *)0)->rvp.n_##N - (u64 *)0, \
^ ~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:415:1: warning: performing pointer subtraction with a null pointer has undefined behavior [-Wnull-pointer-subtraction]
QIB_DIAGC_ATTR(other_naks);
^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:408:51: note: expanded from macro 'QIB_DIAGC_ATTR'
.counter = &((struct qib_ibport *)0)->rvp.n_##N - (u64 *)0, \
^ ~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:416:1: warning: performing pointer subtraction with a null pointer has undefined behavior [-Wnull-pointer-subtraction]
QIB_DIAGC_ATTR(rc_timeouts);
^~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:408:51: note: expanded from macro 'QIB_DIAGC_ATTR'
.counter = &((struct qib_ibport *)0)->rvp.n_##N - (u64 *)0, \
^ ~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:417:1: warning: performing pointer subtraction with a null pointer has undefined behavior [-Wnull-pointer-subtraction]
QIB_DIAGC_ATTR(loop_pkts);
^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:408:51: note: expanded from macro 'QIB_DIAGC_ATTR'
.counter = &((struct qib_ibport *)0)->rvp.n_##N - (u64 *)0, \
^ ~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:418:1: warning: performing pointer subtraction with a null pointer has undefined behavior [-Wnull-pointer-subtraction]
QIB_DIAGC_ATTR(pkt_drops);
^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:408:51: note: expanded from macro 'QIB_DIAGC_ATTR'
.counter = &((struct qib_ibport *)0)->rvp.n_##N - (u64 *)0, \
^ ~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:419:1: warning: performing pointer subtraction with a null pointer has undefined behavior [-Wnull-pointer-subtraction]
QIB_DIAGC_ATTR(dmawait);
^~~~~~~~~~~~~~~~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:408:51: note: expanded from macro 'QIB_DIAGC_ATTR'
.counter = &((struct qib_ibport *)0)->rvp.n_##N - (u64 *)0, \
^ ~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:420:1: warning: performing pointer subtraction with a null pointer has undefined behavior [-Wnull-pointer-subtraction]
QIB_DIAGC_ATTR(unaligned);
^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:408:51: note: expanded from macro 'QIB_DIAGC_ATTR'
.counter = &((struct qib_ibport *)0)->rvp.n_##N - (u64 *)0, \
^ ~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:421:1: warning: performing pointer subtraction with a null pointer has undefined behavior [-Wnull-pointer-subtraction]
QIB_DIAGC_ATTR(rc_dupreq);
^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:408:51: note: expanded from macro 'QIB_DIAGC_ATTR'
.counter = &((struct qib_ibport *)0)->rvp.n_##N - (u64 *)0, \
^ ~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:422:1: warning: performing pointer subtraction with a null pointer has undefined behavior [-Wnull-pointer-subtraction]
QIB_DIAGC_ATTR(rc_seqnak);
^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:408:51: note: expanded from macro 'QIB_DIAGC_ATTR'
.counter = &((struct qib_ibport *)0)->rvp.n_##N - (u64 *)0, \
^ ~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:423:1: warning: performing pointer subtraction with a null pointer has undefined behavior [-Wnull-pointer-subtraction]
QIB_DIAGC_ATTR(rc_crwaits);
^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/infiniband/hw/qib/qib_sysfs.c:408:51: note: expanded from macro 'QIB_DIAGC_ATTR'
.counter = &((struct qib_ibport *)0)->rvp.n_##N - (u64 *)0, \
^ ~~~~~~~~
13 warnings generated.
vim +411 drivers/infiniband/hw/qib/qib_sysfs.c
f24a6d4887668c Harish Chegondi 2016-01-22 404
4a7aaf88c89f12 Jason Gunthorpe 2021-06-11 405 #define QIB_DIAGC_ATTR(N) \
f24a6d4887668c Harish Chegondi 2016-01-22 406 static struct qib_diagc_attr qib_diagc_attr_##N = { \
4a7aaf88c89f12 Jason Gunthorpe 2021-06-11 407 .attr = __ATTR(N, 0664, diagc_attr_show, diagc_attr_store), \
4a7aaf88c89f12 Jason Gunthorpe 2021-06-11 408 .counter = &((struct qib_ibport *)0)->rvp.n_##N - (u64 *)0, \
f931551bafe1f1 Ralph Campbell 2010-05-23 409 }
f931551bafe1f1 Ralph Campbell 2010-05-23 410
f931551bafe1f1 Ralph Campbell 2010-05-23 @411 QIB_DIAGC_ATTR(rc_resends);
f931551bafe1f1 Ralph Campbell 2010-05-23 412 QIB_DIAGC_ATTR(seq_naks);
f931551bafe1f1 Ralph Campbell 2010-05-23 413 QIB_DIAGC_ATTR(rdma_seq);
f931551bafe1f1 Ralph Campbell 2010-05-23 414 QIB_DIAGC_ATTR(rnr_naks);
f931551bafe1f1 Ralph Campbell 2010-05-23 415 QIB_DIAGC_ATTR(other_naks);
f931551bafe1f1 Ralph Campbell 2010-05-23 416 QIB_DIAGC_ATTR(rc_timeouts);
f931551bafe1f1 Ralph Campbell 2010-05-23 417 QIB_DIAGC_ATTR(loop_pkts);
f931551bafe1f1 Ralph Campbell 2010-05-23 418 QIB_DIAGC_ATTR(pkt_drops);
f931551bafe1f1 Ralph Campbell 2010-05-23 419 QIB_DIAGC_ATTR(dmawait);
f931551bafe1f1 Ralph Campbell 2010-05-23 420 QIB_DIAGC_ATTR(unaligned);
f931551bafe1f1 Ralph Campbell 2010-05-23 421 QIB_DIAGC_ATTR(rc_dupreq);
f931551bafe1f1 Ralph Campbell 2010-05-23 422 QIB_DIAGC_ATTR(rc_seqnak);
7199435414868b Kaike Wan 2019-09-11 423 QIB_DIAGC_ATTR(rc_crwaits);
f931551bafe1f1 Ralph Campbell 2010-05-23 424
:::::: The code at line 411 was first introduced by commit
:::::: f931551bafe1f10ded7f5282e2aa162c267a2e5d IB/qib: Add new qib driver for QLogic PCIe InfiniBand adapters
:::::: TO: Ralph Campbell <ralph.campbell@qlogic.com>
:::::: CC: Roland Dreier <rolandd@cisco.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 42879 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-09-02 14:51 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-21 4:44 drivers/infiniband/hw/qib/qib_sysfs.c:411:1: warning: performing pointer subtraction with a null pointer has undefined behavior kernel test robot
2021-07-21 4:44 ` kernel test robot
2021-09-02 14:50 kernel test robot
2021-09-02 14:50 ` kernel test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.