devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kbuild: fix W= option checks for extra DTC warnings
@ 2018-01-18  3:31 Masahiro Yamada
  2018-01-18  9:25 ` Arnd Bergmann
  2018-01-28  1:41 ` Masahiro Yamada
  0 siblings, 2 replies; 3+ messages in thread
From: Masahiro Yamada @ 2018-01-18  3:31 UTC (permalink / raw)
  To: linux-kbuild
  Cc: devicetree, Michal Marek, Arnd Bergmann, Rob Herring,
	linux-kernel, Masahiro Yamada, Sam Ravnborg, linux-arm-kernel

Kbuild supports 3 levels of extra warnings, and multiple levels can
be combined, like W=12, W=123.  It was added by commit a6de553da01c
("kbuild: Allow to combine multiple W= levels").

>From the log of commit 8654cb8d0371 ("dtc: update warning settings
for new bus and node/property name checks"), I assume:

 - unit_address_vs_reg, simple_bus_reg, etc. belong to level 1
 - node_name_chars_strict, property_name_chars_strict belong to level 2

However, the level 1 warnings are displayed by any argument to W=.
On the other hand, the level 2 warnings are displayed by W=2, but
not by W=12, or W=123.

Use $(findstring ...) like scripts/Makefile.extrawarn.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

Side Notes for possible additional works:

 [1] I implemented DTC extra warnings differently in U-Boot:

    https://github.com/u-boot/u-boot/blob/v2018.01/scripts/Makefile.extrawarn#L64

    Better to collect extra warning stuff into scripts/Makefile.extrawarn ?

 [2] KBUILD_ENABLE_EXTRA_GCC_CHECKS is getting a historical misnomer
     because we use it for Clang and DTC too.

     Better to rename?  (keeping backward-compatibility for a while)?


 scripts/Makefile.lib | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 1ca4dcd..7dee1da 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -264,7 +264,7 @@ cmd_gzip = (cat $(filter-out FORCE,$^) | gzip -n -f -9 > $@) || \
 DTC ?= $(objtree)/scripts/dtc/dtc
 
 # Disable noisy checks by default
-ifeq ($(KBUILD_ENABLE_EXTRA_GCC_CHECKS),)
+ifeq ($(findstring 1,$(KBUILD_ENABLE_EXTRA_GCC_CHECKS)),)
 DTC_FLAGS += -Wno-unit_address_vs_reg \
 	-Wno-simple_bus_reg \
 	-Wno-unit_address_format \
@@ -273,7 +273,7 @@ DTC_FLAGS += -Wno-unit_address_vs_reg \
 	-Wno-pci_device_reg
 endif
 
-ifeq ($(KBUILD_ENABLE_EXTRA_GCC_CHECKS),2)
+ifneq ($(findstring 2,$(KBUILD_ENABLE_EXTRA_GCC_CHECKS)),)
 DTC_FLAGS += -Wnode_name_chars_strict \
 	-Wproperty_name_chars_strict
 endif
-- 
2.7.4

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

* Re: [PATCH] kbuild: fix W= option checks for extra DTC warnings
  2018-01-18  3:31 [PATCH] kbuild: fix W= option checks for extra DTC warnings Masahiro Yamada
@ 2018-01-18  9:25 ` Arnd Bergmann
  2018-01-28  1:41 ` Masahiro Yamada
  1 sibling, 0 replies; 3+ messages in thread
From: Arnd Bergmann @ 2018-01-18  9:25 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Linux Kbuild mailing list, Linux ARM, DTML, Rob Herring,
	Sam Ravnborg, Michal Marek, Linux Kernel Mailing List

On Thu, Jan 18, 2018 at 4:31 AM, Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
> Kbuild supports 3 levels of extra warnings, and multiple levels can
> be combined, like W=12, W=123.  It was added by commit a6de553da01c
> ("kbuild: Allow to combine multiple W= levels").
>
> From the log of commit 8654cb8d0371 ("dtc: update warning settings
> for new bus and node/property name checks"), I assume:
>
>  - unit_address_vs_reg, simple_bus_reg, etc. belong to level 1
>  - node_name_chars_strict, property_name_chars_strict belong to level 2
>
> However, the level 1 warnings are displayed by any argument to W=.
> On the other hand, the level 2 warnings are displayed by W=2, but
> not by W=12, or W=123.
>
> Use $(findstring ...) like scripts/Makefile.extrawarn.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

Good catch!

Acked-by: Arnd Bergmann <arnd@arndb.de>

> Side Notes for possible additional works:
>
>  [1] I implemented DTC extra warnings differently in U-Boot:
>
>     https://github.com/u-boot/u-boot/blob/v2018.01/scripts/Makefile.extrawarn#L64
>
>     Better to collect extra warning stuff into scripts/Makefile.extrawarn ?
>
>  [2] KBUILD_ENABLE_EXTRA_GCC_CHECKS is getting a historical misnomer
>      because we use it for Clang and DTC too.
>
>      Better to rename?  (keeping backward-compatibility for a while)?

I'd suggest we leave it for now, I still plan to eventually do my
large rework of
the way we handle extra warning levels, likely that will result in
Makefile.extrawarn
being completely replaced.

       Arnd

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

* Re: [PATCH] kbuild: fix W= option checks for extra DTC warnings
  2018-01-18  3:31 [PATCH] kbuild: fix W= option checks for extra DTC warnings Masahiro Yamada
  2018-01-18  9:25 ` Arnd Bergmann
@ 2018-01-28  1:41 ` Masahiro Yamada
  1 sibling, 0 replies; 3+ messages in thread
From: Masahiro Yamada @ 2018-01-28  1:41 UTC (permalink / raw)
  To: Linux Kbuild mailing list
  Cc: linux-arm-kernel, Arnd Bergmann, devicetree, Rob Herring,
	Sam Ravnborg, Michal Marek, Masahiro Yamada,
	Linux Kernel Mailing List

2018-01-18 12:31 GMT+09:00 Masahiro Yamada <yamada.masahiro@socionext.com>:
> Kbuild supports 3 levels of extra warnings, and multiple levels can
> be combined, like W=12, W=123.  It was added by commit a6de553da01c
> ("kbuild: Allow to combine multiple W= levels").
>
> From the log of commit 8654cb8d0371 ("dtc: update warning settings
> for new bus and node/property name checks"), I assume:
>
>  - unit_address_vs_reg, simple_bus_reg, etc. belong to level 1
>  - node_name_chars_strict, property_name_chars_strict belong to level 2
>
> However, the level 1 warnings are displayed by any argument to W=.
> On the other hand, the level 2 warnings are displayed by W=2, but
> not by W=12, or W=123.
>
> Use $(findstring ...) like scripts/Makefile.extrawarn.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
>

Applied to linux-kbuild/kbuild.


-- 
Best Regards
Masahiro Yamada

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

end of thread, other threads:[~2018-01-28  1:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-18  3:31 [PATCH] kbuild: fix W= option checks for extra DTC warnings Masahiro Yamada
2018-01-18  9:25 ` Arnd Bergmann
2018-01-28  1:41 ` Masahiro Yamada

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