linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* fix compiler warning in ip_nat_standalone.c
@ 2006-05-11 15:29 Rik Bobbaers
  2006-05-11 15:55 ` Jörn Engel
  2006-05-11 16:14 ` Adrian Bunk
  0 siblings, 2 replies; 8+ messages in thread
From: Rik Bobbaers @ 2006-05-11 15:29 UTC (permalink / raw)
  To: linux-kernel

hey all,

i just made small patch that fixes a compiler warning:

--- net/ipv4/netfilter/ip_nat_standalone.c~	2006-05-11 03:56:24.000000000 
+0200
+++ net/ipv4/netfilter/ip_nat_standalone.c	2006-05-11 17:17:22.000000000 +0200
@@ -219,8 +219,10 @@ ip_nat_out(unsigned int hooknum,
 	   const struct net_device *out,
 	   int (*okfn)(struct sk_buff *))
 {
+#ifdef CONFIG_XFRM
 	struct ip_conntrack *ct;
 	enum ip_conntrack_info ctinfo;
+#endif
 	unsigned int ret;
 
 	/* root is playing with raw sockets. */

or at http://harry.ulyssis.org/ip_nat.diff

-- 
harry
aka Rik Bobbaers

K.U.Leuven - LUDIT          -=- Tel: +32 485 52 71 50
Rik.Bobbaers@cc.kuleuven.be -=- http://harry.ulyssis.org

"Work hard and do your best, it'll make it easier for the rest"
-- Garfield

Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm


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

* Re: fix compiler warning in ip_nat_standalone.c
  2006-05-11 15:29 fix compiler warning in ip_nat_standalone.c Rik Bobbaers
@ 2006-05-11 15:55 ` Jörn Engel
  2006-05-11 16:14   ` Alexey Dobriyan
                     ` (2 more replies)
  2006-05-11 16:14 ` Adrian Bunk
  1 sibling, 3 replies; 8+ messages in thread
From: Jörn Engel @ 2006-05-11 15:55 UTC (permalink / raw)
  To: Rik Bobbaers; +Cc: linux-kernel

On Thu, 11 May 2006 17:29:48 +0200, Rik Bobbaers wrote:
> 
> i just made small patch that fixes a compiler warning:

Just in case Al didn't make it clear enough in the recent thread:

You cannot fix a compiler warning!

Either the code is wrong or it is right.  A compiler warning can
indicate that code is wrong, or it is a false positive.  If the code
is wrong, fix the _code_.  If it isn't, ignore the warning or fix the
_compiler_.

That said, your patch looks as if it would actually fix the code.  I'm
not firm enough with NAT to confirm that, though.  So if it fixes the
code, please state exactly that.

Jörn

-- 
Anything that can go wrong, will.
-- Finagle's Law

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

* Re: fix compiler warning in ip_nat_standalone.c
  2006-05-11 15:29 fix compiler warning in ip_nat_standalone.c Rik Bobbaers
  2006-05-11 15:55 ` Jörn Engel
@ 2006-05-11 16:14 ` Adrian Bunk
  1 sibling, 0 replies; 8+ messages in thread
From: Adrian Bunk @ 2006-05-11 16:14 UTC (permalink / raw)
  To: Rik Bobbaers; +Cc: linux-kernel

On Thu, May 11, 2006 at 05:29:48PM +0200, Rik Bobbaers wrote:

> hey all,
> 
> i just made small patch that fixes a compiler warning:
>...

Already fixed in Linus' tree since one week.

> harry
> aka Rik Bobbaers

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


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

* Re: fix compiler warning in ip_nat_standalone.c
  2006-05-11 15:55 ` Jörn Engel
@ 2006-05-11 16:14   ` Alexey Dobriyan
  2006-05-11 16:18   ` Al Viro
  2006-05-11 16:49   ` Rik Bobbaers
  2 siblings, 0 replies; 8+ messages in thread
From: Alexey Dobriyan @ 2006-05-11 16:14 UTC (permalink / raw)
  To: Jörn Engel; +Cc: Rik Bobbaers, linux-kernel

On Thu, May 11, 2006 at 05:55:37PM +0200, Jörn Engel wrote:
> On Thu, 11 May 2006 17:29:48 +0200, Rik Bobbaers wrote:
> > 
> > i just made small patch that fixes a compiler warning:
> 
> Just in case Al didn't make it clear enough in the recent thread:
> 
> You cannot fix a compiler warning!

Calm down. It's pretty obvious from patch the warning is usual

	"unused variable foo"

if CONFIG_BAR=n.

Anyway, fix in mainline already.

> Either the code is wrong or it is right.  A compiler warning can
> indicate that code is wrong, or it is a false positive.  If the code
> is wrong, fix the _code_.  If it isn't, ignore the warning or fix the
> _compiler_.
> 
> That said, your patch looks as if it would actually fix the code.  I'm
> not firm enough with NAT to confirm that, though.  So if it fixes the
> code, please state exactly that.


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

* Re: fix compiler warning in ip_nat_standalone.c
  2006-05-11 15:55 ` Jörn Engel
  2006-05-11 16:14   ` Alexey Dobriyan
@ 2006-05-11 16:18   ` Al Viro
  2006-05-11 18:35     ` Jörn Engel
  2006-05-11 16:49   ` Rik Bobbaers
  2 siblings, 1 reply; 8+ messages in thread
From: Al Viro @ 2006-05-11 16:18 UTC (permalink / raw)
  To: J?rn Engel; +Cc: Rik Bobbaers, linux-kernel

On Thu, May 11, 2006 at 05:55:37PM +0200, J?rn Engel wrote:
> On Thu, 11 May 2006 17:29:48 +0200, Rik Bobbaers wrote:
> > 
> > i just made small patch that fixes a compiler warning:
> 
> Just in case Al didn't make it clear enough in the recent thread:
> 
> You cannot fix a compiler warning!
> 
> Either the code is wrong or it is right.  A compiler warning can
> indicate that code is wrong, or it is a false positive.  If the code
> is wrong, fix the _code_.

Which is what the patch does, AFAICS.  What's the problem in this case?

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

* Re: fix compiler warning in ip_nat_standalone.c
  2006-05-11 15:55 ` Jörn Engel
  2006-05-11 16:14   ` Alexey Dobriyan
  2006-05-11 16:18   ` Al Viro
@ 2006-05-11 16:49   ` Rik Bobbaers
  2006-05-11 18:30     ` Jörn Engel
  2 siblings, 1 reply; 8+ messages in thread
From: Rik Bobbaers @ 2006-05-11 16:49 UTC (permalink / raw)
  To: Jörn Engel; +Cc: linux-kernel

On Thursday 11 May 2006 17:55, Jörn Engel wrote:
> On Thu, 11 May 2006 17:29:48 +0200, Rik Bobbaers wrote:
> > i just made small patch that fixes a compiler warning:
>
> Just in case Al didn't make it clear enough in the recent thread:
>
> You cannot fix a compiler warning!
>
> Either the code is wrong or it is right.  A compiler warning can
> indicate that code is wrong, or it is a false positive.  If the code
> is wrong, fix the _code_.  If it isn't, ignore the warning or fix the
> _compiler_.

sry, i 'm not on lkml, so i didn't read the thread

> That said, your patch looks as if it would actually fix the code.  I'm
> not firm enough with NAT to confirm that, though.  So if it fixes the
> code, please state exactly that.

mkay... it fixes the code :)

