diff options
author | Jason Gunthorpe <jgg@nvidia.com> | 2021-09-03 10:07:28 -0300 |
---|---|---|
committer | Jason Gunthorpe <jgg@nvidia.com> | 2021-09-08 08:32:04 -0300 |
commit | 84f969e1c48ed3825986e91a0786e363d57f69d1 (patch) | |
tree | fa0df9b7953931d0180dba5e3b507ace303e8909 /tools/perf/scripts/python/futex-contention.py | |
parent | f4c6f31011eafe027abddf6cee1288a1b5a05b73 (diff) |
IB/qib: Fix null pointer subtraction compiler warning
>> 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, \
Use offsetof and accomplish the type check using static_assert.
Fixes: 4a7aaf88c89f ("RDMA/qib: Use attributes for the port sysfs")
Link: https://lore.kernel.org/r/0-v1-43ae3c759177+65-qib_type_jgg@nvidia.com
Reported-by: kernel test robot <lkp@intel.com>
Acked-by: Dennis Dalessandro <dennis.dalessandro@cornelisnetworks.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'tools/perf/scripts/python/futex-contention.py')
0 files changed, 0 insertions, 0 deletions