mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@debian.org>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Jesper Juhl <juhl@dif.dk>,
	linux-kernel@vger.kernel.org, Matthew Wilcox <matthew@wil.cx>
Subject: Re: [PATCH] fs/fcntl.c - remove impossible <0 check in do_fcntl - arg is unsigned.
Date: Thu, 8 Jan 2004 12:13:12 +0000	[thread overview]
Message-ID: <20040108121312.GT17182@parcelfarce.linux.theplanet.co.uk> (raw)
In-Reply-To: <Pine.LNX.4.58.0401071846160.2131@home.osdl.org>

On Wed, Jan 07, 2004 at 06:47:49PM -0800, Linus Torvalds wrote:
> 
> 
> 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? 

gcc does indeed complain about it with -W.  But -W turns on so many other
warnings, this one's lost in the noise.  I would actually like to be
able to make the header files -W clean so that I can compile individual
files with -W to catch some of my worst mistakes.

But I don't think that making the entire build -W clean is worthwhile.
It'd make the code too ugly.

-- 
"Next the statesmen will invent cheap lies, putting the blame upon 
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince 
himself that the war is just, and will thank God for the better sleep 
he enjoys after this process of grotesque self-deception." -- Mark Twain

      parent reply	other threads:[~2004-01-08 12:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-08  1:44 Jesper Juhl
2004-01-08  2:47 ` Linus Torvalds
2004-01-08 10:27   ` Jesper Juhl
2004-01-08 11:07     ` Paul Jackson
2004-01-08 11:10     ` Hans Reiser
2004-01-08 12:13   ` Matthew Wilcox [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040108121312.GT17182@parcelfarce.linux.theplanet.co.uk \
    --to=willy@debian.org \
    --cc=juhl@dif.dk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthew@wil.cx \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome