Re: [patch 16/30] drivers/scsi/aic7xxx_old: Convert to generic boolean-values

2007-05-08 Thread James Bottomley
On Mon, 2007-05-07 at 14:06 -0700, Andrew Morton wrote:
 On Mon, 07 May 2007 14:50:19 -0500
 James Bottomley [EMAIL PROTECTED] wrote:
 
  On Thu, 2007-04-26 at 00:35 -0700, [EMAIL PROTECTED] wrote:
   From: Richard Knutsson [EMAIL PROTECTED]
   
   Convert:
   FALSE - false
   TRUE  - true
  
  NAK'd by maintainer.
  
 
 I went back and reviewed the previous discussion.  Maintaner's reasons for
 NAKing were, and remain wholly specious.

Well, I agree with them.  There are three primary reasons for this

 1. In C logical values are arithmetic types by design.  Trying to
backfill C++ ideas of separation of logical and arithmetic types
is asking for bugs.
 2. If people have to use boolean values (which I don't like; I
prefer simple assignment and checking), I prefer the upper case
values because, effectively, they're simple arithmetical
constants.
 3. it's going to generate a huge amount of churn in all the
subsystems and drivers for no appreciable benefit.  Unless
someone can actually articulate one?  (Other than because it's
there).

The patch in question basically just downcased the TRUE/FALSE in the
driver, which makes it less readable (mainly because I really don't like
the way it uses truth values, but that's a maintainer's prerogative, and
I recognise the upper case values as warning me to be careful).

 That being said, the patch is moderately wrong (or at least incomplete)
 because it does things like:
 
 -unsigned char done = FALSE;
 +unsigned char done = false;
 
 whereas it should have done
 
 -unsigned char done = FALSE;
 +bool done = false;

And the value to the driver of this transformation?

James


-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [patch 16/30] drivers/scsi/aic7xxx_old: Convert to generic boolean-values

2007-05-08 Thread Andrew Morton
On Tue, 08 May 2007 14:24:32 -0500
James Bottomley [EMAIL PROTECTED] wrote:

 However, could we compromise and just add TRUE = true, FALSE = false to
 the enum?

That sounds sane.  But I don't recall all the details of the discussion
and perhaps I'm missing something.

I think the whole bool/true/false thing is pretty dissatisfactory really. 
Java gets this right and C cannot and will not and we end up with people
using true and false as plain old 1 and 0.
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [patch 16/30] drivers/scsi/aic7xxx_old: Convert to generic boolean-values

2007-05-08 Thread James Bottomley
On Tue, 2007-05-08 at 13:11 -0700, Andrew Morton wrote:
 On Tue, 08 May 2007 14:24:32 -0500
 James Bottomley [EMAIL PROTECTED] wrote:
 
  However, could we compromise and just add TRUE = true, FALSE = false to
  the enum?
 
 That sounds sane.  But I don't recall all the details of the discussion
 and perhaps I'm missing something.
 
 I think the whole bool/true/false thing is pretty dissatisfactory really. 
 Java gets this right and C cannot and will not and we end up with people
 using true and false as plain old 1 and 0.

Right, that's the core of my complaint ... zero is false and anything
else is true ... I rather like the C isms that allow things like

if (ptr)
*ptr = ...

If there were evidence that the C treatment of logicals as arithmeticals
was causing huge problems for driver writers, then yes I'd reconsider my
position ... but really any driver writer has to use bare metal
arithmetical values interchangeably with logical values because that's
the way device registers work.

James


-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [patch 16/30] drivers/scsi/aic7xxx_old: Convert to generic boolean-values

2007-05-08 Thread David Miller
From: Andrew Morton [EMAIL PROTECTED]
Date: Tue, 8 May 2007 13:11:52 -0700

 On Tue, 08 May 2007 14:24:32 -0500
 James Bottomley [EMAIL PROTECTED] wrote:
 
  However, could we compromise and just add TRUE = true, FALSE = false to
  the enum?
 
 That sounds sane.  But I don't recall all the details of the discussion
 and perhaps I'm missing something.
 
 I think the whole bool/true/false thing is pretty dissatisfactory really. 
 Java gets this right and C cannot and will not and we end up with people
 using true and false as plain old 1 and 0.

I think it's more important to be consistent across the entire tree,
whatever we choose, than to be nice and add compat define hacks for
the sake of a select few stubborn drivers.

If you're going to add those ugly #define TRUE true bits, the whole
point of the change is lost so you might as not make it at all.
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [patch 16/30] drivers/scsi/aic7xxx_old: Convert to generic boolean-values

2007-05-08 Thread James Bottomley
On Tue, 2007-05-08 at 14:44 -0700, David Miller wrote:
 From: Andrew Morton [EMAIL PROTECTED]
 Date: Tue, 8 May 2007 13:11:52 -0700
 
  On Tue, 08 May 2007 14:24:32 -0500
  James Bottomley [EMAIL PROTECTED] wrote:
  
   However, could we compromise and just add TRUE = true, FALSE = false to
   the enum?
  
  That sounds sane.  But I don't recall all the details of the discussion
  and perhaps I'm missing something.
  
  I think the whole bool/true/false thing is pretty dissatisfactory really. 
  Java gets this right and C cannot and will not and we end up with people
  using true and false as plain old 1 and 0.

In that case, I think we go with what's there, which seems to be
predominantly TRUE/FALSE.

 I think it's more important to be consistent across the entire tree,
 whatever we choose, than to be nice and add compat define hacks for
 the sake of a select few stubborn drivers.
 
 If you're going to add those ugly #define TRUE true bits, the whole
 point of the change is lost so you might as not make it at all.

That too wouldn't be an unacceptable outcome ...

James


-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [patch 16/30] drivers/scsi/aic7xxx_old: Convert to generic boolean-values

2007-05-07 Thread James Bottomley
On Thu, 2007-04-26 at 00:35 -0700, [EMAIL PROTECTED] wrote:
 From: Richard Knutsson [EMAIL PROTECTED]
 
 Convert:
 FALSE - false
 TRUE  - true

NAK'd by maintainer.

James


-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [patch 16/30] drivers/scsi/aic7xxx_old: Convert to generic boolean-values

2007-05-07 Thread Andrew Morton
On Mon, 7 May 2007 14:06:56 -0700
Andrew Morton [EMAIL PROTECTED] wrote:

 so I'll drop it on those grounds, not on the bogus ones.

However it will come back again.  All subsystem-private implementations
of TRUE and FALSE are in the firing line now.
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [patch 16/30] drivers/scsi/aic7xxx_old: Convert to generic boolean-values

2007-05-07 Thread Richard Knutsson

Andrew Morton wrote:

On Mon, 7 May 2007 14:06:56 -0700
Andrew Morton [EMAIL PROTECTED] wrote:

  

so I'll drop it on those grounds, not on the bogus ones.



However it will come back again.  All subsystem-private implementations
of TRUE and FALSE are in the firing line now.
  

Amen.
But should we let it rest until most of the other (boolean) conversions 
are done (as with CIFS and XFS (iirc)), otherwise I can take a new stab 
at it this weekend.


Btw Andrew, do you want me to Cc: you all the patches or should I 
continue to first send them to (hopefully the correct) maintainer(s)/ML, 
and send them your way if they are not picked up (is one week enough, or 
should it be longer?)


Regards
Richard Knutsson

-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html