Re: [PATCH] fs/fcntl.c : don't test unsigned value for less than zero

2005-04-17 Thread Jesper Juhl
On Fri, 15 Apr 2005, Matthew Wilcox wrote: > On Fri, Apr 15, 2005 at 10:03:05PM +1000, Herbert Xu wrote: > > I suppose it could be smart and stay quiet about > > > > val < 0 || val > BOUND > > > > However, gcc is slow enough as it is without adding unnecessary > > smarts like this. > > It only

Re: [PATCH] fs/fcntl.c : don't test unsigned value for less than zero

2005-04-17 Thread Jesper Juhl
On Fri, 15 Apr 2005, Matthew Wilcox wrote: On Fri, Apr 15, 2005 at 10:03:05PM +1000, Herbert Xu wrote: I suppose it could be smart and stay quiet about val 0 || val BOUND However, gcc is slow enough as it is without adding unnecessary smarts like this. It only warns with -W

Re: [PATCH] fs/fcntl.c : don't test unsigned value for less than zero

2005-04-15 Thread Matthew Wilcox
On Fri, Apr 15, 2005 at 10:03:05PM +1000, Herbert Xu wrote: > I suppose it could be smart and stay quiet about > > val < 0 || val > BOUND > > However, gcc is slow enough as it is without adding unnecessary > smarts like this. It only warns with -W on, not with -Wall, so I see no compelling

Re: [PATCH] fs/fcntl.c : don't test unsigned value for less than zero

2005-04-15 Thread Herbert Xu
Christoph Hellwig <[EMAIL PROTECTED]> wrote: > >> No, it was exactly this patch: >> http://www.ussg.iu.edu/hypermail/linux/kernel/0401.0/1816.html > > Hmm. Looks I absolutely disagree with Linus on this one ;-) Me too. The compiler doesn't really have much choice here. If it ignores all

Re: [PATCH] fs/fcntl.c : don't test unsigned value for less than zero

2005-04-15 Thread Christoph Hellwig
On Fri, Apr 15, 2005 at 12:29:08PM +0100, Matthew Wilcox wrote: > > I think Linux only complained if we're using some typedef that actually > > may be signed. For fcntl that 'arg' argument is unsigned and that's > > hardcoded > > in the ABI. So the check doesn't make sense at all. > > No, it

Re: [PATCH] fs/fcntl.c : don't test unsigned value for less than zero

2005-04-15 Thread Matthew Wilcox
On Fri, Apr 15, 2005 at 09:21:50AM +0100, Christoph Hellwig wrote: > On Fri, Apr 15, 2005 at 02:31:00AM +0100, Matthew Wilcox wrote: > > On Fri, Apr 15, 2005 at 03:07:42AM +0200, Jesper Juhl wrote: > > > 'arg' is unsigned so it can never be less than zero, so testing for that > > > is pointless

Re: [PATCH] fs/fcntl.c : don't test unsigned value for less than zero

2005-04-15 Thread Christoph Hellwig
On Fri, Apr 15, 2005 at 02:31:00AM +0100, Matthew Wilcox wrote: > On Fri, Apr 15, 2005 at 03:07:42AM +0200, Jesper Juhl wrote: > > 'arg' is unsigned so it can never be less than zero, so testing for that > > is pointless and also generates a warning when building with gcc -W. This > > patch

Re: [PATCH] fs/fcntl.c : don't test unsigned value for less than zero

2005-04-15 Thread Jesper Juhl
On Fri, 15 Apr 2005, Matthew Wilcox wrote: > On Fri, Apr 15, 2005 at 03:07:42AM +0200, Jesper Juhl wrote: > > 'arg' is unsigned so it can never be less than zero, so testing for that > > is pointless and also generates a warning when building with gcc -W. This > > patch eliminates the pointless

Re: [PATCH] fs/fcntl.c : don't test unsigned value for less than zero

