Skip to content

Commit e3350e2

Browse files
leitaovijay-suman
authored andcommitted
net: blackhole_dev: fix build warning for ethh set but not used
[ Upstream commit 843a885 ] 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 <[email protected]> Reviewed-by: Jiri Pirko <[email protected]> Signed-off-by: David S. Miller <[email protected]> Signed-off-by: Sasha Levin <[email protected]> (cherry picked from commit d20d45631feb03df1d1443bed3640dd7557fd817) Signed-off-by: Vijayendra Suman <[email protected]>
1 parent 9979aa8 commit e3350e2

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/test_blackhole_dev.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ static int __init test_blackholedev_init(void)
2929
{
3030
struct ipv6hdr *ip6h;
3131
struct sk_buff *skb;
32-
struct ethhdr *ethh;
3332
struct udphdr *uh;
3433
int data_len;
3534
int ret;
@@ -61,7 +60,7 @@ static int __init test_blackholedev_init(void)
6160
ip6h->saddr = in6addr_loopback;
6261
ip6h->daddr = in6addr_loopback;
6362
/* Ether */
64-
ethh = (struct ethhdr *)skb_push(skb, sizeof(struct ethhdr));
63+
skb_push(skb, sizeof(struct ethhdr));
6564
skb_set_mac_header(skb, 0);
6665

6766
skb->protocol = htons(ETH_P_IPV6);

0 commit comments

Comments
 (0)