diff options
author | Simon Horman <horms@kernel.org> | 2024-10-16 17:31:14 +0300 |
---|---|---|
committer | Andrew Lunn <andrew@lunn.ch> | 2024-10-18 02:09:13 +0300 |
commit | 4b726103796a9058ea77fd0905879ecc04951ef1 (patch) | |
tree | e6aa7867bdceb1fc00908818175aae2811f66ddb /tools/perf/scripts/python/export-to-postgresql.py | |
parent | ff1d3484d6d29dda92421b9a753e4ca54f91aa8a (diff) | |
download | linux-4b726103796a9058ea77fd0905879ecc04951ef1.tar.xz |
net: usb: sr9700: only store little-endian values in __le16 variable
In sr_mdio_read() the local variable res is used to store both
little-endian and host byte order values. This prevents Sparse
from helping us by flagging when endian miss matches occur - the
detection process hinges on the type of variables matching the
byte order of values stored in them.
Address this by adding a new local variable, word, to store little-endian
values; change the type of res to int, and use it to store host-byte
order values.
Flagged by Sparse as:
.../sr9700.c:205:21: warning: incorrect type in assignment (different base types)
.../sr9700.c:205:21: expected restricted __le16 [addressable] [usertype] res
.../sr9700.c:205:21: got int
.../sr9700.c:207:21: warning: incorrect type in assignment (different base types)
.../sr9700.c:207:21: expected restricted __le16 [addressable] [usertype] res
.../sr9700.c:207:21: got int
.../sr9700.c:212:16: warning: incorrect type in return expression (different base types)
.../sr9700.c:212:16: expected int
.../sr9700.c:212:16: got restricted __le16 [addressable] [usertype] res
Compile tested only.
No functional change intended.
Signed-off-by: Simon Horman <horms@kernel.org>
Message-ID: <20241016-blackbird-le16-v1-1-97ba8de6b38f@kernel.org>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions