netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [ICMP]: Avoid sparse warnings in net/ipv4/icmp.c
@ 2008-01-04  5:24 Eric Dumazet
  2008-01-04  5:26 ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Eric Dumazet @ 2008-01-04  5:24 UTC (permalink / raw)
  To: David S. Miller, Linux Netdev List

[-- Attachment #1: Type: text/plain, Size: 559 bytes --]

   CHECK   net/ipv4/icmp.c
net/ipv4/icmp.c:249:13: warning: context imbalance in 'icmp_xmit_unlock' - 
unexpected unlock
net/ipv4/icmp.c:376:13: warning: context imbalance in 'icmp_reply' - different 
lock contexts for basic block
net/ipv4/icmp.c:430:6: warning: context imbalance in 'icmp_send' - different 
lock contexts for basic block

Solution is to declare icmp_xmit_unlock() as __inline__ (similar with 
icmp_xmit_lock())

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>

  net/ipv4/icmp.c |    2 +-
  1 files changed, 1 insertion(+), 1 deletion(-)


[-- Attachment #2: icmp.patch --]
[-- Type: text/plain, Size: 335 bytes --]

diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
index fc66c8a..01ce07b 100644
--- a/net/ipv4/icmp.c
+++ b/net/ipv4/icmp.c
@@ -246,7 +246,7 @@ static __inline__ int icmp_xmit_lock(void)
 	return 0;
 }
 
-static void icmp_xmit_unlock(void)
+static __inline__ void icmp_xmit_unlock(void)
 {
 	spin_unlock_bh(&icmp_sock->sk_lock.slock);
 }

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

* Re: [ICMP]: Avoid sparse warnings in net/ipv4/icmp.c
  2008-01-04  5:24 [ICMP]: Avoid sparse warnings in net/ipv4/icmp.c Eric Dumazet
@ 2008-01-04  5:26 ` David Miller
  2008-01-04  5:34   ` Eric Dumazet
  0 siblings, 1 reply; 4+ messages in thread
From: David Miller @ 2008-01-04  5:26 UTC (permalink / raw)
  To: dada1; +Cc: netdev

From: Eric Dumazet <dada1@cosmosbay.com>
Date: Fri, 04 Jan 2008 06:24:20 +0100

>    CHECK   net/ipv4/icmp.c
> net/ipv4/icmp.c:249:13: warning: context imbalance in 'icmp_xmit_unlock' - 
> unexpected unlock
> net/ipv4/icmp.c:376:13: warning: context imbalance in 'icmp_reply' - different 
> lock contexts for basic block
> net/ipv4/icmp.c:430:6: warning: context imbalance in 'icmp_send' - different 
> lock contexts for basic block
> 
> Solution is to declare icmp_xmit_unlock() as __inline__ (similar with 
> icmp_xmit_lock())

Please use "inline" instead of "__inline__".  If other stuff
uses __inline__ in that file, feel free to fix it up too.

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

* Re: [ICMP]: Avoid sparse warnings in net/ipv4/icmp.c
  2008-01-04  5:26 ` David Miller
@ 2008-01-04  5:34   ` Eric Dumazet
  2008-01-04  8:51     ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Eric Dumazet @ 2008-01-04  5:34 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

[-- Attachment #1: Type: text/plain, Size: 1354 bytes --]

David Miller a écrit :
> From: Eric Dumazet <dada1@cosmosbay.com>
> Date: Fri, 04 Jan 2008 06:24:20 +0100
> 
>>    CHECK   net/ipv4/icmp.c
>> net/ipv4/icmp.c:249:13: warning: context imbalance in 'icmp_xmit_unlock' - 
>> unexpected unlock
>> net/ipv4/icmp.c:376:13: warning: context imbalance in 'icmp_reply' - different 
>> lock contexts for basic block
>> net/ipv4/icmp.c:430:6: warning: context imbalance in 'icmp_send' - different 
>> lock contexts for basic block
>>
>> Solution is to declare icmp_xmit_unlock() as __inline__ (similar with 
>> icmp_xmit_lock())
> 
> Please use "inline" instead of "__inline__".  If other stuff
> uses __inline__ in that file, feel free to fix it up too.
> 

You are right, here is the updated version

Thank you

[ICMP]: Avoid sparse warnings in net/ipv4/icmp.c

   CHECK   net/ipv4/icmp.c
net/ipv4/icmp.c:249:13: warning: context imbalance in 'icmp_xmit_unlock' - 
unexpected unlock
net/ipv4/icmp.c:376:13: warning: context imbalance in 'icmp_reply' - different 
lock contexts for basic block
net/ipv4/icmp.c:430:6: warning: context imbalance in 'icmp_send' - different 
lock contexts for basic block

Solution is to declare both icmp_xmit_lock() and icmp_xmit_unlock() as inline

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>

  net/ipv4/icmp.c |    4 ++--
  1 files changed, 2 insertions(+), 2 deletions(-)


[-- Attachment #2: icmp.patch --]
[-- Type: text/plain, Size: 634 bytes --]

diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
index fc66c8a..1c256ff 100644
--- a/net/ipv4/icmp.c
+++ b/net/ipv4/icmp.c
@@ -232,7 +232,7 @@ static const struct icmp_control icmp_pointers[NR_ICMP_TYPES+1];
 static DEFINE_PER_CPU(struct sock *, __icmp_sock) = NULL;
 #define icmp_sock	__get_cpu_var(__icmp_sock)
 
-static __inline__ int icmp_xmit_lock(void)
+static inline int icmp_xmit_lock(void)
 {
 	local_bh_disable();
 
@@ -246,7 +246,7 @@ static __inline__ int icmp_xmit_lock(void)
 	return 0;
 }
 
-static void icmp_xmit_unlock(void)
+static inline void icmp_xmit_unlock(void)
 {
 	spin_unlock_bh(&icmp_sock->sk_lock.slock);
 }

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

* Re: [ICMP]: Avoid sparse warnings in net/ipv4/icmp.c
  2008-01-04  5:34   ` Eric Dumazet
@ 2008-01-04  8:51     ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2008-01-04  8:51 UTC (permalink / raw)
  To: dada1; +Cc: netdev

From: Eric Dumazet <dada1@cosmosbay.com>
Date: Fri, 04 Jan 2008 06:34:28 +0100

> David Miller a écrit :
> > Please use "inline" instead of "__inline__".  If other stuff
> > uses __inline__ in that file, feel free to fix it up too.
> 
> You are right, here is the updated version

Applied, thanks Eric.

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

end of thread, other threads:[~2008-01-04  8:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-04  5:24 [ICMP]: Avoid sparse warnings in net/ipv4/icmp.c Eric Dumazet
2008-01-04  5:26 ` David Miller
2008-01-04  5:34   ` Eric Dumazet
2008-01-04  8:51     ` David Miller

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).