From: Dave Jones <[email protected]>
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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]