History

scripts: dtc: only show unique unit address warning for enabled nodes

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.

Alexandre Torgue committed 4 years ago

Commit ae5a16c1 parent 33ce4531 file · +8 −4Browse files

Showing the changes to scripts (1 of 1 file). Show all

Unified · Split

scripts/Makefile.lib+8−4
@@ -334,7 +334,8 @@ quiet_cmd_gzip = GZIP $@ · 333 unmodified lines
334# DTC334# DTC
335# ---------------------------------------------------------------------------335# ---------------------------------------------------------------------------
336DTC ?= $(objtree)/scripts/dtc/dtc336DTC ?= $(objtree)/scripts/dtc/dtc
337DTC_FLAGS += -Wno-interrupt_provider337DTC_FLAGS += -Wno-interrupt_provider \
338 -Wno-unique_unit_address
338 339
339# Disable noisy checks by default340# Disable noisy checks by default
340ifeq ($(findstring 1,$(KBUILD_EXTRA_WARN)),)341ifeq ($(findstring 1,$(KBUILD_EXTRA_WARN)),)
@@ -342,14 +343,17 @@ DTC_FLAGS += -Wno-unit_address_vs_reg \ · 1 unmodified line
342 -Wno-avoid_unnecessary_addr_size \343 -Wno-avoid_unnecessary_addr_size \
343 -Wno-alias_paths \344 -Wno-alias_paths \
344 -Wno-graph_child_address \345 -Wno-graph_child_address \
345 -Wno-simple_bus_reg \346 -Wno-simple_bus_reg
346 -Wno-unique_unit_address347else
348DTC_FLAGS += \
349 -Wunique_unit_address_if_enabled
347endif350endif
348 351
349ifneq ($(findstring 2,$(KBUILD_EXTRA_WARN)),)352ifneq ($(findstring 2,$(KBUILD_EXTRA_WARN)),)
350DTC_FLAGS += -Wnode_name_chars_strict \353DTC_FLAGS += -Wnode_name_chars_strict \
351 -Wproperty_name_chars_strict \354 -Wproperty_name_chars_strict \
352 -Winterrupt_provider355 -Winterrupt_provider \
356 -Wunique_unit_address
353endif357endif
354 358
355DTC_FLAGS += $(DTC_FLAGS_$(basetarget))359DTC_FLAGS += $(DTC_FLAGS_$(basetarget))

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t