* [PATCH] [v2] lib: checksum: hide unused expected_csum_ipv6_magic[]
@ 2024-04-04 11:44 Arnd Bergmann
2024-04-04 15:01 ` Jakub Kicinski
0 siblings, 1 reply; 7+ messages in thread
From: Arnd Bergmann @ 2024-04-04 11:44 UTC (permalink / raw)
To: Andrew Morton, Palmer Dabbelt
Cc: Arnd Bergmann, Christophe Leroy, Paolo Abeni, Jakub Kicinski,
Charlie Jenkins, Noah Goldstein, linux-kernel
From: Arnd Bergmann <arnd@arndb.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=]
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>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
lib/checksum_kunit.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/lib/checksum_kunit.c b/lib/checksum_kunit.c
index bf70850035c7..404dba36bae3 100644
--- a/lib/checksum_kunit.c
+++ b/lib/checksum_kunit.c
@@ -594,13 +594,15 @@ static void test_ip_fast_csum(struct kunit *test)
static void test_csum_ipv6_magic(struct kunit *test)
{
-#if defined(CONFIG_NET)
const struct in6_addr *saddr;
const struct in6_addr *daddr;
unsigned int len;
unsigned char proto;
__wsum csum;
+ if (!IS_ENABLED(CONFIG_NET))
+ return;
+
const int daddr_offset = sizeof(struct in6_addr);
const int len_offset = sizeof(struct in6_addr) + sizeof(struct in6_addr);
const int proto_offset = sizeof(struct in6_addr) + sizeof(struct in6_addr) +
@@ -618,7 +620,6 @@ static void test_csum_ipv6_magic(struct kunit *test)
CHECK_EQ(to_sum16(expected_csum_ipv6_magic[i]),
csum_ipv6_magic(saddr, daddr, len, proto, csum));
}
-#endif /* !CONFIG_NET */
}
static struct kunit_case __refdata checksum_test_cases[] = {
--
2.39.2
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH] [v2] lib: checksum: hide unused expected_csum_ipv6_magic[]
2024-04-04 11:44 [PATCH] [v2] lib: checksum: hide unused expected_csum_ipv6_magic[] Arnd Bergmann
@ 2024-04-04 15:01 ` Jakub Kicinski
2024-04-04 16:23 ` Palmer Dabbelt
0 siblings, 1 reply; 7+ messages in thread
From: Jakub Kicinski @ 2024-04-04 15:01 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Andrew Morton, Palmer Dabbelt, Arnd Bergmann, Christophe Leroy,
Paolo Abeni, Charlie Jenkins, Noah Goldstein, linux-kernel
On Thu, 4 Apr 2024 13:44:33 +0200 Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> When CONFIG_NET is disabled, an extra warning shows up for this
> unused variable:
Happy for others to take this, but to avoid misunderstandings -
if it's not on netdev@ we won't be able to apply.
Acked-by: Jakub Kicinski <kuba@kernel.org>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] [v2] lib: checksum: hide unused expected_csum_ipv6_magic[]
2024-04-04 15:01 ` Jakub Kicinski
@ 2024-04-04 16:23 ` Palmer Dabbelt
2024-04-04 16:29 ` Jakub Kicinski
0 siblings, 1 reply; 7+ messages in thread
From: Palmer Dabbelt @ 2024-04-04 16:23 UTC (permalink / raw)
To: kuba
Cc: arnd, akpm, Arnd Bergmann, christophe.leroy, pabeni,
Charlie Jenkins, goldstein.w.n, linux-kernel
On Thu, 04 Apr 2024 08:01:32 PDT (-0700), kuba@kernel.org wrote:
> On Thu, 4 Apr 2024 13:44:33 +0200 Arnd Bergmann wrote:
>> From: Arnd Bergmann <arnd@arndb.de>
>>
>> When CONFIG_NET is disabled, an extra warning shows up for this
>> unused variable:
>
> Happy for others to take this, but to avoid misunderstandings -
> if it's not on netdev@ we won't be able to apply.
>
> Acked-by: Jakub Kicinski <kuba@kernel.org>
Acked-by: Palmer Dabbelt <palmer@rivosinc.com>
Looks like you took the last one, do we need to just CC
netdev@vger.kernel.org ?
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] [v2] lib: checksum: hide unused expected_csum_ipv6_magic[]
2024-04-04 16:23 ` Palmer Dabbelt
@ 2024-04-04 16:29 ` Jakub Kicinski
0 siblings, 0 replies; 7+ messages in thread
From: Jakub Kicinski @ 2024-04-04 16:29 UTC (permalink / raw)
To: Palmer Dabbelt
Cc: arnd, akpm, Arnd Bergmann, christophe.leroy, pabeni,
Charlie Jenkins, goldstein.w.n, linux-kernel
On Thu, 04 Apr 2024 09:23:57 -0700 (PDT) Palmer Dabbelt wrote:
> > Acked-by: Jakub Kicinski <kuba@kernel.org>
>
> Acked-by: Palmer Dabbelt <palmer@rivosinc.com>
>
> Looks like you took the last one, do we need to just CC
> netdev@vger.kernel.org ?
Yes, Arnd would need to resend to get it into our patchwork.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v2] lib: checksum: hide unused expected_csum_ipv6_magic[]
@ 2024-04-04 16:36 Arnd Bergmann
2024-04-08 7:49 ` Simon Horman
2024-04-08 10:10 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 7+ messages in thread
From: Arnd Bergmann @ 2024-04-04 16:36 UTC (permalink / raw)
To: netdev
Cc: Arnd Bergmann, Christophe Leroy, Palmer Dabbelt, Jakub Kicinski,
Andrew Morton, Paolo Abeni, Charlie Jenkins, Noah Goldstein,
linux-kernel
From: Arnd Bergmann <arnd@arndb.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=]
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>
---
resending v2 to netdev
lib/checksum_kunit.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/lib/checksum_kunit.c b/lib/checksum_kunit.c
index bf70850035c7..404dba36bae3 100644
--- a/lib/checksum_kunit.c
+++ b/lib/checksum_kunit.c
@@ -594,13 +594,15 @@ static void test_ip_fast_csum(struct kunit *test)
static void test_csum_ipv6_magic(struct kunit *test)
{
-#if defined(CONFIG_NET)
const struct in6_addr *saddr;
const struct in6_addr *daddr;
unsigned int len;
unsigned char proto;
__wsum csum;
+ if (!IS_ENABLED(CONFIG_NET))
+ return;
+
const int daddr_offset = sizeof(struct in6_addr);
const int len_offset = sizeof(struct in6_addr) + sizeof(struct in6_addr);
const int proto_offset = sizeof(struct in6_addr) + sizeof(struct in6_addr) +
@@ -618,7 +620,6 @@ static void test_csum_ipv6_magic(struct kunit *test)
CHECK_EQ(to_sum16(expected_csum_ipv6_magic[i]),
csum_ipv6_magic(saddr, daddr, len, proto, csum));
}
-#endif /* !CONFIG_NET */
}
static struct kunit_case __refdata checksum_test_cases[] = {
--
2.39.2
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH v2] lib: checksum: hide unused expected_csum_ipv6_magic[]
2024-04-04 16:36 [PATCH v2] " Arnd Bergmann
@ 2024-04-08 7:49 ` Simon Horman
2024-04-08 10:10 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 7+ messages in thread
From: Simon Horman @ 2024-04-08 7:49 UTC (permalink / raw)
To: Arnd Bergmann
Cc: netdev, Arnd Bergmann, Christophe Leroy, Palmer Dabbelt,
Jakub Kicinski, Andrew Morton, Paolo Abeni, Charlie Jenkins,
Noah Goldstein, linux-kernel
On Thu, Apr 04, 2024 at 06:36:45PM +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.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=]
>
> 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>
> ---
> resending v2 to netdev
Reviewed-by: Simon Horman <horms@kernel.org>
Tested-by: Simon Horman <horms@kernel.org> # build-tested
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH v2] lib: checksum: hide unused expected_csum_ipv6_magic[]
2024-04-04 16:36 [PATCH v2] " Arnd Bergmann
2024-04-08 7:49 ` Simon Horman
@ 2024-04-08 10:10 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 7+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-04-08 10:10 UTC (permalink / raw)
To: Arnd Bergmann
Cc: netdev, arnd, christophe.leroy, palmer, kuba, akpm, pabeni,
charlie, goldstein.w.n, linux-kernel
Hello:
This patch was applied to netdev/net.git (main)
by David S. Miller <davem@davemloft.net>:
On Thu, 4 Apr 2024 18:36:45 +0200 you wrote:
> From: Arnd Bergmann <arnd@arndb.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=]
>
> [...]
Here is the summary with links:
- [v2] lib: checksum: hide unused expected_csum_ipv6_magic[]
https://git.kernel.org/netdev/net/c/e9d47b7b3156
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2024-04-08 10:10 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-04 11:44 [PATCH] [v2] lib: checksum: hide unused expected_csum_ipv6_magic[] Arnd Bergmann
2024-04-04 15:01 ` Jakub Kicinski
2024-04-04 16:23 ` Palmer Dabbelt
2024-04-04 16:29 ` Jakub Kicinski
-- strict thread matches above, loose matches on Subject: below --
2024-04-04 16:36 [PATCH v2] " Arnd Bergmann
2024-04-08 7:49 ` Simon Horman
2024-04-08 10:10 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox