Messages in this thread | | | From | Arnd Bergmann <> | Date | Fri, 7 Sep 2018 22:41:00 +0200 | Subject | Re: [PATCH] asm-generic: bug: add unlikely() to BUG_ON() |
| |
On Fri, Sep 7, 2018 at 9:21 PM Igor Stoppa <igor.stoppa@gmail.com> wrote: > > Add a hint to the compiler. > If BUG_ON() is used instead of BUG(), it means that probably the > preferred outcome is to not BUG(). > > The optimization is disabled, in case CONFIG_PROFILE_ANNOTATED_BRANCHES > is turned on.
This sounds like a good idea, as this is one of the more likely causes of false-positive -Wmaybe-uninitialized warnings with CONFIG_PROFILE_ANNOTATED_BRANCHES
Could you add a comment about -Wmaybe-uninitialized next to the definition? Otherwise that is easily lost.
Also, I see that the file has two separate definitions of BUG_ON(), and the other one does have an unlikely() in it already. Can you change both to do the same thing with unlikely() or not unlikely()?
Arnd
| |