aboutsummaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/progs/test_autoload.c
diff options
context:
space:
mode:
authorAndy Shevchenko <[email protected]>2023-12-08 17:33:27 +0200
committerPaolo Abeni <[email protected]>2023-12-12 11:25:36 +0100
commit68cbdb150d55834ed0a52352684ba2cc554c8a08 (patch)
tree6a466302a9170e976eafe8fe5a6cc134e3e4088d /tools/testing/selftests/bpf/progs/test_autoload.c
parent68c84289bcc0dc75c1d27caccb55134e8d39dcc2 (diff)
net: dl2k: Use proper conversion of dev_addr before IO to device
The driver is using iowriteXX()/ioreadXX() APIs which are LE IO accessors simplified as 1. Convert given value _from_ CPU _to_ LE 2. Write it to the device as is The dev_addr is a byte stream, but because the driver uses 16-bit IO accessors, it wants to perform double conversion on BE CPUs, but it took it wrong, as it effectivelly does two times _from_ CPU _to_ LE. What it has to do is to consider dev_addr as an array of LE16 and hence do _from_ LE _to_ CPU conversion, followed by implied _from_ CPU _to_ LE in the iowrite16(). To achieve that, use get_unaligned_le16(). This will make it correct and allows to avoid sparse warning as reported by LKP. Reported-by: kernel test robot <[email protected]> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Signed-off-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
Diffstat (limited to 'tools/testing/selftests/bpf/progs/test_autoload.c')
0 files changed, 0 insertions, 0 deletions