Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932203AbWH1Vsi (ORCPT ); Mon, 28 Aug 2006 17:48:38 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932202AbWH1Vsh (ORCPT ); Mon, 28 Aug 2006 17:48:37 -0400 Received: from gepetto.dc.ltu.se ([130.240.42.40]:38381 "EHLO gepetto.dc.ltu.se") by vger.kernel.org with ESMTP id S932190AbWH1Vsh (ORCPT ); Mon, 28 Aug 2006 17:48:37 -0400 Message-ID: <44F3664A.80607@student.ltu.se> Date: Mon, 28 Aug 2006 23:55:22 +0200 From: Richard Knutsson User-Agent: Mozilla Thunderbird 1.0.8-1.1.fc4 (X11/20060501) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Nicholas Miell CC: Jan Engelhardt , Christoph Hellwig , James.Bottomley@SteelEye.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: Conversion to generic boolean References: <44EFBEFA.2010707@student.ltu.se> <20060828093202.GC8980@infradead.org> <44F2DEDC.3020608@student.ltu.se> <1156792540.2367.2.camel@entropy> <44F3582B.3060000@student.ltu.se> <1156799964.24135.2.camel@entropy> In-Reply-To: <1156799964.24135.2.camel@entropy> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2469 Lines: 89 Nicholas Miell wrote: >On Mon, 2006-08-28 at 22:55 +0200, Richard Knutsson wrote: > > >>Nicholas Miell wrote: >> >> >> >>>On Mon, 2006-08-28 at 14:17 +0200, Richard Knutsson wrote: >>> >>> >>> >>>>Jan Engelhardt wrote: >>>> >>>> >>>> >>>> >>>>>>>Just would like to ask if you want patches for: >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>Total NACK to any of this boolean ididocy. I very much hope you didn't >>>>>>get the impression you actually have a chance to get this merged. >>>>>> >>>>>> >>>>>> >>>>>> >>>>>>>* (Most importent, may introduce bugs if left alone) >>>>>>>Fixing boolean checking, ex: >>>>>>>if (bool == FALSE) >>>>>>>to >>>>>>>if (!bool) >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>this one of course makes sense, but please do it without introducing >>>>>>any boolean type. Getting rid of all the TRUE/FALSE defines and converting >>>>>>all scsi drivers to classic C integer as boolean semantics would be >>>>>>very welcome janitorial work. >>>>>> >>>>>> >>>>>> >>>>>> >>>>>I don't get it. You object to the 'idiocy' >>>>>(http://lkml.org/lkml/2006/7/27/281), but find the x==FALSE -> !x >>>>>a good thing? >>>>> >>>>> >>>>> >>>>> >>>>That is error-prone. Not "==FALSE" but what happens if x is (for some >>>>reason) not 1 and then "if (x==TRUE)". >>>> >>>> >>>> >>>If you're using _Bool, that isn't possible. (Except at the boundaries >>>where you have to validate untrusted data -- and the compiler makes that >>>more difficult, because it "knows" that a _Bool can only be 0 or 1 and >>>therefore your check to see if it's not 0 or 1 can "safely" be >>>eliminated.) >>> >>> >>> >>> >>Yes, true. But there is no _Bool's in the kernel (linus-git), only one >>in script/. >> >> >> > >Sorry, I was under the impression that the purpose of the generic >boolean patch was to switch the kernel over to C's generic boolean. > > Oh no, my bad. Well, at least some like to do it (including me). But you really have to bend it to make _Bool take another value then 0/1. Regarding "== FALSE" and co., there is still no reason for them, other then bloater the code. Richard Knutsson - 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/