Messages in this thread | | | Subject | Re: [PATCH] mips: bug: add unlikely() to BUG_ON() | From | Igor Stoppa <> | Date | Mon, 10 Sep 2018 12:45:03 +0300 |
| |
Hi Paul,
On 08/09/18 01:02, Paul Burton wrote:
> I'm not sure this will actually do anything. > > __BUG_ON() doesn't use the value of its condition argument for regular > control flow unless it's compile-time constant anyway, in which case > unlikely() should be redundant because the compiler knows the value > already. > > If the condition isn't compile-time constant then we just emit a tne > (trap-if-not-equal) instruction using inline asm. That will generate an > exception if the value is non-zero at runtime. I don't see how adding > unlikely() is going to help the compiler do anything differently with > that.
Thank you for the explanation. Please discard this patch.
-- igor
| |