Re: More cleanups for swsusp

Rusty Russell
2004-01-22T04:16:38Z

On Wed, 21 Jan 2004 12:39:38 -0600
Matt Mackall <mpm@selenic.com> 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