2005-04-15 Thread Jesper Juhl
On Fri, 15 Apr 2005, Matthew Wilcox wrote: On Fri, Apr 15, 2005 at 03:07:42AM +0200, Jesper Juhl wrote: 'arg' is unsigned so it can never be less than zero, so testing for that is pointless and also generates a warning when building with gcc -W. This patch eliminates the pointless check.

Re: [PATCH] fs/fcntl.c : don't test unsigned value for less than zero

2005-04-15 Thread Christoph Hellwig
On Fri, Apr 15, 2005 at 02:31:00AM +0100, Matthew Wilcox wrote: On Fri, Apr 15, 2005 at 03:07:42AM +0200, Jesper Juhl wrote: 'arg' is unsigned so it can never be less than zero, so testing for that is pointless and also generates a warning when building with gcc -W. This patch eliminates

Re: [PATCH] fs/fcntl.c : don't test unsigned value for less than zero

2005-04-15 Thread Matthew Wilcox
On Fri, Apr 15, 2005 at 09:21:50AM +0100, Christoph Hellwig wrote: On Fri, Apr 15, 2005 at 02:31:00AM +0100, Matthew Wilcox wrote: On Fri, Apr 15, 2005 at 03:07:42AM +0200, Jesper Juhl wrote: 'arg' is unsigned so it can never be less than zero, so testing for that is pointless and also

Re: [PATCH] fs/fcntl.c : don't test unsigned value for less than zero

2005-04-15 Thread Herbert Xu
Christoph Hellwig [EMAIL PROTECTED] wrote: No, it was exactly this patch: http://www.ussg.iu.edu/hypermail/linux/kernel/0401.0/1816.html Hmm. Looks I absolutely disagree with Linus on this one ;-) Me too. The compiler doesn't really have much choice here. If it ignores all comparisons of

Re: [PATCH] fs/fcntl.c : don't test unsigned value for less than zero

2005-04-15 Thread Matthew Wilcox
On Fri, Apr 15, 2005 at 10:03:05PM +1000, Herbert Xu wrote: I suppose it could be smart and stay quiet about val 0 || val BOUND However, gcc is slow enough as it is without adding unnecessary smarts like this. It only warns with -W on, not with -Wall, so I see no compelling reason to

Re: [PATCH] fs/fcntl.c : don't test unsigned value for less than zero

2005-04-14 Thread Matthew Wilcox
On Fri, Apr 15, 2005 at 03:07:42AM +0200, Jesper Juhl wrote: > 'arg' is unsigned so it can never be less than zero, so testing for that > is pointless and also generates a warning when building with gcc -W. This > patch eliminates the pointless check. Didn't Linus already reject this one 6

[PATCH] fs/fcntl.c : don't test unsigned value for less than zero

2005-04-14 Thread Jesper Juhl
'arg' is unsigned so it can never be less than zero, so testing for that is pointless and also generates a warning when building with gcc -W. This patch eliminates the pointless check. Signed-off-by: Jesper Juhl <[EMAIL PROTECTED]> --- linux-2.6.12-rc2-mm3-orig/fs/fcntl.c2005-04-11

[PATCH] fs/fcntl.c : don't test unsigned value for less than zero

2005-04-14 Thread Jesper Juhl
'arg' is unsigned so it can never be less than zero, so testing for that is pointless and also generates a warning when building with gcc -W. This patch eliminates the pointless check. Signed-off-by: Jesper Juhl [EMAIL PROTECTED] --- linux-2.6.12-rc2-mm3-orig/fs/fcntl.c2005-04-11

Re: [PATCH] fs/fcntl.c : don't test unsigned value for less than zero

2005-04-14 Thread Matthew Wilcox
On Fri, Apr 15, 2005 at 03:07:42AM +0200, Jesper Juhl wrote: 'arg' is unsigned so it can never be less than zero, so testing for that is pointless and also generates a warning when building with gcc -W. This patch eliminates the pointless check. Didn't Linus already reject this one 6 months