diff options
author | Murilo Opsfelder Araujo <muriloo@linux.ibm.com> | 2022-04-15 05:30:02 +0300 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2022-05-31 19:45:08 +0300 |
commit | 7e415282b41bf0d15c6e0fe268f822d9b083f2f7 (patch) | |
tree | dcbf07eac881c503ed2582d5645bfa506c8fe837 /tools/perf/scripts/python/exported-sql-viewer.py | |
parent | 7a836a2aba09479c8e71fa43249eecc4af945f61 (diff) | |
download | linux-7e415282b41bf0d15c6e0fe268f822d9b083f2f7.tar.xz |
virtio-pci: Remove wrong address verification in vp_del_vqs()
GCC 12 enhanced -Waddress when comparing array address to null [0],
which warns:
drivers/virtio/virtio_pci_common.c: In function ‘vp_del_vqs’:
drivers/virtio/virtio_pci_common.c:257:29: warning: the comparison will always evaluate as ‘true’ for the pointer operand in ‘vp_dev->msix_affinity_masks + (sizetype)((long unsigned int)i * 256)’ must not be NULL [-Waddress]
257 | if (vp_dev->msix_affinity_masks[i])
| ^~~~~~
In fact, the verification is comparing the result of a pointer
arithmetic, the address "msix_affinity_masks + i", which will always
evaluate to true.
Under the hood, free_cpumask_var() calls kfree(), which is safe to pass
NULL, not requiring non-null verification. So remove the verification
to make compiler happy (happy compiler, happy life).
[0] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102103
Signed-off-by: Murilo Opsfelder Araujo <muriloo@linux.ibm.com>
Message-Id: <20220415023002.49805-1-muriloo@linux.ibm.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Christophe de Dinechin <dinechin@redhat.com>
Diffstat (limited to 'tools/perf/scripts/python/exported-sql-viewer.py')
0 files changed, 0 insertions, 0 deletions