From: Arnd Bergmann <arnd@arndb.de>
To: Igor Stoppa <igor.stoppa@gmail.com>
Cc: igor.stoppa@huawei.com, linux-arch <linux-arch@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] asm-generic: bug: add unlikely() to BUG_ON()
Date: Fri, 7 Sep 2018 22:41:00 +0200 [thread overview]
Message-ID: <CAK8P3a3u0z+Rkt0=UUG04o-uNC_K1+N=h+_Ucd23N-r2H=fTLg@mail.gmail.com> (raw)
In-Reply-To: <20180907192119.4931-1-igor.stoppa@huawei.com>
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
next prev parent reply other threads:[~2018-09-07 20:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-07 19:21 [PATCH] asm-generic: bug: add unlikely() to BUG_ON() Igor Stoppa
2018-09-07 19:21 ` Igor Stoppa
2018-09-07 20:41 ` Arnd Bergmann [this message]
2018-09-07 20:41 ` Arnd Bergmann
2018-09-08 4:32 ` Igor Stoppa
2018-09-08 4:32 ` Igor Stoppa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAK8P3a3u0z+Rkt0=UUG04o-uNC_K1+N=h+_Ucd23N-r2H=fTLg@mail.gmail.com' \
--to=arnd@arndb.de \
--cc=igor.stoppa@gmail.com \
--cc=igor.stoppa@huawei.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).