Re: [PATCH v2 2/3] dt-bindings: wire style checker into dt_binding_check
From: Nathan Chancellor
Date: Thu Apr 30 2026 - 19:14:01 EST
On Wed, 29 Apr 2026 15:21:33 +0100, Daniel Golle <daniel@xxxxxxxxxxxxxx> wrote:
Hi Daniel,
Some comments from the Kbuild side.
>
> diff --git a/Documentation/devicetree/bindings/Makefile b/Documentation/devicetree/bindings/Makefile
> index 7b668f7fd400..35ddd0b7a349 100644
> --- a/Documentation/devicetree/bindings/Makefile
> +++ b/Documentation/devicetree/bindings/Makefile
> @@ -46,6 +46,19 @@ 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 && \
Please use Kbuild's $(tmp-target) for temporary files:
cmd_chk_style = $(find_cmd) >$(tmp-target) && \
I see that mk_scheme uses mktemp but all output from the build should
stay within the build folder. It would make the clean up below
unnecessary, which would simplify things future with a suggestion I have
below.
> + $(PYTHON3) $(srctree)/scripts/jobserver-exec \
> + $(PYTHON3) $(DT_CHK_STYLE) @$$f; \
@$(tmp-target)
based on the above suggestion.
> + r=$$?; rm -f $$f; \
> + if [ $$r -eq 0 ]; then touch $@; else exit $$r; fi
Does this work with Kbuild's use of 'set -e' for cmd? I think this could
just be simplified to just
touch $@
since the 'r=$$?' won't be reached if dt-check-style exists with a
non-zero exit code? Sashiko has some comments around this if you have
not already seen it:
https://sashiko.dev/#/patchset/ed254ed45f19f37a7e7933a33f2f00195d8e5f20.1777471439.git.daniel@xxxxxxxxxxxxxx
--
Cheers,
Nathan