Skip to content

Commit 5e3ef45

Browse files
andredrobherring
authored andcommitted
dt-bindings: ignore paths outside kernel for DT_SCHEMA_FILES
If the location of the kernel sources contains the string that we're filtering for using DT_SCHEMA_FILES, then all schemas will currently be matched, returned and checked, not just the ones we actually expected. As an example, if the kernel sources happen to be below a directory 'google', and DT_SCHEMA_FILES=google, everything is checked. More common examples might be having the sources below people's home directories that contain the string st or arm and then searching for those. The list is endless. Fix this by only matching for schemas below the kernel source's bindings directory. Note that I opted for the implementation here so as to not having to deal with escaping DT_SCHEMA_FILES, which would have been the alternative if the grep match itself had been updated. Cc: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: André Draszik <andre.draszik@linaro.org> Link: https://lore.kernel.org/r/20231220145537.2163811-1-andre.draszik@linaro.org Signed-off-by: Rob Herring <robh@kernel.org>
1 parent 09c4931 commit 5e3ef45

File tree

1 file changed

+1
-1
lines changed
  • Documentation/devicetree/bindings

1 file changed

+1
-1
lines changed

Documentation/devicetree/bindings/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ $(obj)/%.example.dts: $(src)/%.yaml check_dtschema_version FORCE
2828
find_all_cmd = find $(srctree)/$(src) \( -name '*.yaml' ! \
2929
-name 'processed-schema*' \)
3030

31-
find_cmd = $(find_all_cmd) | grep -F -e "$(subst :," -e ",$(DT_SCHEMA_FILES))"
31+
find_cmd = $(find_all_cmd) | sed 's|^$(srctree)/$(src)/||' | grep -F -e "$(subst :," -e ",$(DT_SCHEMA_FILES))" | sed 's|^|$(srctree)/$(src)/|'
3232
CHK_DT_DOCS := $(shell $(find_cmd))
3333

3434
quiet_cmd_yamllint = LINT $(src)

0 commit comments

Comments
 (0)