linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [patch 10/32] linux/bits.h: fix unsigned less than zero warnings
       [not found]     ` <CADRDgG6SXwngT5gS2EY1Y0xnPdYth-FicQyTnPyqiwpmw52eQg@mail.gmail.com>
@ 2020-06-26 13:23       ` Andy Shevchenko
  2020-06-26 14:03         ` Arnd Bergmann
  0 siblings, 1 reply; 8+ messages in thread
From: Andy Shevchenko @ 2020-06-26 13:23 UTC (permalink / raw)
  To: Rikard Falkeborn
  Cc: Linus Torvalds, Andrew Morton, Arnd Bergmann, Emil Velikov,
	Geert Uytterhoeven, Kees Cook, Linus Walleij, kernel test robot,
	mm-commits, Syed Nayyar Waris, William Breathitt Gray,
	Masahiro Yamada, Linux Kernel Mailing List

On Fri, Jun 26, 2020 at 2:37 PM Rikard Falkeborn
<rikard.falkeborn@gmail.com> wrote:
> Den fre 26 juni 2020 08:32Linus Torvalds <torvalds@linux-foundation.org> skrev:

...

> I'll just say no and point to this email next time someone complains instead.

"No" is not constructive here. People can be annoyed with warning
messages, but the real issue here are the various CI systems which
send a lot of spam because of that. As a maintainer I would need to
drop CI in order to see a good patch. If Linus considers that warning
useless, then probably you can change your patch to do what he
proposed.

-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [patch 10/32] linux/bits.h: fix unsigned less than zero warnings
  2020-06-26 13:23       ` [patch 10/32] linux/bits.h: fix unsigned less than zero warnings Andy Shevchenko
@ 2020-06-26 14:03         ` Arnd Bergmann
  2020-06-26 14:09           ` Andy Shevchenko
  2020-06-27 22:01           ` Linus Torvalds
  0 siblings, 2 replies; 8+ messages in thread
From: Arnd Bergmann @ 2020-06-26 14:03 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Rikard Falkeborn, Linus Torvalds, Andrew Morton, Emil Velikov,
	Geert Uytterhoeven, Kees Cook, Linus Walleij, kernel test robot,
	mm-commits, Syed Nayyar Waris, William Breathitt Gray,
	Masahiro Yamada, Linux Kernel Mailing List

On Fri, Jun 26, 2020 at 3:24 PM Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:
>
> On Fri, Jun 26, 2020 at 2:37 PM Rikard Falkeborn
> <rikard.falkeborn@gmail.com> wrote:
> > Den fre 26 juni 2020 08:32Linus Torvalds <torvalds@linux-foundation.org> skrev:
>
> ...
>
> > I'll just say no and point to this email next time someone complains instead.
>
> "No" is not constructive here. People can be annoyed with warning
> messages, but the real issue here are the various CI systems which
> send a lot of spam because of that. As a maintainer I would need to
> drop CI in order to see a good patch. If Linus considers that warning
> useless, then probably you can change your patch to do what he
> proposed.

How about moving that warning from W=1 to W=2? Generally speaking
I'd expect W=1 warnings to be in a category of "it's generally better to
address this in the code, but we can't turn it on by default because the
output gets too noisy", as opposed to W=2 meaning "this sometimes
finds a real problem, but fixing the warning often makes code worse."

     Arnd

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [patch 10/32] linux/bits.h: fix unsigned less than zero warnings
  2020-06-26 14:03         ` Arnd Bergmann
