Re: More cleanups for swsusp

From: Rusty Russell
Date: Wed Jan 21 2004 - 23:17:38 EST


On Wed, 21 Jan 2004 12:39:38 -0600
Matt Mackall <mpm@xxxxxxxxxxx> wrote:

> > > 3) BUG_ON(complex condition expression) is much less clear than:
> > >
> > > if (complex condition expression)
> > > BUG();
>
> Disagree. All BUG_ON() stuff should read like:
>
> /* check that impossible stuff didn't happen, move along, nothing to see */
> BUG_ON(...);

You can disagree all you like.

But Linus only allowed BUG_ON() because of the branch-prediction problem,
preferring explicit "if (x) BUG()". I happen to agree with him, especially
if x is a complex expression.

Rusty.
--
there are those who do and those who hang on and you don't see too
many doers quoting their contemporaries. -- Larry McVoy
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/