diff mbox

net: ping: cleanups ping_v4_unhash()

Message ID 1306138981.2869.2.camel@edumazet-laptop
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Eric Dumazet May 23, 2011, 8:23 a.m. UTC
net/ipv4/ping.c: In function ‘ping_v4_unhash’:
net/ipv4/ping.c:140:28: warning: variable ‘hslot’ set but not used

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
CC: Vasiliy Kulikov <segoon@openwall.com>
---
 net/ipv4/ping.c |    3 ---
 1 file changed, 3 deletions(-)



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Vasiliy Kulikov May 23, 2011, 8:43 a.m. UTC | #1
On Mon, May 23, 2011 at 10:23 +0200, Eric Dumazet wrote:
> net/ipv4/ping.c: In function ‘ping_v4_unhash’:
> net/ipv4/ping.c:140:28: warning: variable ‘hslot’ set but not used
> 
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>

Acked-by: Vasiliy Kulikov <segoon@openwall.com>

hslot was used for debugging purposes here.


BTW, what gcc version do you use?  I have no warning with 4.4.3
(Ubuntu 4.4.3-4ubuntu5):

    $ make net/ipv4/ping.o
      CHK     include/linux/version.h
      CHK     include/generated/utsrelease.h
      CALL    scripts/checksyscalls.sh
      CC      net/ipv4/ping.o
    $


Thanks,
Eric Dumazet May 23, 2011, 9 a.m. UTC | #2
Le lundi 23 mai 2011 à 12:43 +0400, Vasiliy Kulikov a écrit :
> On Mon, May 23, 2011 at 10:23 +0200, Eric Dumazet wrote:
> > net/ipv4/ping.c: In function ‘ping_v4_unhash’:
> > net/ipv4/ping.c:140:28: warning: variable ‘hslot’ set but not used
> > 
> > Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
> 
> Acked-by: Vasiliy Kulikov <segoon@openwall.com>
> 
> hslot was used for debugging purposes here.
> 
> 
> BTW, what gcc version do you use?  I have no warning with 4.4.3
> (Ubuntu 4.4.3-4ubuntu5):
> 
>     $ make net/ipv4/ping.o
>       CHK     include/linux/version.h
>       CHK     include/generated/utsrelease.h
>       CALL    scripts/checksyscalls.sh
>       CC      net/ipv4/ping.o
>     $
> 

I got this warning with gcc-4.6.0 on a 32bit (x86) host



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller May 23, 2011, 8:29 p.m. UTC | #3
From: Eric Dumazet <eric.dumazet@gmail.com>

Date: Mon, 23 May 2011 10:23:00 +0200

> net/ipv4/ping.c: In function ‘ping_v4_unhash’:

> net/ipv4/ping.c:140:28: warning: variable ‘hslot’ set but not used

> 

> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>

> CC: Vasiliy Kulikov <segoon@openwall.com>


Applied.
diff mbox

Patch

diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c
index 1f3bb11..9aaa671 100644
--- a/net/ipv4/ping.c
+++ b/net/ipv4/ping.c
@@ -137,9 +137,6 @@  static void ping_v4_unhash(struct sock *sk)
 	struct inet_sock *isk = inet_sk(sk);
 	pr_debug("ping_v4_unhash(isk=%p,isk->num=%u)\n", isk, isk->inet_num);
 	if (sk_hashed(sk)) {
-		struct hlist_nulls_head *hslot;
-
-		hslot = ping_hashslot(&ping_table, sock_net(sk), isk->inet_num);
 		write_lock_bh(&ping_table.lock);
 		hlist_nulls_del(&sk->sk_nulls_node);
 		sock_put(sk);