Skip to content

Commit

Permalink
net: blackhole_dev: fix build warning for ethh set but not used
Browse files Browse the repository at this point in the history
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: 509e56b ("blackhole_dev: add a selftest")
Signed-off-by: Breno Leitao <leitao@debian.org>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Breno Leitao authored and David S. Miller committed Feb 5, 2024
1 parent c3b39ea commit 843a885
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/test_blackhole_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 843a885

Please sign in to comment.