Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Krzysztof Kozlowski" <krzysztof.kozlowski@oss.qualcomm.com>
Cc: conor+dt@kernel.org, robh@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v4 03/10] dtc: dt-check-style: Fix alignment of values in continued property lines
Date: Wed, 26 Aug 2026 07:13:45 +0000	[thread overview]
Message-ID: <20260826071345.A3C2E1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260826-n-dts-style-checker-continued-v4-3-022e60091965@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Trailing whitespace or comments break multi-line property alignment validation.
--

commit aff0e119d6465ed21424e22c5bbba8149c80bcf4
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 properly enforce
alignment rules for continued property lines. It adds logic to ensure inner
values inside phandles or strings are aligned correctly based on the
previous line's completion status.

> diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style
> index 833f8a03ddc9b..486dd1d6bb9a7 100755
> --- a/scripts/dtc/dt-check-style
> +++ b/scripts/dtc/dt-check-style
[ ... ]
> @@ -940,15 +941,23 @@ 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()])
> +        dl_value_complete = rest.endswith('",') or rest.endswith('>,')

[Severity: Low]
Does this evaluation properly handle trailing inline comments or whitespace?

If the rest string retains trailing characters like inline comments 
(e.g. >, /* foo */) or unexpected whitespace, endswith() will return false 
even if the value is complete. This could cause the script to incorrectly 
conclude the property is incomplete and mandate an incorrect indentation 
for the continuation line.

> +        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 dl_value_complete:
> +                target_offset = 1
> +                err_msg_explanation = 'to the value under <'
> +            if _display_col(cont.indent_str) != target_col + target_offset:
>                  yield (cont.lineno,
>                         'continuation should align to column %d '
> -                       '(under < or ")' % (target_col + 1))
> +                       '(%s)' % (target_col + target_offset + 1, err_msg_explanation))
> +            # Align to the value within <> or "" of continuation (so the previous line)
> +            dl_value_complete = cont.stripped.endswith('",') or cont.stripped.endswith('>,')

[Severity: Low]
Can this cause false positives for chained continuation lines?

Similarly to the rest variable above, if cont.stripped retains trailing
comments, endswith() will evaluate to false. Could this result in the same
false-positive warnings when checking the next continuation line?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260826-n-dts-style-checker-continued-v4-0-022e60091965@oss.qualcomm.com?part=3

  reply	other threads:[~2026-08-26  7:13 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-26  7:05 [PATCH v4 00/10] dtc: dt-check-style: Improvements for false positives Krzysztof Kozlowski
2026-08-26  7:05 ` [PATCH v4 01/10] dtc: dt-check-style: Handle sorting of top-level nodes and properties Krzysztof Kozlowski
2026-08-26  7:05 ` [PATCH v4 02/10] dtc: dt-check-style: Drop stray backslash before quote for continuation-alignment Krzysztof Kozlowski
2026-08-26  7:05 ` [PATCH v4 03/10] dtc: dt-check-style: Fix alignment of values in continued property lines Krzysztof Kozlowski
2026-08-26  7:13   ` sashiko-bot [this message]
2026-08-26 10:00     ` Krzysztof Kozlowski
2026-08-26  7:05 ` [PATCH v4 04/10] dtc: dt-check-style: Consistently call 'kind' as 'file_type' Krzysztof Kozlowski
2026-08-26  7:05 ` [PATCH v4 05/10] dtc: dt-check-style: Introduce 'stricter' mode Krzysztof Kozlowski
2026-08-26  7:05 ` [PATCH v4 06/10] dtc: dt-check-style: Replace Test User email with Rob Herring Krzysztof Kozlowski
2026-08-26  7:06 ` [PATCH v4 07/10] dtc: dt-check-style: Call _strip_strings_and_comments() only once Krzysztof Kozlowski
2026-08-26  7:06 ` [PATCH v4 08/10] dtc: dt-check-style: Add test for trailing white-space in DTS Krzysztof Kozlowski
2026-08-26  7:06 ` [PATCH v4 09/10] dtc: dt-check-style: Add warning for redundant white-spaces Krzysztof Kozlowski
2026-08-26  7:18   ` sashiko-bot
2026-08-26  8:56     ` Krzysztof Kozlowski
2026-08-26  7:06 ` [PATCH v4 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=20260826071345.A3C2E1F000E9@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