-- 
harry
aka Rik Bobbaers

K.U.Leuven - LUDIT          -=- Tel: +32 485 52 71 50
Rik.Bobbaers@cc.kuleuven.be -=- http://harry.ulyssis.org

"Work hard and do your best, it'll make it easier for the rest"
-- Garfield

Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm


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

* Re: fix compiler warning in ip_nat_standalone.c
  2006-05-11 16:49   ` Rik Bobbaers
@ 2006-05-11 18:30     ` Jörn Engel
  0 siblings, 0 replies; 8+ messages in thread
From: Jörn Engel @ 2006-05-11 18:30 UTC (permalink / raw)
  To: Rik Bobbaers; +Cc: linux-kernel

On Thu, 11 May 2006 18:49:41 +0200, Rik Bobbaers wrote:
> On Thursday 11 May 2006 17:55, Jörn Engel wrote:
> 
> > That said, your patch looks as if it would actually fix the code.  I'm
> > not firm enough with NAT to confirm that, though.  So if it fixes the
> > code, please state exactly that.
> 
> mkay... it fixes the code :)

Ok.  Then excuse my rant and thanks for the patch. :)

Jörn

-- 
To my face you have the audacity to advise me to become a thief - the worst
kind of thief that is conceivable, a thief of spiritual things, a thief of
ideas! It is insufferable, intolerable!
-- M. Binet in Scarabouche

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

* Re: fix compiler warning in ip_nat_standalone.c
  2006-05-11 16:18   ` Al Viro
@ 2006-05-11 18:35     ` Jörn Engel
  0 siblings, 0 replies; 8+ messages in thread
From: Jörn Engel @ 2006-05-11 18:35 UTC (permalink / raw)
  To: Al Viro; +Cc: Rik Bobbaers, linux-kernel

On Thu, 11 May 2006 17:18:46 +0100, Al Viro wrote:
> On Thu, May 11, 2006 at 05:55:37PM +0200, J?rn Engel wrote:
> > 
> > You cannot fix a compiler warning!
> > 
> > Either the code is wrong or it is right.  A compiler warning can
> > indicate that code is wrong, or it is a false positive.  If the code
> > is wrong, fix the _code_.
> 
> Which is what the patch does, AFAICS.  What's the problem in this case?

See subject.  I didn't object to the patch, that looked fine to me.
But the general idea that a warning can be fixed always hits a loose
nerve in my brain.  Maybe I'm a bit silly in this respect.

Jörn

-- 
When in doubt, use brute force.
-- Ken Thompson

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

end of thread, other threads:[~2006-05-11 18:36 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-11 15:29 fix compiler warning in ip_nat_standalone.c Rik Bobbaers
2006-05-11 15:55 ` Jörn Engel
2006-05-11 16:14   ` Alexey Dobriyan
2006-05-11 16:18   ` Al Viro
2006-05-11 18:35     ` Jörn Engel
2006-05-11 16:49   ` Rik Bobbaers
2006-05-11 18:30     ` Jörn Engel
2006-05-11 16:14 ` Adrian Bunk

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