@ 2020-06-26 14:09           ` Andy Shevchenko
  2020-06-26 14:43             ` Arnd Bergmann
  2020-06-27 22:01           ` Linus Torvalds
  1 sibling, 1 reply; 8+ messages in thread
From: Andy Shevchenko @ 2020-06-26 14:09 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Rikard Falkeborn, Linus Torvalds, Andrew Morton, Emil Velikov,
	Geert Uytterhoeven, Kees Cook, Linus Walleij, kernel test robot,
	mm-commits, Syed Nayyar Waris, William Breathitt Gray,
	Masahiro Yamada, Linux Kernel Mailing List

On Fri, Jun 26, 2020 at 5:03 PM Arnd Bergmann <arnd@arndb.de> wrote:
> On Fri, Jun 26, 2020 at 3:24 PM Andy Shevchenko
> <andy.shevchenko@gmail.com> wrote:
> > On Fri, Jun 26, 2020 at 2:37 PM Rikard Falkeborn
> > <rikard.falkeborn@gmail.com> wrote:
> > > Den fre 26 juni 2020 08:32Linus Torvalds <torvalds@linux-foundation.org> skrev:
> >
> > ...
> >
> > > I'll just say no and point to this email next time someone complains instead.
> >
> > "No" is not constructive here. People can be annoyed with warning
> > messages, but the real issue here are the various CI systems which
> > send a lot of spam because of that. As a maintainer I would need to
> > drop CI in order to see a good patch. If Linus considers that warning
> > useless, then probably you can change your patch to do what he
> > proposed.
>
> How about moving that warning from W=1 to W=2? Generally speaking
> I'd expect W=1 warnings to be in a category of "it's generally better to
> address this in the code, but we can't turn it on by default because the
> output gets too noisy", as opposed to W=2 meaning "this sometimes
> finds a real problem, but fixing the warning often makes code worse."

It would work for me if it had been
a) documented (I didn't check if it had been already done, though);
b) understood by all CIs in the same way (see a) as well :-).

That said, I like any compromise that will reduce unneeded spam for
submitted patches from CIs and, as a bonus, get rid of warnings in my
local compilations (yes, I usually do W=1).

-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [patch 10/32] linux/bits.h: fix unsigned less than zero warnings
  2020-06-26 14:09           ` Andy Shevchenko
@ 2020-06-26 14:43             ` Arnd Bergmann
  2020-06-26 15:21               ` Kees Cook
  0 siblings, 1 reply; 8+ messages in thread
From: Arnd Bergmann @ 2020-06-26 14:43 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Rikard Falkeborn, Linus Torvalds, Andrew Morton, Emil Velikov,
	Geert Uytterhoeven, Kees Cook, Linus Walleij, kernel test robot,
	mm-commits, Syed Nayyar Waris, William Breathitt Gray,
	Masahiro Yamada, Linux Kernel Mailing List

On Fri, Jun 26, 2020 at 4:09 PM Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:
>
> On Fri, Jun 26, 2020 at 5:03 PM Arnd Bergmann <arnd@arndb.de> wrote:
> > On Fri, Jun 26, 2020 at 3:24 PM Andy Shevchenko
> > <andy.shevchenko@gmail.com> wrote:
> > > On Fri, Jun 26, 2020 at 2:37 PM Rikard Falkeborn
> > > <rikard.falkeborn@gmail.com> wrote:
> > > > Den fre 26 juni 2020 08:32Linus Torvalds <torvalds@linux-foundation.org> skrev:
> > >
> > > ...
> > >
> > > > I'll just say no and point to this email next time someone complains instead.
> > >
> > > "No" is not constructive here. People can be annoyed with warning
> > > messages, but the real issue here are the various CI systems which
> > > send a lot of spam because of that. As a maintainer I would need to
> > > drop CI in order to see a good patch. If Linus considers that warning
> > > useless, then probably you can change your patch to do what he
> > > proposed.
> >
> > How about moving that warning from W=1 to W=2? Generally speaking
> > I'd expect W=1 warnings to be in a category of "it's generally better to
> > address this in the code, but we can't turn it on by default because the
> > output gets too noisy", as opposed to W=2 meaning "this sometimes
> > finds a real problem, but fixing the warning often makes code worse."
>
> It would work for me if it had been
> a) documented (I didn't check if it had been already done, though);
> b) understood by all CIs in the same way (see a) as well :-).

I checked the 'make help' output, which describes them as

make W=n   [targets] Enable extra build checks, n=1,2,3 where
   1: warnings which may be relevant and do not occur too often
   2: warnings which occur quite often but may still be relevant
   3: more obscure warnings, can most likely be ignored
   Multiple levels can be combined with W=12 or W=123

which is less specific than the interpretation I had in mind but
I think still fits a).

      Arnd

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [patch 10/32] linux/bits.h: fix unsigned less than zero warnings
  2020-06-26 14:43             ` Arnd Bergmann
@ 2020-06-26 15:21               ` Kees Cook
  0 siblings, 0 replies; 8+ messages in thread
From: Kees Cook @ 2020-06-26 15:21 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Andy Shevchenko, Rikard Falkeborn, Linus Torvalds, Andrew Morton,
	Emil Velikov, Geert Uytterhoeven, Linus Walleij,
	kernel test robot, mm-commits, Syed Nayyar Waris,
	William Breathitt Gray, Masahiro Yamada,
	Linux Kernel Mailing List

