lib: checksum: hide unused expected_csum_ipv6_magic[]
authorArnd Bergmann <arnd@arndb.de>
Thu, 4 Apr 2024 16:36:45 +0000 (18:36 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 8 Apr 2024 10:03:05 +0000 (11:03 +0100)
commite9d47b7b31563a6524b9f64ea70ed0289cc4d9c4
treecf5c61fc6a504b0209e302c6cd9e316543d0d949
parentbccb798e07f8bb8b91212fe8ed1e421685449076
lib: checksum: hide unused expected_csum_ipv6_magic[]

When CONFIG_NET is disabled, an extra warning shows up for this
unused variable:

lib/checksum_kunit.c:218:18: error: 'expected_csum_ipv6_magic' defined but not used [-Werror=unused-const-variable=]

Replace the #ifdef with an IS_ENABLED() check that makes the compiler's
dead-code-elimination take care of the link failure.

Fixes: f24a70106dc1 ("lib: checksum: Fix build with CONFIG_NET=n")
Suggested-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Acked-by: Palmer Dabbelt <palmer@rivosinc.com>
Acked-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Simon Horman <horms@kernel.org>
Tested-by: Simon Horman <horms@kernel.org> # build-tested
Signed-off-by: David S. Miller <davem@davemloft.net>
lib/checksum_kunit.c