Skip to content

Commit 6552b72

Browse files
robherringmasahir0y
authored andcommitted
dt-bindings: kbuild: Split targets out to separate rules
Masahiro pointed out the use of if_changed_rule is incorrect and command line changes are not correctly accounted for. To fix this, split up the DT binding validation target, dt_binding_check, into multiple rules for each step: yamllint, schema validtion with meta-schema, and building the processed schema. One change in behavior is the yamllint or schema validation will be re-run again when there are warnings present. Reported-by: Masahiro Yamada <[email protected]> Link: https://lore.kernel.org/all/[email protected]/ Signed-off-by: Rob Herring <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]>
1 parent da6011a commit 6552b72

File tree

1 file changed

+14
-11
lines changed
  • Documentation/devicetree/bindings

1 file changed

+14
-11
lines changed

Documentation/devicetree/bindings/Makefile

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,24 +37,20 @@ CHK_DT_EXAMPLES := $(patsubst $(srctree)/%.yaml,%.example.dtb, $(shell $(find_cm
3737
quiet_cmd_yamllint = LINT $(src)
3838
cmd_yamllint = ($(find_cmd) | \
3939
xargs -n200 -P$$(nproc) \
40-
$(DT_SCHEMA_LINT) -f parsable -c $(srctree)/$(src)/.yamllint >&2) || true
40+
$(DT_SCHEMA_LINT) -f parsable -c $(srctree)/$(src)/.yamllint >&2) \
41+
&& touch $@ || true
4142

42-
quiet_cmd_chk_bindings = CHKDT $@
43+
quiet_cmd_chk_bindings = CHKDT $(src)
4344
cmd_chk_bindings = ($(find_cmd) | \
44-
xargs -n200 -P$$(nproc) $(DT_DOC_CHECKER) -u $(srctree)/$(src)) || true
45+
xargs -n200 -P$$(nproc) $(DT_DOC_CHECKER) -u $(srctree)/$(src)) \
46+
&& touch $@ || true
4547

4648
quiet_cmd_mk_schema = SCHEMA $@
4749
cmd_mk_schema = f=$$(mktemp) ; \
4850
$(find_all_cmd) > $$f ; \
4951
$(DT_MK_SCHEMA) -j $(DT_MK_SCHEMA_FLAGS) @$$f > $@ ; \
5052
rm -f $$f
5153

52-
define rule_chkdt
53-
$(if $(DT_SCHEMA_LINT),$(call cmd,yamllint),)
54-
$(call cmd,chk_bindings)
55-
$(call cmd,mk_schema)
56-
endef
57-
5854
DT_DOCS = $(patsubst $(srctree)/%,%,$(shell $(find_all_cmd)))
5955

6056
override DTC_FLAGS := \
@@ -64,8 +60,15 @@ override DTC_FLAGS := \
6460
-Wno-unique_unit_address \
6561
-Wunique_unit_address_if_enabled
6662

67-
$(obj)/processed-schema.json: $(DT_DOCS) $(src)/.yamllint check_dtschema_version FORCE
68-
$(call if_changed_rule,chkdt)
63+
$(obj)/processed-schema.json: $(DT_DOCS) check_dtschema_version FORCE
64+
$(call if_changed,mk_schema)
65+
66+
always-$(CHECK_DT_BINDING) += .dt-binding.checked .yamllint.checked
67+
$(obj)/.yamllint.checked: $(DT_DOCS) $(src)/.yamllint FORCE
68+
$(if $(DT_SCHEMA_LINT),$(call if_changed,yamllint),)
69+
70+
$(obj)/.dt-binding.checked: $(DT_DOCS) FORCE
71+
$(call if_changed,chk_bindings)
6972

7073
always-y += processed-schema.json
7174
always-$(CHECK_DT_BINDING) += $(patsubst $(obj)/%,%, $(CHK_DT_EXAMPLES))

0 commit comments

Comments
 (0)