[Ksummit-discuss] [MAINTAINERS SUMMIT] API replacement/deprecation

Arnd Bergmann arnd at arndb.de
Tue Sep 11 11:08:03 UTC 2018


On Tue, Sep 11, 2018 at 11:35 AM Mauro Carvalho Chehab
<mchehab+samsung at kernel.org> wrote:
>
> Em Tue, 11 Sep 2018 11:10:22 +0300
> Jani Nikula <jani.nikula at intel.com> escreveu:
>
> > On Mon, 10 Sep 2018, Mauro Carvalho Chehab <mchehab+samsung at kernel.org> wrote:
> > > IMHO, whatever solution, the best would be to have a makefile
> > > target equivalent to allmodconfig and allyesconfig that would
> > > add such extra maintainership logic.
> >
> > There's 'make W=n' for enabling extra gcc checks. Seems like a good fit.
>
> I wouldn't mess with W. On media, we work to have zero warnings with W=1.
> However, W=2 (and W=3) is almost unusable: lots of complains about
> signed/unsigned mix and other things that usually are ok. With gcc 8,
> the amount of warnings with W=2/W=3 at core kAPI functions makes them
> useless.
>
> People will very likely ignore or miss deprecated stuff if we
> place it as W=4.
>
> Perhaps we could add a D=1, in order to point for deprecated stuff.

I don't like the idea of adding another dimension with D=1, but I'm all for
reviewing the sets of warnings we enable at W=2/W=3  and possibly
introducing a W=4.

I've done some research on this in the past, and can probably do that
again (not sure how valuable my old data still is).
https://github.com/Barro/compiler-warnings has a list of warnings
for all compiler releases we support, and some categorizations.

I would like to add a line for each of those warnings in
include/linux/compiler-warnings.h with the compiler version that
introduced it and the warning level we want to have it enabled at,
plus some comment about why that level. We can start with the
status quo (listing the level that each warning is currently
enabled at) and then do changes based on the output of
'make W=123', which I'm sure immediately shows some that
are misclassified based on the number of warnings they produce
for randconfig and allmodconfig builds.

The definitions that I'd use for the levels would be (close to the
current definition)

W=0 (default): -Wall warnings and some -Wextra warnings that
      have zero known false positives
W=1: Most -Wextra warnings, plus everything from -Wall
      that didn't make it into W=0
W=2: clang -Wmost and the the gcc equivalent, as long as
     they are useful in the kernel context. There should be no
     warnings in common header files
W=3: clang -Weverything warnings and the gcc equivalent,
     including very noisy ones, but still only the ones that make
     sense for the kernel.

I think being able to warn for deprecated functions would fit
into W=1 or W=2 if we want to bring that back, though given that
Linus just removed __deprecated with prejudice, I wouldn't
invest any work into that part myself.

        Arnd


More information about the Ksummit-discuss mailing list