Re: [PATCH] mips: bug: add unlikely() to BUG_ON()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux