Devicetree
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
To: sashiko-reviews@lists.linux.dev
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v3 03/11] dtc: dt-check-style: Handle root node in overlays
Date: Tue, 25 Aug 2026 20:52:26 +0200	[thread overview]
Message-ID: <f2705937-0966-4161-96df-88541762f147@oss.qualcomm.com> (raw)
In-Reply-To: <20260803091808.99C0C1F000E9@smtp.kernel.org>

On 03/08/2026 11:18, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [Medium] The patch fails to address the issue claimed in the commit message, introduces dead logic for overlay root nodes, and causes a regression for standard unspaced root nodes.
> --
> 
> --- Patch [3]: [PATCH v3 03/11] dtc: dt-check-style: Handle root node in overlays ---
> commit 099936d5537a0ed41e9b6886979ab1b9de2421d1
> Author: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
> 
> dtc: dt-check-style: Handle root node in overlays
> 
> This patch aims to handle root nodes in overlays correctly by detecting
> them and storing an is_root attribute in DtsLine, intending to fix false
> positives for property order.
> 
>> This fixes false positives for property order for root nodes in overlays.
> 
> [Severity: Medium]
> Does this patch actually update check_property_order()? 
> 
> The diff modifies check_child_name_order() instead, leaving the
> check_property_order() function completely unchanged.

False positive

> 
>> diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style
>> index 96deffc0d8a7c..d9f76d6d9179e 100755
>> --- a/scripts/dtc/dt-check-style
>> +++ b/scripts/dtc/dt-check-style
> [ ... ]
>> @@ -228,7 +229,10 @@ def classify_lines(text):
>>              continue
>>  
>>          if code.endswith('{'):
>> -            dl = DtsLine(i, raw, LineType.NODE_OPEN, depth, indent_str, code)
>> +            is_root = False
>> +            if code == '&{/} {' or re.search(r'^/\s+\{$', code):
>> +                is_root = True
>> +            dl = DtsLine(i, raw, LineType.NODE_OPEN, depth, indent_str, code, is_root=is_root)
> 
> [Severity: Medium]
> Will this regex handle standard unspaced root nodes like "/{"?

Ack

> 
> The regex pattern ^/\s+\{$ strictly requires whitespace. Valid unspaced
> root nodes or labelled root nodes might bypass this logic and incorrectly
> evaluate to is_root = False.
> 
> [ ... ]
>> @@ -550,7 +554,9 @@ def check_child_name_order(ctx):
>>          for c in children:
>>              if c.node_addr is not None:
>>                  continue
>> -            if c.node_name in (None, '/'):
>> +            if c.node_name is None:
>> +                continue
>> +            if c.is_root:
>>                  continue
> 
> [Severity: Medium]
> Is the c.is_root check reachable for overlay root nodes?

Seems this change is not needed.

Best regards,
Krzysztof

  reply	other threads:[~2026-08-25 18:52 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-03  9:03 [PATCH v3 00/11] dtc: dt-check-style: Improvements for false positives Krzysztof Kozlowski
2026-08-03  9:03 ` [PATCH v3 01/11] dtc: dt-check-style: Add missing /dts-v1/ to few test cases Krzysztof Kozlowski
2026-08-03 22:30   ` Rob Herring (Arm)
2026-08-03  9:03 ` [PATCH v3 02/11] dtc: dt-check-style: Simplify setting depth of DtsLine Krzysztof Kozlowski
2026-08-03 22:31   ` Rob Herring (Arm)
2026-08-03  9:03 ` [PATCH v3 03/11] dtc: dt-check-style: Handle root node in overlays Krzysztof Kozlowski
2026-08-03  9:18   ` sashiko-bot
2026-08-25 18:52     ` Krzysztof Kozlowski [this message]
2026-08-03  9:03 ` [PATCH v3 04/11] dtc: dt-check-style: Handle sorting of top-level nodes and properties Krzysztof Kozlowski
2026-08-03  9:20   ` sashiko-bot
2026-08-05  7:07     ` Krzysztof Kozlowski
2026-08-03  9:03 ` [PATCH v3 05/11] dtc: dt-check-style: Drop stray backslash before quote for continuation-alignment Krzysztof Kozlowski
2026-08-03  9:09   ` sashiko-bot
2026-08-05  7:09     ` Krzysztof Kozlowski
2026-08-03  9:03 ` [PATCH v3 06/11] dtc: dt-check-style: Fix alignment of values in continued property lines Krzysztof Kozlowski
2026-08-03  9:21   ` sashiko-bot
2026-08-05  7:12     ` Krzysztof Kozlowski
2026-08-03  9:03 ` [PATCH v3 07/11] dtc: dt-check-style: Consistently call 'kind' as 'file_type' Krzysztof Kozlowski
2026-08-03  9:03 ` [PATCH v3 08/11] dtc: dt-check-style: Introduce 'stricter' mode Krzysztof Kozlowski
2026-08-03  9:16   ` sashiko-bot
2026-08-05  7:06     ` Krzysztof Kozlowski
2026-08-26  6:17     ` Krzysztof Kozlowski
2026-08-03  9:03 ` [PATCH v3 09/11] dtc: dt-check-style: Add test for trailing white-space in DTS Krzysztof Kozlowski
2026-08-03  9:11   ` sashiko-bot
2026-08-05  7:03     ` Krzysztof Kozlowski
2026-08-03  9:03 ` [PATCH v3 10/11] dtc: dt-check-style: Add warning for redundant white-spaces Krzysztof Kozlowski
2026-08-03  9:13   ` sashiko-bot
2026-08-05  7:12     ` Krzysztof Kozlowski
2026-08-03  9:03 ` [PATCH v3 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=f2705937-0966-4161-96df-88541762f147@oss.qualcomm.com \
    --to=krzysztof.kozlowski@oss.qualcomm.com \
    --cc=conor+dt@kernel.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