On Fri, Jun 26, 2020 at 04:43:36PM +0200, Arnd Bergmann wrote:
> On Fri, Jun 26, 2020 at 4:09 PM Andy Shevchenko
> <andy.shevchenko@gmail.com> wrote:
> >
> > On Fri, Jun 26, 2020 at 5:03 PM Arnd Bergmann <arnd@arndb.de> wrote:
> > It would work for me if it had been
> > a) documented (I didn't check if it had been already done, though);
> > b) understood by all CIs in the same way (see a) as well :-).
> 
> I checked the 'make help' output, which describes them as
> 
> make W=n   [targets] Enable extra build checks, n=1,2,3 where
>    1: warnings which may be relevant and do not occur too often
>    2: warnings which occur quite often but may still be relevant
>    3: more obscure warnings, can most likely be ignored
>    Multiple levels can be combined with W=12 or W=123
> 
> which is less specific than the interpretation I had in mind but
> I think still fits a).

How about tweaking this as:

make W=n   [targets] Enable extra build checks, n=1,2,3 where
   1: warnings which may be relevant and do not occur too often
      and can normally be fixed in code. (Reasonable for CIs to
      use without generating too much spam.)
   2: warnings which occur quite often but may still be relevant
      to developers looking for ways to improve compilers or
      looking for very special cases. (Not usually a good idea
      for automated systems.)
   3: more obscure warnings, can most likely be ignored but have
      value to some very narrow areas of code/compiler analysis.
      Very noisy!



-- 
Kees Cook

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [patch 10/32] linux/bits.h: fix unsigned less than zero warnings
  2020-06-26 14:03         ` Arnd Bergmann
  2020-06-26 14:09           ` Andy Shevchenko
@ 2020-06-27 22:01           ` Linus Torvalds
  2020-07-08 19:07             ` [PATCH] kbuild: Move -Wtype-limits to W=2 Rikard Falkeborn
  1 sibling, 1 reply; 8+ messages in thread
From: Linus Torvalds @ 2020-06-27 22:01 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Andy Shevchenko, Rikard Falkeborn, Andrew Morton, Emil Velikov,
	Geert Uytterhoeven, Kees Cook, Linus Walleij, kernel test robot,
	mm-commits, Syed Nayyar Waris, William Breathitt Gray,
	Masahiro Yamada, Linux Kernel Mailing List

On Fri, Jun 26, 2020 at 7:03 AM Arnd Bergmann <arnd@arndb.de> wrote:
>
> How about moving that warning from W=1 to W=2?

That sounds like the right thing to do, perhaps with some extra
warnings about W=2 (and W=3) being things that you definitely
shouldn't be running in automated environments (unless you are then
very very careful to look very critically at the warnings).

            Linus

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH] kbuild: Move -Wtype-limits to W=2
  2020-06-27 22:01           ` Linus Torvalds
@ 2020-07-08 19:07             ` Rikard Falkeborn
  2020-07-08 20:00               ` Andy Shevchenko
  0 siblings, 1 reply; 8+ messages in thread
From: Rikard Falkeborn @ 2020-07-08 19:07 UTC (permalink / raw)
  To: torvalds
  Cc: akpm, andy.shevchenko, arnd, emil.l.velikov, geert, keescook,
	linus.walleij, linux-kernel, lkp, mm-commits, rikard.falkeborn,
	syednwaris, vilhelm.gray, yamada.masahiro, michal.lkml,
	linux-kbuild

-Wtype-limits is included in -Wextra which is added at W=1. It warns
(among other things) that 'comparison of an unsigned variable `< 0` is
always false. This causes noisy warnings, especially when used in
macros, hence it is more suitable for W=2.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
---
See also discussion at https://lore.kernel.org/lkml/CAHk-=wiKCXEWKJ9dWUimGbrVRo_N2RosESUw8E7m9AEtyZcu=w@mail.gmail.com/

 scripts/Makefile.extrawarn | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/scripts/Makefile.extrawarn b/scripts/Makefile.extrawarn
index 4aea7cf71d11..62c275685b75 100644
--- a/scripts/Makefile.extrawarn
+++ b/scripts/Makefile.extrawarn
@@ -35,6 +35,7 @@ KBUILD_CFLAGS += $(call cc-option, -Wstringop-truncation)
 # The following turn off the warnings enabled by -Wextra
 KBUILD_CFLAGS += -Wno-missing-field-initializers
 KBUILD_CFLAGS += -Wno-sign-compare
+KBUILD_CFLAGS += -Wno-type-limits
 
 KBUILD_CPPFLAGS += -DKBUILD_EXTRA_WARN1
 
@@ -66,6 +67,7 @@ KBUILD_CFLAGS += -Wshadow
 KBUILD_CFLAGS += $(call cc-option, -Wlogical-op)
 KBUILD_CFLAGS += -Wmissing-field-initializers
 KBUILD_CFLAGS += -Wsign-compare
+KBUILD_CFLAGS += -Wtype-limits
 KBUILD_CFLAGS += $(call cc-option, -Wmaybe-uninitialized)
 KBUILD_CFLAGS += $(call cc-option, -Wunused-macros)
 
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] kbuild: Move -Wtype-limits to W=2
  2020-07-08 19:07             ` [PATCH] kbuild: Move -Wtype-limits to W=2 Rikard Falkeborn
