All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scripts: dtc: only show unique unit address warning for enabled nodes
@ 2022-10-21  8:44 Alexandre Torgue
  2022-10-21 14:25 ` Rob Herring
  0 siblings, 1 reply; 2+ messages in thread
From: Alexandre Torgue @ 2022-10-21  8:44 UTC (permalink / raw)
  To: Masahiro Yamada, Michal Marek, robh+dt
  Cc: linux-kernel, linux-kbuild, linux-stm32, alexandre.torgue

In some cases an hardware peripheral can be used for two exclusive usages.
For example, on STM32MP15 we have the same peripheral for I2S and SPI. We
have dedicated driver for each usage and so a dedicated device node in
devicetree.
To avoid to get useless warnings running "make W=1 dtbs", this patch adds
the "-Wunique_unit_address_if_enabled" flag for a make with W=1. In this
case we will detect a duplicate address only if both devices are
enabled in the devicetree, which is a real error case.

Signed-off-by: Alexandre Torgue <alexandre.torgue@foss.st.com>

diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 3aa384cec76b..6f077200b967 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -344,6 +344,9 @@ DTC_FLAGS += -Wno-unit_address_vs_reg \
 	-Wno-graph_child_address \
 	-Wno-simple_bus_reg \
 	-Wno-unique_unit_address
+else
+DTC_FLAGS += -Wno-unique_unit_address \
+        -Wunique_unit_address_if_enabled
 endif
 
 ifneq ($(findstring 2,$(KBUILD_EXTRA_WARN)),)
-- 
2.17.1


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

* Re: [PATCH] scripts: dtc: only show unique unit address warning for enabled nodes
  2022-10-21  8:44 [PATCH] scripts: dtc: only show unique unit address warning for enabled nodes Alexandre Torgue
@ 2022-10-21 14:25 ` Rob Herring
  0 siblings, 0 replies; 2+ messages in thread
From: Rob Herring @ 2022-10-21 14:25 UTC (permalink / raw)
  To: Alexandre Torgue
  Cc: Masahiro Yamada, linux-kbuild, robh+dt, Michal Marek,
	linux-kernel, linux-stm32

On Fri, 21 Oct 2022 10:44:47 +0200, Alexandre Torgue wrote:
> In some cases an hardware peripheral can be used for two exclusive usages.
> For example, on STM32MP15 we have the same peripheral for I2S and SPI. We
> have dedicated driver for each usage and so a dedicated device node in
> devicetree.
> To avoid to get useless warnings running "make W=1 dtbs", this patch adds
> the "-Wunique_unit_address_if_enabled" flag for a make with W=1. In this
> case we will detect a duplicate address only if both devices are
> enabled in the devicetree, which is a real error case.
> 
> Signed-off-by: Alexandre Torgue <alexandre.torgue@foss.st.com>
> 

Applied, thanks!

I refactored the options and kept 'unique_unit_address' for W=2.

Rob

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

end of thread, other threads:[~2022-10-21 14:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-21  8:44 [PATCH] scripts: dtc: only show unique unit address warning for enabled nodes Alexandre Torgue
2022-10-21 14:25 ` Rob Herring

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.