Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dt-bindings: Consider DT_SCHEMA_FILES when finding all json-schema

Setting DT_SCHEMA_FILES allows the user to restrict the
"dt_binding_check" make target to a specified set of DT binding files.
However, yamllint is still run on all available files, which not only
takes time, but also outputs warnings for other binding files the
developer is not interested in.

Fix this by renaming "find_cmd" to "find_all_cmd", introducing a new
"find_cmd" to only return the files specified by DT_SCHEMA_FILES (if
present), and using the latter for yamllint and dt-doc-validate.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/174ab1d791b7bc65f3b0f11b72be13af1748c731.1634551582.git.geert+renesas@glider.be
[robh: Also use only DT_SCHEMA_FILES for dt-doc-validate]
Signed-off-by: Rob Herring <robh@kernel.org>

authored by

Geert Uytterhoeven and committed by
Rob Herring
378be0cc 3985aa6f

+11 -4
+11 -4
Documentation/devicetree/bindings/Makefile
··· 22 22 # Use full schemas when checking %.example.dts 23 23 DT_TMP_SCHEMA := $(obj)/processed-schema-examples.json 24 24 25 - find_cmd = find $(srctree)/$(src) \( -name '*.yaml' ! \ 25 + find_all_cmd = find $(srctree)/$(src) \( -name '*.yaml' ! \ 26 26 -name 'processed-schema*' ! \ 27 27 -name '*.example.dt.yaml' \) 28 28 29 + ifeq ($(DT_SCHEMA_FILES),) 30 + find_cmd = $(find_all_cmd) 31 + else 32 + find_cmd = echo $(addprefix $(srctree)/, $(DT_SCHEMA_FILES)) 33 + endif 34 + 29 35 quiet_cmd_yamllint = LINT $(src) 30 36 cmd_yamllint = ($(find_cmd) | \ 31 - xargs -n200 -P$$(nproc) $(DT_SCHEMA_LINT) -f parsable -c $(srctree)/$(src)/.yamllint >&2) || true 37 + xargs -n200 -P$$(nproc) \ 38 + $(DT_SCHEMA_LINT) -f parsable -c $(srctree)/$(src)/.yamllint >&2) || true 32 39 33 40 quiet_cmd_chk_bindings = CHKDT $@ 34 41 cmd_chk_bindings = ($(find_cmd) | \ ··· 45 38 cmd_mk_schema = f=$$(mktemp) ; \ 46 39 $(if $(DT_MK_SCHEMA_FLAGS), \ 47 40 printf '%s\n' $(real-prereqs), \ 48 - $(find_cmd)) > $$f ; \ 41 + $(find_all_cmd)) > $$f ; \ 49 42 $(DT_MK_SCHEMA) -j $(DT_MK_SCHEMA_FLAGS) @$$f > $@ ; \ 50 43 rm -f $$f 51 44 ··· 55 48 $(call cmd,mk_schema) 56 49 endef 57 50 58 - DT_DOCS = $(patsubst $(srctree)/%,%,$(shell $(find_cmd))) 51 + DT_DOCS = $(patsubst $(srctree)/%,%,$(shell $(find_all_cmd))) 59 52 60 53 override DTC_FLAGS := \ 61 54 -Wno-avoid_unnecessary_addr_size \