Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Daniel Golle" <daniel@makrotopia.org>
Cc: conor+dt@kernel.org, robh@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v5 3/4] dt-bindings: wire style checker into dt_binding_check
Date: Wed, 27 May 2026 20:28:27 +0000	[thread overview]
Message-ID: <20260527202828.0BC431F000E9@smtp.kernel.org> (raw)
In-Reply-To: <a14fdbded0acdc4fef1c1278100f2f4c6a93a488.1779908995.git.daniel@makrotopia.org>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The `cmd_chk_style` recipe contains implementation flaws: failure to connect to the GNU Make jobserver and unhandled build failure on empty file lists.
--

commit a0bf52b4283b270bea18b1e64b7f4c19cfa75a3e
Author: Daniel Golle <daniel@makrotopia.org>

dt-bindings: wire style checker into dt_binding_check

This commit wires the new dt-check-style tool into the dt_binding_check
target. It uses scripts/jobserver-exec to constrain the number of workers
based on the GNU make jobserver slots, defaulting to relaxed mode.

> diff --git a/Documentation/devicetree/bindings/Makefile b/Documentation/devicetree/bindings/Makefile
> --- 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 \

[Severity: Medium]
What happens if the file list is empty (e.g., when filtering with
DT_SCHEMA_FILES)?

If $(find_cmd) matches no files, the temporary file $$f will be empty.
Passing @$$f to dt-check-style when it is empty could result in zero
arguments, triggering an argparse error that abruptly fails the build
instead of gracefully skipping the check.

> +		      && touch $@ || true; rm -f $$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)

[Severity: Medium]
Does this recipe successfully connect to the GNU make jobserver?

The recipe uses $(call if_changed,chk_style) without the '+' prefix required
for recursive make. 

Without this prefix, GNU make (prior to v4.4) closes the jobserver file
descriptors before executing the shell. This causes jobserver-exec to fail
to reopen them and silently default to os.cpu_count(), ignoring the user's
-j constraint and potentially overloading the system.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1779908995.git.daniel@makrotopia.org?part=3

      reply	other threads:[~2026-05-27 20:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-27 19:31 [PATCH v5 0/4] dt-bindings: automated coding style check for DTS examples Daniel Golle
2026-05-27 19:32 ` [PATCH v5 1/4] dt-bindings: add DTS style checker Daniel Golle
2026-05-27 19:46   ` sashiko-bot
2026-05-27 19:32 ` [PATCH v5 2/4] scripts/jobserver-exec: propagate child exit status Daniel Golle
2026-05-27 19:32 ` [PATCH v5 3/4] dt-bindings: wire style checker into dt_binding_check Daniel Golle
2026-05-27 20:28   ` sashiko-bot [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260527202828.0BC431F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=daniel@makrotopia.org \
    --cc=devicetree@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox