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

From: Matthew Wilcox (willy_at_debian.org)
Date: 01/08/04

  • Next message: Olivier Galibert: "Re: [autofs] [RFC] Towards a Modern Autofs"
    Date:	Thu, 8 Jan 2004 12:13:12 +0000
    To: Linus Torvalds <torvalds@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
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at  http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at  http://www.tux.org/lkml/
    

  • Next message: Olivier Galibert: "Re: [autofs] [RFC] Towards a Modern Autofs"

    Relevant Pages

    • Re: [openib-general] Re: [PATCH][RFC][0/4] InfiniBand userspace verbs implementation
      ... >> with the pages which permits the kernel to clean stuff up on unclean ... >> pinning of unbounded amounts of memory. ... > and clean up after it, so the pinned region in most implementations is ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: 2.6.11-rc2-mm1
      ... > autofs has exploded far, far beyond complete nonfunctionality, where ... Anyway, thus far ppc64 comes up clean with no patches, ia64 comes up ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • RE: [PATCH] 2.6 SGI Altix I/O code reorganization
      ... Add new interfaces to header files to support any new API ... Functional changes to copied files. ... Delete any API in headers that were only used by old files. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: CFO: Why C?
      ... and which require that the header files must exist on every ... majority of my code will work on any platform with a conforming compiler. ... > libraries which are considered as essential for a GNU software ... > The syntax of C is neither clean nor simple. ...
      (comp.os.linux.development.apps)
    • Re: [PATCH v2] check headers for complete includes, etc.
      ... >> If there are no big complaints, I consider this version to be final. ... > but until now this is the only patch... ... Considering that the header files only rarely ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)