linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] blackhole_dev: Fix buil warning
@ 2024-02-01 13:32 Breno Leitao
  2024-02-01 16:02 ` Jiri Pirko
  2024-02-01 16:55 ` Jakub Kicinski
  0 siblings, 2 replies; 5+ messages in thread
From: Breno Leitao @ 2024-02-01 13:32 UTC (permalink / raw)
  To: kuba, davem, pabeni, edumazet, Andrew Morton, Mahesh Bandewar
  Cc: weiwan, netdev, linux-kernel, horms, andrew, leit

lib/test_blackhole_dev.c sets a variable that is never read, causing
this following building warning:

	lib/test_blackhole_dev.c:32:17: warning: variable 'ethh' set but not used [-Wunused-but-set-variable]

Remove the variable struct ethhdr *ethh, which is unused.

Fixes: 509e56b37cc3 ("blackhole_dev: add a selftest")
Signed-off-by: Breno Leitao <leitao@debian.org>
---
 lib/test_blackhole_dev.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lib/test_blackhole_dev.c b/lib/test_blackhole_dev.c
index 4c40580a99a3..f247089d63c0 100644
--- a/lib/test_blackhole_dev.c
+++ b/lib/test_blackhole_dev.c
@@ -29,7 +29,6 @@ static int __init test_blackholedev_init(void)
 {
 	struct ipv6hdr *ip6h;
 	struct sk_buff *skb;
-	struct ethhdr *ethh;
 	struct udphdr *uh;
 	int data_len;
 	int ret;
@@ -61,7 +60,7 @@ static int __init test_blackholedev_init(void)
 	ip6h->saddr = in6addr_loopback;
 	ip6h->daddr = in6addr_loopback;
 	/* Ether */
-	ethh = (struct ethhdr *)skb_push(skb, sizeof(struct ethhdr));
+	skb_push(skb, sizeof(struct ethhdr));
 	skb_set_mac_header(skb, 0);
 
 	skb->protocol = htons(ETH_P_IPV6);
-- 
2.39.3


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] blackhole_dev: Fix buil warning
  2024-02-01 13:32 [PATCH] blackhole_dev: Fix buil warning Breno Leitao
@ 2024-02-01 16:02 ` Jiri Pirko
  2024-02-01 16:55 ` Jakub Kicinski
  1 sibling, 0 replies; 5+ messages in thread
From: Jiri Pirko @ 2024-02-01 16:02 UTC (permalink / raw)
  To: Breno Leitao
  Cc: kuba, davem, pabeni, edumazet, Andrew Morton, Mahesh Bandewar,
	weiwan, netdev, linux-kernel, horms, andrew, leit

s/buil/build/ in the subject.

Also, indicate which tree are you targetting. In this case, should be:
[patch net-next] xxx


Thu, Feb 01, 2024 at 02:32:37PM CET, leitao@debian.org wrote:
>lib/test_blackhole_dev.c sets a variable that is never read, causing
>this following building warning:
>
>	lib/test_blackhole_dev.c:32:17: warning: variable 'ethh' set but not used [-Wunused-but-set-variable]
>
>Remove the variable struct ethhdr *ethh, which is unused.
>
>Fixes: 509e56b37cc3 ("blackhole_dev: add a selftest")
>Signed-off-by: Breno Leitao <leitao@debian.org>

The patch itself looks good. Feel free to attach
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
with the v2 with fixed subject. Thanks!


>---
> lib/test_blackhole_dev.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
>diff --git a/lib/test_blackhole_dev.c b/lib/test_blackhole_dev.c
>index 4c40580a99a3..f247089d63c0 100644
>--- a/lib/test_blackhole_dev.c
>+++ b/lib/test_blackhole_dev.c
>@@ -29,7 +29,6 @@ static int __init test_blackholedev_init(void)
> {
> 	struct ipv6hdr *ip6h;
> 	struct sk_buff *skb;
>-	struct ethhdr *ethh;
> 	struct udphdr *uh;
> 	int data_len;
> 	int ret;
>@@ -61,7 +60,7 @@ static int __init test_blackholedev_init(void)
> 	ip6h->saddr = in6addr_loopback;
> 	ip6h->daddr = in6addr_loopback;
> 	/* Ether */
>-	ethh = (struct ethhdr *)skb_push(skb, sizeof(struct ethhdr));
>+	skb_push(skb, sizeof(struct ethhdr));
> 	skb_set_mac_header(skb, 0);
> 
> 	skb->protocol = htons(ETH_P_IPV6);
>-- 
>2.39.3
>
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] blackhole_dev: Fix buil warning
  2024-02-01 13:32 [PATCH] blackhole_dev: Fix buil warning Breno Leitao
  2024-02-01 16:02 ` Jiri Pirko
@ 2024-02-01 16:55 ` Jakub Kicinski
  2024-02-01 18:46   ` Breno Leitao
  1 sibling, 1 reply; 5+ messages in thread
From: Jakub Kicinski @ 2024-02-01 16:55 UTC (permalink / raw)
  To: Breno Leitao
  Cc: davem, pabeni, edumazet, Andrew Morton, Mahesh Bandewar, weiwan,
	netdev, linux-kernel, horms, andrew, leit

On Thu,  1 Feb 2024 05:32:37 -0800 Breno Leitao wrote:
> Subject: [PATCH] blackhole_dev: Fix buil warning

Since Jiri suggested a title fix I reckon we should be a bit more
specific, still. Imagine this title ending up in a quote or a Fixes
tag, could be many things.. How about:

  net: blackhole_dev: fix build warning for ethh set but not used

?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] blackhole_dev: Fix buil warning
  2024-02-01 16:55 ` Jakub Kicinski
@ 2024-02-01 18:46   ` Breno Leitao
  2024-02-01 19:40     ` Jakub Kicinski
  0 siblings, 1 reply; 5+ messages in thread
From: Breno Leitao @ 2024-02-01 18:46 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: davem, pabeni, edumazet, Andrew Morton, Mahesh Bandewar, weiwan,
	netdev, linux-kernel, horms, andrew, leit

On Thu, Feb 01, 2024 at 08:55:09AM -0800, Jakub Kicinski wrote:
> On Thu,  1 Feb 2024 05:32:37 -0800 Breno Leitao wrote:
> > Subject: [PATCH] blackhole_dev: Fix buil warning
> 
> Since Jiri suggested a title fix I reckon we should be a bit more
> specific, still. Imagine this title ending up in a quote or a Fixes
> tag, could be many things.. How about:
> 
>   net: blackhole_dev: fix build warning for ethh set but not used

Sure, let me resend it.

I suppose I should recent to `net` given it is a building warning,
right?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] blackhole_dev: Fix buil warning
  2024-02-01 18:46   ` Breno Leitao
@ 2024-02-01 19:40     ` Jakub Kicinski
  0 siblings, 0 replies; 5+ messages in thread
From: Jakub Kicinski @ 2024-02-01 19:40 UTC (permalink / raw)
  To: Breno Leitao
  Cc: davem, pabeni, edumazet, Andrew Morton, Mahesh Bandewar, weiwan,
	netdev, linux-kernel, horms, andrew, leit

On Thu, 1 Feb 2024 10:46:08 -0800 Breno Leitao wrote:
> > Since Jiri suggested a title fix I reckon we should be a bit more
> > specific, still. Imagine this title ending up in a quote or a Fixes
> > tag, could be many things.. How about:
> > 
> >   net: blackhole_dev: fix build warning for ethh set but not used  
> 
> Sure, let me resend it.
> 
> I suppose I should recent to `net` given it is a building warning,
> right?

Not necessarily, net-next is good enough for W=1 warnings in general.
Compiler warnings only show up if the file in question or some header
it includes was modified. The linker warnings are a bit special.
If you touch any file in any module you'll see all linker warnings.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-02-01 19:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-01 13:32 [PATCH] blackhole_dev: Fix buil warning Breno Leitao
2024-02-01 16:02 ` Jiri Pirko
2024-02-01 16:55 ` Jakub Kicinski
2024-02-01 18:46   ` Breno Leitao
2024-02-01 19:40     ` Jakub Kicinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).