diff options
author | Arnd Bergmann <[email protected]> | 2021-09-27 11:37:57 +0200 |
---|---|---|
committer | David S. Miller <[email protected]> | 2021-09-28 13:06:09 +0100 |
commit | 861f40fa0edfe38806a2a6e7201bfed821906d2d (patch) | |
tree | 2d573aeba135fb31030b80e1ed6ad22719944292 /tools/perf/scripts/python/libxed.py | |
parent | f43bed7193a36b1b4f73212ee0069f9113816856 (diff) |
am65-cpsw: avoid null pointer arithmetic
clang warns about arithmetic on NULL pointers:
drivers/net/ethernet/ti/am65-cpsw-ethtool.c:71:2: error: performing pointer subtraction with a null pointer has undefined behavior [-Werror,-Wnull-pointer-subtraction]
AM65_CPSW_REGDUMP_REC(AM65_CPSW_REGDUMP_MOD_NUSS, 0x0, 0x1c),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/ti/am65-cpsw-ethtool.c:64:29: note: expanded from macro 'AM65_CPSW_REGDUMP_REC'
.hdr.len = (((u32 *)(end)) - ((u32 *)(start)) + 1) * sizeof(u32) * 2 + \
^ ~~~~~~~~~~~~~~~~
The expression here is easily changed to a calculation based on integers
that is no less readable.
Signed-off-by: Arnd Bergmann <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/libxed.py')
0 files changed, 0 insertions, 0 deletions