@ 2020-07-08 20:00               ` Andy Shevchenko
  0 siblings, 0 replies; 8+ messages in thread
From: Andy Shevchenko @ 2020-07-08 20:00 UTC (permalink / raw)
  To: Rikard Falkeborn
  Cc: Linus Torvalds, Andrew Morton, Arnd Bergmann, Emil Velikov,
	Geert Uytterhoeven, Kees Cook, Linus Walleij,
	Linux Kernel Mailing List, kbuild test robot, mm-commits,
	Syed Nayyar Waris, William Breathitt Gray, Masahiro Yamada,
	Michal Marek, Linux Kbuild mailing list

On Wed, Jul 8, 2020 at 10:08 PM Rikard Falkeborn
<rikard.falkeborn@gmail.com> wrote:
>
> -Wtype-limits is included in -Wextra which is added at W=1. It warns
> (among other things) that 'comparison of an unsigned variable `< 0` is
> always false. This causes noisy warnings, especially when used in
> macros, hence it is more suitable for W=2.
>

Suggested-by: Arnd ?

LGTM!

> Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
> ---
> See also discussion at https://lore.kernel.org/lkml/CAHk-=wiKCXEWKJ9dWUimGbrVRo_N2RosESUw8E7m9AEtyZcu=w@mail.gmail.com/
>
>  scripts/Makefile.extrawarn | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/scripts/Makefile.extrawarn b/scripts/Makefile.extrawarn
> index 4aea7cf71d11..62c275685b75 100644
> --- a/scripts/Makefile.extrawarn
> +++ b/scripts/Makefile.extrawarn
> @@ -35,6 +35,7 @@ KBUILD_CFLAGS += $(call cc-option, -Wstringop-truncation)
>  # The following turn off the warnings enabled by -Wextra
>  KBUILD_CFLAGS += -Wno-missing-field-initializers
>  KBUILD_CFLAGS += -Wno-sign-compare
> +KBUILD_CFLAGS += -Wno-type-limits
>
>  KBUILD_CPPFLAGS += -DKBUILD_EXTRA_WARN1
>
> @@ -66,6 +67,7 @@ KBUILD_CFLAGS += -Wshadow
>  KBUILD_CFLAGS += $(call cc-option, -Wlogical-op)
>  KBUILD_CFLAGS += -Wmissing-field-initializers
>  KBUILD_CFLAGS += -Wsign-compare
> +KBUILD_CFLAGS += -Wtype-limits
>  KBUILD_CFLAGS += $(call cc-option, -Wmaybe-uninitialized)
>  KBUILD_CFLAGS += $(call cc-option, -Wunused-macros)
>
> --
> 2.27.0
>


-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-07-08 20:01 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20200625202807.b630829d6fa55388148bee7d@linux-foundation.org>
     [not found] ` <20200626032946._LJ_E6G66%akpm@linux-foundation.org>
     [not found]   ` <CAHk-=wiZrhVUq3N17=GVzMQNQUKi65x=-djTM2A+fz8UdQxgEg@mail.gmail.com>
     [not found]     ` <CADRDgG6SXwngT5gS2EY1Y0xnPdYth-FicQyTnPyqiwpmw52eQg@mail.gmail.com>
2020-06-26 13:23       ` [patch 10/32] linux/bits.h: fix unsigned less than zero warnings Andy Shevchenko
2020-06-26 14:03         ` Arnd Bergmann
2020-06-26 14:09           ` Andy Shevchenko
2020-06-26 14:43             ` Arnd Bergmann
2020-06-26 15:21               ` Kees Cook
2020-06-27 22:01           ` Linus Torvalds
2020-07-08 19:07             ` [PATCH] kbuild: Move -Wtype-limits to W=2 Rikard Falkeborn
2020-07-08 20:00               ` Andy Shevchenko

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).