Re: 2.6.18-rc1-mm2
From: David Miller
Date: Sat Jul 15 2006 - 21:17:14 EST
From: Dave Jones <davej@xxxxxxxxxx>
Date: Sat, 15 Jul 2006 02:04:00 -0400
> Ick, nasty. Seems there's quite a few instances of that construct around.
The cases you grepped out here all seem to be OK to my eyes.
They fall into two categories of legitimate uses:
1) The return value really is a boolean, 0 or 1, so using
likely/unlikely around it is fine.
In fact, for a inline function returning a boolean, this
is a way to get the likely'ness to propagate into a test
done by the caller.
2) The likely() is part of some real check such as:
return (likely(test_val) ? x : y);
which is also fine.
Like I said, the bad case is only when the unlikely() or likely()
surrounds an expression that is not expected to evaluate to
a boolean.
-
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/