From: sashiko-bot@kernel.org
To: "Krzysztof Kozlowski" <krzysztof.kozlowski@oss.qualcomm.com>
Cc: robh@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v5 09/10] dtc: dt-check-style: Add warning for redundant white-spaces
Date: Wed, 26 Aug 2026 10:33:19 +0000 [thread overview]
Message-ID: <20260826103319.BC26A1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260826-n-dts-style-checker-continued-v5-9-fdd16ca6e771@oss.qualcomm.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] The patch adds an undocumented check for redundant whitespace after ':', creating a meaningful commit message and code mismatch.
- [Low] The newly added `check_redundant_whitespace_strict` function fails to inspect continuation lines.
--
commit 57a0fd97078063900e6ed8376ac59fb6edea822d
Author: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
dtc: dt-check-style: Add warning for redundant white-spaces
Show warnings of too many spaces around '=', before '{' and ';'
characters, or using tabs for these. Both in-tree DTS and DT bindings
have many warnings for the first case (too mant spaces around '='), thus
keep this one only for 'strict' mode.
> diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style
> index da7edd5ea079d..a60891d76137f 100755
> --- a/scripts/dtc/dt-check-style
> +++ b/scripts/dtc/dt-check-style
> @@ -349,6 +349,42 @@ def check_trailing_whitespace(ctx):
> yield (dl.lineno, 'trailing whitespace')
>
>
> +def _check_redundant_whitespace(dl):
> + if dl.linetype in (LineType.COMMENT, LineType.COMMENT_BODY,
> + LineType.COMMENT_END, LineType.COMMENT_START,
> + LineType.PREPROCESSOR):
> + return
> + if re.search(r'(\s\s+|\t)\{', dl.code):
> + yield (dl.lineno, 'extra whitespace before {')
> + if re.search(r':(\s\s+|\t)', dl.code):
> + yield (dl.lineno, 'extra whitespace after :')
[Severity: Medium]
The commit message states: "Show warnings of too many spaces around '=',
before '{' and ';' characters, or using tabs for these."
Does this undocumented check for redundant whitespace after ':' in
_check_redundant_whitespace() create a meaningful mismatch between the
commit message and the code?
> + if re.search(r'\s+;', dl.code):
> + yield (dl.lineno, 'extra whitespace before ;')
> +
> +
> +def check_redundant_whitespace(ctx):
> + """No whitespace between brackets or other code elements.
> + See also check_value_whitespace() for more checks."""
> + for dl in ctx.lines:
> + yield from _check_redundant_whitespace(dl)
> + for cont in dl.continuations:
> + yield from _check_redundant_whitespace(cont)
> +
> +
> +def check_redundant_whitespace_strict(ctx):
> + """No whitespace between brackets or other code elements.
> + See also check_value_whitespace() for more checks."""
> + for dl in ctx.lines:
> + if dl.linetype in (LineType.COMMENT, LineType.COMMENT_BODY,
> + LineType.COMMENT_END, LineType.COMMENT_START,
> + LineType.PREPROCESSOR):
> + continue
> + if re.search(r'(\s\s+|\t)=', dl.code):
> + yield (dl.lineno, 'extra whitespace before =')
> + if re.search(r'=(\s\s+|\t)', dl.code):
> + yield (dl.lineno, 'extra whitespace after =')
[Severity: Low]
This function fails to inspect continuation lines in
check_redundant_whitespace_strict().
Does the omission of a nested for cont in dl.continuations: block cause
the script to silently miss checking for redundant whitespace around '=' if
the '=' character happens to be placed on a multi-line continuation?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260826-n-dts-style-checker-continued-v5-0-fdd16ca6e771@oss.qualcomm.com?part=9
next prev parent reply other threads:[~2026-08-26 10:33 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-26 10:21 [PATCH v5 00/10] dtc: dt-check-style: Improvements for false positives Krzysztof Kozlowski
2026-08-26 10:21 ` [PATCH v5 01/10] dtc: dt-check-style: Handle sorting of top-level nodes and properties Krzysztof Kozlowski
2026-08-26 10:30 ` sashiko-bot
2026-08-26 10:39 ` Krzysztof Kozlowski
2026-08-26 10:21 ` [PATCH v5 02/10] dtc: dt-check-style: Drop stray backslash before quote for continuation-alignment Krzysztof Kozlowski
2026-08-26 10:21 ` [PATCH v5 03/10] dtc: dt-check-style: Fix alignment of values in continued property lines Krzysztof Kozlowski
2026-08-26 10:34 ` sashiko-bot
2026-08-26 11:10 ` Krzysztof Kozlowski
2026-08-26 10:21 ` [PATCH v5 04/10] dtc: dt-check-style: Consistently call 'kind' as 'file_type' Krzysztof Kozlowski
2026-08-26 10:21 ` [PATCH v5 05/10] dtc: dt-check-style: Introduce 'stricter' mode Krzysztof Kozlowski
2026-08-26 10:21 ` [PATCH v5 06/10] dtc: dt-check-style: Replace Test User email with Rob Herring Krzysztof Kozlowski
2026-08-26 10:21 ` [PATCH v5 07/10] dtc: dt-check-style: Call _strip_strings_and_comments() only once Krzysztof Kozlowski
2026-08-26 10:31 ` sashiko-bot
2026-08-26 10:45 ` Krzysztof Kozlowski
2026-08-26 10:21 ` [PATCH v5 08/10] dtc: dt-check-style: Add test for trailing white-space in DTS Krzysztof Kozlowski
2026-08-26 10:21 ` [PATCH v5 09/10] dtc: dt-check-style: Add warning for redundant white-spaces Krzysztof Kozlowski
2026-08-26 10:33 ` sashiko-bot [this message]
2026-08-26 11:12 ` Krzysztof Kozlowski
2026-08-26 10:21 ` [PATCH v5 10/10] MAINTAINERS: dt-bindings: Include dt-check-style in DT binding entry Krzysztof Kozlowski
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=20260826103319.BC26A1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=krzysztof.kozlowski@oss.qualcomm.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.