Re: [PATCH] 2.4.21-rc1 pointless IDE noise reduction

From: Richard B. Johnson (root@chaos.analogic.com)
Date: Thu Apr 24 2003 - 10:59:16 EST


On Thu, 24 Apr 2003, Chuck Ebbert wrote:

> Jens Axboe wrote:
>
>
> >> + return((drive->id->cfs_enable_1 & 0x0400) ? 1 : 0);
> >> }
> >
> > Seconded, it causes a lot more confusion than it does good.
>
> The return looks like a function call in that last line.
>
> That's one of the few things I find really annoying -- extra parens
> are fine when they make code clearer, but not there.
>
>
> -------
> Chuck [ C Style Police, badge #666 ]

return((drive->id->cfs_enable_1 & 0x0400) ? 1 : 0);
                                  ^^^^^^|__________ wtf?
These undefined numbers in the code are much more annoying to me...
but I don't have a C Style Police Badge.

Also, whatever that is, 0x400, I'll call it MASK, can have shorter
code like:

   return (drive->id->cfs_enable_1 && MASK); // TRUE/FALSE
... for pedantics...
   return (int) (drive->id->cfs_enable_1 && MASK);

Okay, gimmie a C Police Badge.......

Cheers,
Dick Johnson
Penguin : Linux version 2.4.20 on an i686 machine (797.90 BogoMips).
Why is the government concerned about the lunatic fringe? Think about it.

-
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/



This archive was generated by hypermail 2b29 : Wed Apr 30 2003 - 22:00:16 EST