public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Richard Knutsson <ricknu-0@student.ltu.se>
To: Nicholas Miell <nmiell@comcast.net>
Cc: Jan Engelhardt <jengelh@linux01.gwdg.de>,
	Christoph Hellwig <hch@infradead.org>,
	James.Bottomley@SteelEye.com, linux-scsi@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: Conversion to generic boolean
Date: Mon, 28 Aug 2006 23:55:22 +0200	[thread overview]
Message-ID: <44F3664A.80607@student.ltu.se> (raw)
In-Reply-To: <1156799964.24135.2.camel@entropy>

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


  reply	other threads:[~2006-08-28 21:48 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <44EFBEFA.2010707@student.ltu.se>
2006-08-28  9:32 ` Conversion to generic boolean Christoph Hellwig
2006-08-28  9:45   ` Jesper Juhl
2006-08-29 11:39     ` Christoph Hellwig
2006-08-28 10:58   ` Jan Engelhardt
2006-08-28 11:11     ` Bernd Petrovitsch
2006-08-28 12:17     ` Richard Knutsson
2006-08-28 19:15       ` Nicholas Miell
2006-08-28 20:55         ` Richard Knutsson
2006-08-28 21:19           ` Nicholas Miell
2006-08-28 21:55             ` Richard Knutsson [this message]
2006-08-29 11:41         ` Christoph Hellwig
2006-08-29 12:17           ` Jan Engelhardt
2006-08-29 13:26             ` Peter Williams
2006-08-29 13:56               ` Jan Engelhardt
2006-08-29 12:48           ` Alan Cox
2006-08-29  0:18   ` Andrew Morton
2006-08-29  1:15     ` Nick Piggin
2006-08-29  5:58       ` Jan Engelhardt
2006-08-31  3:50         ` Dmitry Torokhov
2006-09-03 12:51           ` Pavel Machek
2006-08-29  7:29       ` Anton Altaparmakov
2006-08-29 11:46         ` Christoph Hellwig
2006-08-29 12:18           ` Anton Altaparmakov
2006-08-29 11:45     ` Christoph Hellwig
2006-08-29 14:10       ` Richard Knutsson
2006-08-29 15:47       ` Andrew Morton
2006-08-29  5:43 linux

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=44F3664A.80607@student.ltu.se \
    --to=ricknu-0@student.ltu.se \
    --cc=James.Bottomley@SteelEye.com \
    --cc=hch@infradead.org \
    --cc=jengelh@linux01.gwdg.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=nmiell@comcast.net \
    /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