From: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
To: Christopher Li <sparse@chrisli.org>
Cc: Linux-Sparse <linux-sparse@vger.kernel.org>
Subject: Re: [PATCH] Adding ignored attribute optimize
Date: Mon, 3 Jul 2017 22:41:23 +0200 [thread overview]
Message-ID: <20170703204122.wpwp4hfottgog6os@ltop.local> (raw)
In-Reply-To: <CANeU7QndbPf7cGaCYixx=YqJzBxx4DmEiAwMNXNxvCirLRZK8Q@mail.gmail.com>
On Mon, Jul 03, 2017 at 11:23:48AM -0700, Christopher Li wrote:
> On Sun, Jul 2, 2017 at 12:58 PM, Luc Van Oostenryck
> <luc.vanoostenryck@gmail.com> wrote:
> > "should report error" ...
> > What error exactly? Is there something that doesn't work on sparse
> > or on GCC's side regarding this 'require_context'? What need to be
> > fixed exactly?
>
> Have you look at the require_context code causing the warning in the
> kernel? That code only issue require_context when compiling with sparse.
Yes, I have looked at the code. Not only looked at but also searching how
it is *used*. And the result is that the defined macros are aither:
* not used (__protexted_{read,write}_by()
* always used with a macro that *also* use __context__ (__must_hold())
* a single exception: a member is declared with __protect_by() but that
change exactly nothing.
In other words, this __require_context() has exactly zero effect and
doesn't need any fixes. It can simply be removed.
> The fix should be just either convert to context parsing sparse supported,
> implement in sparse, or just remove the require_context in kernel. It is
> not doing any thing there right now. What else do you thing it is the
> right fix for it?
There is nothing to fix since nothing is broken and everything works
as it should, including sparse's context checking. At worse, someone
use for this code a version of sparse that support other kind of context
checking that was never officially supported.
> > That's *exactly* why sparse should *not* report. You have no way to
> > tell if what you're reporting is legitimate or not. And in most
> > cases it's legitimate on GCC's side but you still want to report it.
>
> I don't like sparse warn on the legit gcc attribute either.
> I have some patch should make both of us happy.
>
> GCC is open. It is not that hard to get a full list of gcc supported
> attribute names. I add the full list of gcc supported attribute list
> into the sparse. Sparse should not warn on any known gcc attributes
> any more. Patch on the way.
>
> Let's be done with this.
Will your patch also cover the new attributes in GCC8? And the ones
that clang use now or will use in the short future? Or those used
by some othesr compilers that use the same syntax, like does the
ARM's compiler?
-- Luc
prev parent reply other threads:[~2017-07-03 20:41 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-27 17:21 [PATCH] Adding ignored attribute optimize Christopher Li
2017-06-29 7:04 ` Luc Van Oostenryck
2017-06-29 21:46 ` Christopher Li
2017-07-01 9:24 ` Luc Van Oostenryck
2017-07-01 22:21 ` Christopher Li
2017-07-02 19:58 ` Luc Van Oostenryck
2017-07-03 18:23 ` Christopher Li
2017-07-03 20:41 ` Luc Van Oostenryck [this message]
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=20170703204122.wpwp4hfottgog6os@ltop.local \
--to=luc.vanoostenryck@gmail.com \
--cc=linux-sparse@vger.kernel.org \
--cc=sparse@chrisli.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