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@xxxxxxxxx> 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 -- To unsubscribe from this list: send the line "unsubscribe linux-sparse" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html