Subject: Re: + net-ipv4-tcpc-fix-warning.patch added to -mm tree

From: Andrew Morton <[email-masked]>
Date: Tue, 8 Dec 2009 18:08:01 -0800

On Tue, 08 Dec 2009 20:45:53 -0500
William Allen Simpson <[email-masked]> wrote:

> > ------------------------------------------------------
> > Subject: net/ipv4/tcp.c: fix warning
> > From: Andrew Morton <[email-masked]>
> > 
> > x86_64 allmodconfig:
> > 
> > net/ipv4/tcp.c: In function 'do_tcp_getsockopt':
> > net/ipv4/tcp.c:2544: warning: comparison is always false due to limited range of data type
> > 
> > sizeof(tcpct_value) is 536, which can never be less than a value which is held
> > in a u8.
> > 
> > This fix is stupid - just delete the code?
> > 
> I didn't have this warning, how in the world do you get it?

Used gcc-4.0.2.  They re-randomise the warnings with each release I think.

> This is what David calls my "anal" coding style.  I check everything,
> because someday somebody else might make a change, and it's important
> that such problems be detected.  In this case, I assume the compiler
> will compile them out or it would have no effect, and commented that
> it should be impossible.
> 
> Your test should probably be TCP_MSS_DEFAULT < TCP_COOKIE_PAIR_SIZE

I'd say just delete it ;)