Re: [PATCH] fs/fcntl.c - remove impossible <0 check in do_fcntl -arg is unsigned.

From: Linus Torvalds
Date: Wed Jan 07 2004 - 21:50:40 EST




On Thu, 8 Jan 2004, Jesper Juhl wrote:
>
> The 'arg' argument to the function do_fcntl in fs/fcntl.c is of type
> 'unsigned long', thus it can never be less than zero (all callers of
> do_fcntl take unsigned arguments as well and pass on unsigned values),

I'm not sure I like these kinds of patches.

I _like_ the code being readable. The fact that the compiler can optimize
away one of the tests if the type is right is fine. It seems to be
draconian to remove code that is correct and safe, especially when the
code has no real downsides to it.

Do we have a compiler that needlessly complains again?

Sometimes it is the _complaints_ that are bogus.

Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/