[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240403080702.3509288-19-arnd@kernel.org>
Date: Wed, 3 Apr 2024 10:06:36 +0200
From: Arnd Bergmann <arnd@...nel.org>
To: linux-kernel@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>,
Palmer Dabbelt <palmer@...osinc.com>
Cc: Arnd Bergmann <arnd@...db.de>,
Christophe Leroy <christophe.leroy@...roup.eu>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Noah Goldstein <goldstein.w.n@...il.com>,
Charlie Jenkins <charlie@...osinc.com>
Subject: [PATCH 18/34] lib: checksum: hide unused expected_csum_ipv6_magic[]
From: Arnd Bergmann <arnd@...db.de>
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=]
Hide it under the same #ifdef as the reference to it.
Fixes: f24a70106dc1 ("lib: checksum: Fix build with CONFIG_NET=n")
Signed-off-by: Arnd Bergmann <arnd@...db.de>
---
lib/checksum_kunit.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lib/checksum_kunit.c b/lib/checksum_kunit.c
index bf70850035c7..80dd1e1b71ba 100644
--- a/lib/checksum_kunit.c
+++ b/lib/checksum_kunit.c
@@ -215,6 +215,7 @@ static const u32 init_sums_no_overflow[] = {
0xffff0000, 0xfffffffb,
};
+#ifdef CONFIG_NET
static const u16 expected_csum_ipv6_magic[] = {
0x18d4, 0x3085, 0x2e4b, 0xd9f4, 0xbdc8, 0x78f, 0x1034, 0x8422, 0x6fc0,
0xd2f6, 0xbeb5, 0x9d3, 0x7e2a, 0x312e, 0x778e, 0xc1bb, 0x7cf2, 0x9d1e,
@@ -240,6 +241,7 @@ static const u16 expected_csum_ipv6_magic[] = {
0x99aa, 0xb06b, 0xee19, 0xcc2c, 0xf34c, 0x7c49, 0xdac3, 0xa71e, 0xc988,
0x3845, 0x1014
};
+#endif
static const u16 expected_fast_csum[] = {
0xda83, 0x45da, 0x4f46, 0x4e4f, 0x34e, 0xe902, 0xa5e9, 0x87a5, 0x7187,
--
2.39.2
Powered by blists - more mailing lists