Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S263598AbUAHCsD (ORCPT ); Wed, 7 Jan 2004 21:48:03 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S263600AbUAHCsD (ORCPT ); Wed, 7 Jan 2004 21:48:03 -0500 Received: from fw.osdl.org ([65.172.181.6]:43441 "EHLO mail.osdl.org") by vger.kernel.org with ESMTP id S263598AbUAHCrz (ORCPT ); Wed, 7 Jan 2004 21:47:55 -0500 Date: Wed, 7 Jan 2004 18:47:49 -0800 (PST) From: Linus Torvalds To: Jesper Juhl cc: linux-kernel@vger.kernel.org, Matthew Wilcox Subject: Re: [PATCH] fs/fcntl.c - remove impossible <0 check in do_fcntl - arg is unsigned. In-Reply-To: <8A43C34093B3D5119F7D0004AC56F4BC074B2059@difpst1a.dif.dk> Message-ID: References: <8A43C34093B3D5119F7D0004AC56F4BC074B2059@difpst1a.dif.dk> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 915 Lines: 25 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/