From: Daniel Golle Date: Wed, 27 May 2026 19:32:26 +0000 (+0100) Subject: dt-bindings: wire style checker into dt_binding_check X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4f7b894dc512a615c4424957c156bb21fa92a03e;p=thirdparty%2Flinux.git dt-bindings: wire style checker into dt_binding_check Run dt-check-style as part of dt_binding_check_one. The recipe wraps the tool with scripts/jobserver-exec so worker count follows the GNU make jobserver -- `make -j N dt_binding_check` constrains the checker to N workers rather than spawning one per CPU. Default mode (relaxed) is zero-violation on the current tree, so this does not introduce new warnings into make dt_binding_check. Stricter rules are available via --mode=strict (eg. for use by checkpatch.pl in a future series). Signed-off-by: Daniel Golle Link: https://patch.msgid.link/a14fdbded0acdc4fef1c1278100f2f4c6a93a488.1779908995.git.daniel@makrotopia.org Signed-off-by: Rob Herring (Arm) --- diff --git a/Documentation/devicetree/bindings/Makefile b/Documentation/devicetree/bindings/Makefile index 7b668f7fd400..00149e824261 100644 --- a/Documentation/devicetree/bindings/Makefile +++ b/Documentation/devicetree/bindings/Makefile @@ -46,6 +46,18 @@ quiet_cmd_chk_bindings = CHKDT $(src) xargs -n200 -P$$(nproc) $(DT_DOC_CHECKER) -u $(src)) \ && touch $@ || true +DT_CHK_STYLE = $(srctree)/scripts/dtc/dt-check-style + +# Feed the file list to the checker via @argfile in a single Python +# process so the ruamel.yaml import is paid once. scripts/jobserver-exec +# claims slots from the GNU make jobserver and exposes the count via +# $PARALLELISM, which dt-check-style picks up to size its worker pool. +quiet_cmd_chk_style = STYLE $(src) + cmd_chk_style = f=$$(mktemp) && $(find_cmd) > $$f && \ + $(PYTHON3) $(srctree)/scripts/jobserver-exec \ + $(PYTHON3) $(DT_CHK_STYLE) @$$f \ + && touch $@ || true; rm -f $$f + quiet_cmd_mk_schema = SCHEMA $@ cmd_mk_schema = f=$$(mktemp) ; \ $(find_all_cmd) > $$f ; \ @@ -62,13 +74,16 @@ override DTC_FLAGS := \ $(obj)/processed-schema.json: $(DT_DOCS) check_dtschema_version FORCE $(call if_changed,mk_schema) -targets += .dt-binding.checked .yamllint.checked +targets += .dt-binding.checked .yamllint.checked .dt-style.checked $(obj)/.yamllint.checked: $(DT_DOCS) $(src)/.yamllint FORCE $(if $(DT_SCHEMA_LINT),$(call if_changed,yamllint),) $(obj)/.dt-binding.checked: $(DT_DOCS) FORCE $(call if_changed,chk_bindings) +$(obj)/.dt-style.checked: $(DT_DOCS) FORCE + $(call if_changed,chk_style) + always-y += processed-schema.json targets += $(patsubst $(obj)/%,%, $(CHK_DT_EXAMPLES)) targets += $(patsubst $(obj)/%.dtb,%.dts, $(CHK_DT_EXAMPLES)) @@ -82,7 +97,7 @@ dt_compatible_check: $(obj)/processed-schema.json $(Q)$(srctree)/scripts/dtc/dt-extract-compatibles $(srctree) | xargs dt-check-compatible -v -s $< PHONY += dt_binding_check_one -dt_binding_check_one: $(obj)/.dt-binding.checked $(obj)/.yamllint.checked +dt_binding_check_one: $(obj)/.dt-binding.checked $(obj)/.yamllint.checked $(obj)/.dt-style.checked PHONY += dt_binding_check dt_binding_check: dt_binding_check_one $(CHK_DT_EXAMPLES)