Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Krzysztof Kozlowski" <krzysztof.kozlowski@oss.qualcomm.com>
Cc: robh@kernel.org, devicetree@vger.kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v2 06/11] dtc: dt-check-style: Fix alignment of values in continued property lines
Date: Sun, 02 Aug 2026 08:56:17 +0000	[thread overview]
Message-ID: <20260802085617.BDD711F00AC4@smtp.kernel.org> (raw)
In-Reply-To: <20260802-n-dts-style-checker-continued-v2-6-6c5dbd1ccfe4@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Continuation alignment check incorrectly treats valid top-level elements like closing brackets (`>`) and array openers (`[` or `/bits/`) as inner values, causing false positives on properly aligned device tree code.
--

--- Patch [6]: [PATCH v2 06/11] dtc: dt-check-style: Fix alignment of values in continued property lines ---
commit de051474019f5f4a78cb7dedef4cd8e6a02500cf
Author: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>

dtc: dt-check-style: Fix alignment of values in continued property lines

This commit updates the device tree style checker to enforce different
alignments for property continuations depending on whether the continuation
starts a new phandle or continues an existing inner value.

> diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style
> index 04247e39a78e3..cb3cdfda5e739 100755
> --- a/scripts/dtc/dt-check-style
> +++ b/scripts/dtc/dt-check-style

[ ... ]

> @@ -942,15 +943,20 @@ def check_continuation_alignment(ctx):
>              continue
>          # First '<' or '"' after '='
>          rest = dl.raw[eq + 1:]
> -        m = re.search(r'[<"]', rest)
> +        m = re.search(r'\s*([<"])', rest)
>          if not m:
>              continue
> -        target_col = _display_col(dl.raw[:eq + 1 + m.start()])
> +        target_col = _display_col(dl.raw[:eq + 1 + m.start(1)])
>          for cont in dl.continuations:
> -            if _display_col(cont.indent_str) != target_col:
> +            target_offset = 0
> +            err_msg_explanation = 'to < or "'
> +            if not re.match(r'[<"]', cont.stripped):
> +                target_offset = 1
> +                err_msg_explanation = 'to the value under <'

[Severity: Medium]
If a multi-line property continuation begins with characters like >, [,
or / instead of < or ", this logic applies target_offset = 1.

This seems to force closing brackets and array openers to indent to the inner
value rather than aligning with the opening bracket, which could produce
false-positive linting errors on valid device tree formatting.

Does this regex incorrectly treat top-level structural characters as inner
values?

> diff --git a/scripts/dtc/dt-style-selftest/good/dts-cont-align.dts b/scripts/dtc/dt-style-selftest/good/dts-cont-align.dts
> index 36fb4eefcd83b..1a1c07c09a415 100644
> --- a/scripts/dtc/dt-style-selftest/good/dts-cont-align.dts
> +++ b/scripts/dtc/dt-style-selftest/good/dts-cont-align.dts

[ ... ]

> @@ -18,9 +18,12 @@ interrupt-controller@10000 {
>  		interrupts = <1 2 3>,
>  			     <4 5 6>,
>  			     <7 8 9>;
> -		pinmux = <
> -			 0x01
> -			 0x02
> -			 >;
> +		pinmux = <0x01
> +			  0x02>,
> +			 <0x03
> +			  0x04>;

[Severity: Medium]
Since > isn't matched by the [<"] pattern in check_continuation_alignment,
it seems the tool might now incorrectly flag properly aligned closing brackets
as a style violation if they are on a continuation line.

Was this previously passing test case removed because the new regex fails on
the standalone > character?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260802-n-dts-style-checker-continued-v2-0-6c5dbd1ccfe4@oss.qualcomm.com?part=6

  reply	other threads:[~2026-08-02  8:56 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-02  8:45 [PATCH v2 00/11] dtc: dt-check-style: Improvements for false positives Krzysztof Kozlowski
2026-08-02  8:45 ` [PATCH v2 01/11] dtc: dt-check-style: Add missing /dts-v1/ to few test cases Krzysztof Kozlowski
2026-08-02  8:45 ` [PATCH v2 02/11] dtc: dt-check-style: Simplify setting depth of DtsLine Krzysztof Kozlowski
2026-08-02  8:45 ` [PATCH v2 03/11] dtc: dt-check-style: Handle root node in overlays Krzysztof Kozlowski
2026-08-02  9:01   ` sashiko-bot
2026-08-02 12:13     ` Krzysztof Kozlowski
2026-08-02  8:45 ` [PATCH v2 04/11] dtc: dt-check-style: Handle sorting of top-level nodes and properties Krzysztof Kozlowski
2026-08-02  8:45 ` [PATCH v2 05/11] dtc: dt-check-style: Drop stray backslash before quote for continuation-alignment Krzysztof Kozlowski
2026-08-02  8:45 ` [PATCH v2 06/11] dtc: dt-check-style: Fix alignment of values in continued property lines Krzysztof Kozlowski
2026-08-02  8:56   ` sashiko-bot [this message]
2026-08-02 12:20     ` Krzysztof Kozlowski
2026-08-02  8:45 ` [PATCH v2 07/11] dtc: dt-check-style: Consistently call 'kind' as 'file_type' Krzysztof Kozlowski
2026-08-02  8:54   ` sashiko-bot
2026-08-02 12:22     ` Krzysztof Kozlowski
2026-08-02  8:45 ` [PATCH v2 08/11] dtc: dt-check-style: Introduce 'stricter' mode Krzysztof Kozlowski
2026-08-02  9:06   ` sashiko-bot
2026-08-02 10:50     ` Krzysztof Kozlowski
2026-08-02  8:45 ` [PATCH v2 09/11] dtc: dt-check-style: Add test for trailing white-space in DTS Krzysztof Kozlowski
2026-08-02  8:51   ` sashiko-bot
2026-08-02 12:23     ` Krzysztof Kozlowski
2026-08-02  8:45 ` [PATCH v2 10/11] dtc: dt-check-style: Add warning for redundant white-spaces Krzysztof Kozlowski
2026-08-02  8:54   ` sashiko-bot
2026-08-02  8:45 ` [PATCH v2 11/11] 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=20260802085617.BDD711F00AC4@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox