From: sashiko-bot@kernel.org
To: "Krzysztof Kozlowski" <krzysztof.kozlowski@oss.qualcomm.com>
Cc: devicetree@vger.kernel.org, conor+dt@kernel.org, robh@kernel.org
Subject: Re: [PATCH v4 2/7] dtc: dt-check-style: Allow space-aligning indentation in DTS
Date: Wed, 08 Jul 2026 14:50:04 +0000 [thread overview]
Message-ID: <20260708145005.5B69A1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260708-dts-style-checker-v4-2-c175e6401150@oss.qualcomm.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The `check_mixed_indent_chars` rule silently bypasses property continuation lines, rendering its newly added space-limit validation ineffective for list properties and undermining the patch's stated goal.
--
--- Patch [2]: [PATCH v4 2/7] dtc: dt-check-style: Allow space-aligning indentation in DTS ---
commit 7913e7da3c58b0a74f8737f725c2117139d9183f
Author: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
dtc: dt-check-style: Allow space-aligning indentation in DTS
This commit relaxes the mixed indent check in dt-check-style to allow
space-aligning indentation in DTS files for comments or continued lines.
It replaces the strict mixed-indent rule with checks for space-followed-by-tab
and excessive space counts (more than 7).
v2: https://lore.kernel.org/r/20260706102421.343639-4-krzysztof.kozlowski@oss.qualcomm.com/
v1: https://lore.kernel.org/r/20260706071446.87669-2-krzysztof.kozlowski@oss.qualcomm.com/
> diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style
> index 29b25ecf15c66..5d7765f35ecbc 100755
> --- a/scripts/dtc/dt-check-style
> +++ b/scripts/dtc/dt-check-style
> @@ -359,14 +359,17 @@ def check_tab_in_yaml_example(ctx):
>
>
> def check_mixed_indent_chars(ctx):
> - """Indent must be all-spaces or all-tabs, never mixed on one line."""
> + """Indent must be all-tabs, except for aligning indentation (comments
> + or continued lines)."""
> for dl in ctx.lines:
[Severity: Medium]
Does this loop miss checking property continuation lines?
By iterating only over ctx.lines, it appears to skip evaluating
dl.continuations where property continuations are stored. This prevents the
newly added space-limit validation from executing for list properties, which
the rule explicitly claims to check in the docstring.
> if not dl.indent_str:
> continue
> if dl.linetype == LineType.PREPROCESSOR:
> continue
> - if ' ' in dl.indent_str and '\t' in dl.indent_str:
> + if re.search(r' \t', dl.indent_str):
> yield (dl.lineno, 'mixed tabs and spaces in indent')
> + if dl.indent_str.count(' ') > 7:
> + yield (dl.lineno, 'too many space characters in indent (more than 7)')
[ ... ]
> diff --git a/scripts/dtc/dt-style-selftest/bad/dts-mixed-indent.dts b/scripts/dtc/dt-style-selftest/bad/dts-mixed-indent.dts
> new file mode 100644
> index 0000000000000..f0e40cfc910c7
> --- /dev/null
> +++ b/scripts/dtc/dt-style-selftest/bad/dts-mixed-indent.dts
> @@ -0,0 +1,20 @@
[ ... ]
> + clocks = <1>,
> + <2>,
> + <3>;
[Severity: Medium]
As a consequence of skipping continuations above, does this line evade the
"more than 7 spaces" check?
This line contains 9 spaces of indentation before the `<3>;`, but because it
is a property continuation, the tool does not yield the expected warning.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260708-dts-style-checker-v4-0-c175e6401150@oss.qualcomm.com?part=2
next prev parent reply other threads:[~2026-07-08 14:50 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-08 14:40 [PATCH v4 0/7] dtc: dt-check-style: Improvement after using on DTS Krzysztof Kozlowski
2026-07-08 14:40 ` [PATCH v4 1/7] dtc: dt-check-style: Narrow disallowing of tab in DTS only to YAML Krzysztof Kozlowski
2026-07-08 14:40 ` [PATCH v4 2/7] dtc: dt-check-style: Allow space-aligning indentation in DTS Krzysztof Kozlowski
2026-07-08 14:50 ` sashiko-bot [this message]
2026-07-08 14:40 ` [PATCH v4 3/7] dtc: dt-check-style: Rework handling YAML/DTS in rules Krzysztof Kozlowski
2026-07-08 14:40 ` [PATCH v4 4/7] dtc: dt-check-style: Expect first device_type Krzysztof Kozlowski
2026-07-08 14:52 ` sashiko-bot
2026-07-08 14:40 ` [PATCH v4 5/7] dtc: dt-check-style: Handle properly DTC-style includes Krzysztof Kozlowski
2026-07-08 14:40 ` [PATCH v4 6/7] dtc: dt-check-style: Print proper line number of indentation detection place Krzysztof Kozlowski
2026-07-08 14:54 ` sashiko-bot
2026-07-08 14:40 ` [PATCH v4 7/7] dtc: dt-check-style: Add more DTS test cases Krzysztof Kozlowski
2026-07-08 14:58 ` sashiko-bot
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=20260708145005.5B69A1F000E9@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