[lkml]   [2000]   [Feb]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Kernel bugs found using inspect tool
Peter T. Breuer wrote:
> It would be even nicer if someone wrote
> aal5 = (vcc->qos.aal == ATM_AAL5);
> if (!aal5) { ...

Taking the assignment out of the if sounds like a good idea. Adding
parentheses much less so. If people find C's precendence rules difficult
to understand, it doesn't help to give them examples where precedence is
enforced by redundant parentheses as if to suggest they were necessary,
particularly if the intended meaning is obvious (which, I agree, may not
be the case in the original code).

> or even used a switch, since it's that kind of thing here.

Not quite - the hardware doesn't know anything but AAL5 or non-AAL5.

> Maybe it's just me, but this routine has if(aal5) all the way through,
> and should probably be split into two.

Then you'd also duplicate a lot of other, common, and quite hairy code.
The driver is complex enough already ...

- Werner

/ Werner Almesberger, ICA, EPFL, CH /

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:56    [W:0.065 / U:4.776 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site