kunit: Fix again checksum tests on big endian CPUs
authorChristophe Leroy <christophe.leroy@csgroup.eu>
Fri, 23 Feb 2024 10:41:52 +0000 (11:41 +0100)
committerJakub Kicinski <kuba@kernel.org>
Thu, 29 Feb 2024 17:16:02 +0000 (09:16 -0800)
commit3d6423ef8d517e8924bec3f22c40285a90d652f3
tree807f9d0b1fe0908c84cc05d356844a8ca15507c5
parent244b96c2310ef7bba7569bbaca1633feea627af9
kunit: Fix again checksum tests on big endian CPUs

Commit b38460bc463c ("kunit: Fix checksum tests on big endian CPUs")
fixed endianness issues with kunit checksum tests, but then
commit 6f4c45cbcb00 ("kunit: Add tests for csum_ipv6_magic and
ip_fast_csum") introduced new issues on big endian CPUs. Those issues
are once again reflected by the warnings reported by sparse.

So, fix them with the same approach, perform proper conversion in
order to support both little and big endian CPUs. Once the conversions
are properly done and the right types used, the sparse warnings are
cleared as well.

Reported-by: Erhard Furtner <erhard_f@mailbox.org>
Fixes: 6f4c45cbcb00 ("kunit: Add tests for csum_ipv6_magic and ip_fast_csum")
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Tested-by: Charlie Jenkins <charlie@rivosinc.com>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Paolo Abeni <pabeni@redhat.com>
Acked-by: Palmer Dabbelt <palmer@rivosinc.com>
Link: https://lore.kernel.org/r/73df3a9e95c2179119398ad1b4c84cdacbd8dfb6.1708684443.git.christophe.leroy@csgroup.eu
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
lib/checksum_kunit.c