Re: [PATCH] Fix WARN_ON / WARN_ON_ONCE regression

From: Herbert Xu
Date: Thu Oct 05 2006 - 18:04:35 EST


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@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
-
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/