Re: [PATCH] Fix WARN_ON / WARN_ON_ONCE regression

Herbert Xu
2006-10-05T22:04:19Z

On Thu, Oct 05, 2006 at 02:52:13PM -0700, Andrew Morton wrote:
>
> Herbert had a good-sounding reason for wanting this feature, but afaict he
> hasn't proceeded to use it at this stage. And he's hiding from us ;)

Well you guys had everything under control so I was happy to stay
behind my rock :)

The original reason for the return value is so you can do

if (WARN_ON(impossible_condition)) {
attempt_to_continue;
}

instead of

if (unlikely(impossible_condition)) {
WARN_ON(1);
attempt_to_continue;
}

Oh and yes the unlikely does make a difference in a statement
expression.

Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt