Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Krzysztof Kozlowski" <krzysztof.kozlowski@oss.qualcomm.com>
Cc: conor+dt@kernel.org, devicetree@vger.kernel.org, robh@kernel.org
Subject: Re: [PATCH v3 4/6] dtc: dt-check-style: Expect first device_type
Date: Mon, 06 Jul 2026 16:07:24 +0000	[thread overview]
Message-ID: <20260706160725.07FD11F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260706-dts-style-checker-v3-4-03ffacff9226@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Docstrings in `dt-check-style` were not fully updated to reflect the new `device_type` canonical order.
--

commit bb6e224694e154bb051ff9fc5122693c0b1a4366
Author: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>

dtc: dt-check-style: Expect first device_type

A few nodes do have "device_type" property which is mostly, but not always,
the first property in a device node, when applicable. Adjust the DTS
coding style rules to actually expect the device_type first and improve
the dt-check-style to handle this correctly.

> diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style
> index cf61e92d0568e..d9080297bd4db 100755
> --- a/scripts/dtc/dt-check-style
> +++ b/scripts/dtc/dt-check-style
> @@ -558,28 +558,31 @@ def check_child_name_order(ctx):
>  
>  def _property_bucket(name):
>      """Return the canonical bucket index for a property:
> -       0 compatible
> -       1 reg / reg-names
> -       2 ranges
> -       3 standard properties (no vendor comma in #-stripped name)
> -       4 vendor-specific properties
> -       5 status
> +       0 device_type
> +       1 compatible
> +       2 reg / reg-names
> +       3 ranges
> +       4 standard properties (no vendor comma in #-stripped name)
> +       5 vendor-specific properties
> +       6 status
>      Plus a sub-key inside the bucket for fixed slots (compatible, reg,
>      reg-names, ranges, status). 'standard' and 'vendor' return None for
>      the sub-key, signalling that the within-bucket key is computed by
>      the pairing rules."""

[Severity: Low]
This isn't a bug, but the explanatory text directly below the list wasn't
updated. Should "device_type" also be added to the enumerated list of
fixed slots in the "(compatible, reg, reg-names, ranges, status)" text?

Also, in check_property_order() further down the file, the docstring
describing the overall canonical property order still starts with
"compatible, reg(/reg-names)..." and misses "device_type". Should that
be updated as well?

>      stripped = name.lstrip('#')
> -    if name == 'compatible':
> +    if name == 'device_type':
>          return (0, 0)
> -    if name == 'reg':
> +    if name == 'compatible':
>          return (1, 0)
> +    if name == 'reg':
> +        return (2, 0)
>      if name == 'reg-names':
> -        return (1, 1)
> +        return (2, 1)
>      if name == 'ranges':
> -        return (2, 0)
> +        return (3, 0)
>      if name == 'status':
> -        return (5, 0)
> -    return (4 if ',' in stripped else 3, None)
> +        return (6, 0)
> +    return (5 if ',' in stripped else 4, None)
>  
>  
>  # Declarative pairing rules: each is a callable

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260706-dts-style-checker-v3-0-03ffacff9226@oss.qualcomm.com?part=4

  reply	other threads:[~2026-07-06 16:07 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-06 15:53 [PATCH v3 0/6] dtc: dt-check-style: Improvement after using on DTS Krzysztof Kozlowski
2026-07-06 15:53 ` [PATCH v3 1/6] dtc: dt-check-style: Narrow disallowing of tab in DTS only to YAML Krzysztof Kozlowski
2026-07-06 15:59   ` sashiko-bot
2026-07-06 16:00     ` Krzysztof Kozlowski
2026-07-06 15:53 ` [PATCH v3 2/6] dtc: dt-check-style: Allow space-aligning indentation in DTS Krzysztof Kozlowski
2026-07-06 15:53 ` [PATCH v3 3/6] dtc: dt-check-style: Rework handling YAML/DTS in rules Krzysztof Kozlowski
2026-07-06 15:53 ` [PATCH v3 4/6] dtc: dt-check-style: Expect first device_type Krzysztof Kozlowski
2026-07-06 16:07   ` sashiko-bot [this message]
2026-07-06 16:09     ` Krzysztof Kozlowski
2026-07-06 15:53 ` [PATCH v3 5/6] dtc: dt-check-style: Do not sort top-level nodes in DTS by unit address Krzysztof Kozlowski
2026-07-06 16:05   ` sashiko-bot
2026-07-06 15:53 ` [PATCH v3 6/6] dtc: dt-check-style: Handle properly DTC-style includes Krzysztof Kozlowski
2026-07-06 16:13   ` sashiko-bot
2026-07-06 16:20     ` 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=20260706160725.07FD11F000E9@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