* [PATCH 0/2] dt-check-style support for indented include fragments
@ 2026-08-30 18:24 Sven Peter
2026-08-30 18:24 ` [PATCH 1/2] dt-check-style: Handle indented fragments in indent-unit-dts Sven Peter
2026-08-30 18:24 ` [PATCH 2/2] dt-check-style: Handle indented fragments in indent-consistent Sven Peter
0 siblings, 2 replies; 8+ messages in thread
From: Sven Peter @ 2026-08-30 18:24 UTC (permalink / raw)
To: Rob Herring, Saravana Kannan
Cc: Daniel Golle, Krzysztof Kozlowski, linux-kernel, devicetree,
asahi, Sven Peter
Hi,
Some .dtsi files are included from inside a node and carry the
indentation of that context. This is e.g. used for the multi-die
Apple SoCs and dt-check-style currently interprets that as part
of the indent unit and reports spurious warnings for otherwise
correctly indented Apple and Broadcom fragments.
Teach indent-unit-dts to detect and validate the inherited prefix and
make indent-consistent account for it as well. Also add fixtures to
test this.
With this all arm64 device trees pass the relaxed checks.
Best,
Sven
Signed-off-by: Sven Peter <sven@kernel.org>
---
Sven Peter (2):
dt-check-style: Handle indented fragments in indent-unit-dts
dt-check-style: Handle indented fragments in indent-consistent
scripts/dtc/dt-check-style | 72 +++++++++++++++++-----
.../dt-style-selftest/bad/dts-fragment-indent.dtsi | 12 ++++
.../bad/dts-fragment-missing-prefix.dtsi | 6 ++
.../bad/dts-indented-ref-node.dtsi | 6 ++
.../expected/dts-fragment-indent.dtsi.txt | 3 +
.../expected/dts-fragment-missing-prefix.dtsi.txt | 2 +
.../expected/dts-indented-ref-node.dtsi.txt | 2 +
.../dtc/dt-style-selftest/good/dts-fragment.dtsi | 19 ++++++
8 files changed, 106 insertions(+), 16 deletions(-)
---
base-commit: a23cbb05744b22719efdc34f9e329a120e81e617
change-id: 20260830-b4-dts-check-fix-db992ba0a7dd
Best regards,
--
Sven Peter <sven@kernel.org>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 1/2] dt-check-style: Handle indented fragments in indent-unit-dts
2026-08-30 18:24 [PATCH 0/2] dt-check-style support for indented include fragments Sven Peter
@ 2026-08-30 18:24 ` Sven Peter
2026-09-01 8:21 ` Krzysztof Kozlowski
2026-08-30 18:24 ` [PATCH 2/2] dt-check-style: Handle indented fragments in indent-consistent Sven Peter
1 sibling, 1 reply; 8+ messages in thread
From: Sven Peter @ 2026-08-30 18:24 UTC (permalink / raw)
To: Rob Herring, Saravana Kannan
Cc: Daniel Golle, Krzysztof Kozlowski, linux-kernel, devicetree,
asahi, Sven Peter
The multi-die Apple SoCs contain most of their nodes in a file that is
included to instantiate the same nodes across both dies. These included
fragments all have a tabs-only prefix that is correct in the final
composed file. dt-check-style however finds the first line starting with
two (or more) tabs and then indent-unit-dts rejects those correctly
indented files.
Fix that by detecing a tabs-only prefix shared by rootless files and
treat that as a constant offset. Also add fixtures to test this.
Signed-off-by: Sven Peter <sven@kernel.org>
---
scripts/dtc/dt-check-style | 69 +++++++++++++++++-----
.../bad/dts-fragment-missing-prefix.dtsi | 6 ++
.../bad/dts-indented-ref-node.dtsi | 6 ++
.../expected/dts-fragment-missing-prefix.dtsi.txt | 2 +
.../expected/dts-indented-ref-node.dtsi.txt | 2 +
5 files changed, 70 insertions(+), 15 deletions(-)
diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style
index 96deffc0d8a7..2afc05fa6602 100755
--- a/scripts/dtc/dt-check-style
+++ b/scripts/dtc/dt-check-style
@@ -380,12 +380,43 @@ def check_mixed_indent_chars(ctx):
yield (cont.lineno, 'mixed tabs and spaces in indent')
+def detect_fragment_offset(ctx):
+ """Return the indentation inherited from an include context.
+
+ A fragment has neither a root nor top-level reference nodes and all
+ its top-level lines share the same tabs-only indentation.
+ """
+ if ctx.file_type != 'dts':
+ return ''
+ offset = None
+ for dl in ctx.lines:
+ if dl.depth != 0:
+ continue
+ if dl.linetype not in (LineType.NODE_OPEN, LineType.NODE_CLOSE,
+ LineType.PROPERTY):
+ continue
+ if dl.linetype == LineType.NODE_OPEN and \
+ (dl.node_name == '/' or dl.ref_name is not None):
+ return ''
+ if offset is None:
+ offset = dl.indent_str
+ elif dl.indent_str != offset:
+ return ''
+ if not offset:
+ return ''
+ if any(char != '\t' for char in offset):
+ return ''
+ return offset
+
+
def detect_indent_unit(ctx):
"""Find the indent unit used at depth 1 in this block.
Returns tuple of string (one of: ' ' (2 spaces), ' ' (4 spaces),
- '\\t' (tab), or None if depth-1 is empty or ambiguous) and line number when
- detection was made)."""
+ '\\t' (tab), or None if depth-1 is empty or ambiguous), line number when
+ detection was made, and whether the detected fragment prefix is valid.
+ """
+ prefix = detect_fragment_offset(ctx)
for dl in ctx.lines:
if dl.depth != 1:
continue
@@ -395,20 +426,25 @@ def detect_indent_unit(ctx):
continue
if not dl.indent_str:
continue
- if dl.indent_str == '\t':
- return ('\t', dl.lineno)
- if dl.indent_str == ' ':
- return (' ', dl.lineno)
- if dl.indent_str == ' ':
- return (' ', dl.lineno)
+ indent = dl.indent_str
+ if prefix and not indent.startswith(prefix):
+ return (indent, dl.lineno, False)
+ if prefix:
+ indent = indent[len(prefix):]
+ if indent == '\t':
+ return ('\t', dl.lineno, True)
+ if indent == ' ':
+ return (' ', dl.lineno, True)
+ if indent == ' ':
+ return (' ', dl.lineno, True)
# Anything else at depth 1 is non-canonical; flag elsewhere.
- return (dl.indent_str, dl.lineno)
- return (None, None)
+ return (indent, dl.lineno, True)
+ return (None, None, True)
def check_indent_unit_relaxed(ctx):
"""YAML examples: 2 or 4 spaces. Never tabs or other widths."""
- (unit, lineno) = detect_indent_unit(ctx)
+ (unit, lineno, _) = detect_indent_unit(ctx)
if unit is None:
return
if unit not in (' ', ' '):
@@ -417,7 +453,10 @@ def check_indent_unit_relaxed(ctx):
def check_indent_unit_dts(ctx):
"""DTS files: 1 tab per level. Always required."""
- (unit, lineno) = detect_indent_unit(ctx)
+ (unit, lineno, prefix_valid) = detect_indent_unit(ctx)
+ if not prefix_valid:
+ yield (lineno, 'indent does not start with fragment offset')
+ return
if unit is None:
return
if unit != '\t':
@@ -426,7 +465,7 @@ def check_indent_unit_dts(ctx):
def check_indent_unit_strict(ctx):
"""YAML: must be exactly 4 spaces. DTS: 1 tab (same as relaxed)."""
- (unit, lineno) = detect_indent_unit(ctx)
+ (unit, lineno, _) = detect_indent_unit(ctx)
if unit is None:
return
if ctx.file_type == 'yaml':
@@ -437,8 +476,8 @@ def check_indent_unit_strict(ctx):
def check_indent_consistent(ctx):
"""All indented lines must be a multiple of the detected unit."""
- (unit, lineno) = detect_indent_unit(ctx)
- if unit is None:
+ (unit, lineno, prefix_valid) = detect_indent_unit(ctx)
+ if unit is None or not prefix_valid:
return
if ctx.file_type == 'yaml':
if unit not in (' ', ' '):
diff --git a/scripts/dtc/dt-style-selftest/bad/dts-fragment-missing-prefix.dtsi b/scripts/dtc/dt-style-selftest/bad/dts-fragment-missing-prefix.dtsi
new file mode 100644
index 000000000000..a72735e0884b
--- /dev/null
+++ b/scripts/dtc/dt-style-selftest/bad/dts-fragment-missing-prefix.dtsi
@@ -0,0 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+/* Include fragment whose child does not contain the inherited indentation. */
+
+ bus@10000 {
+ compatible = "simple-bus";
+ };
diff --git a/scripts/dtc/dt-style-selftest/bad/dts-indented-ref-node.dtsi b/scripts/dtc/dt-style-selftest/bad/dts-indented-ref-node.dtsi
new file mode 100644
index 000000000000..cabe4ee96d10
--- /dev/null
+++ b/scripts/dtc/dt-style-selftest/bad/dts-indented-ref-node.dtsi
@@ -0,0 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+/* Reference nodes must remain at column zero. */
+
+ &example {
+ status = "okay";
+ };
diff --git a/scripts/dtc/dt-style-selftest/expected/dts-fragment-missing-prefix.dtsi.txt b/scripts/dtc/dt-style-selftest/expected/dts-fragment-missing-prefix.dtsi.txt
new file mode 100644
index 000000000000..eb525dddd904
--- /dev/null
+++ b/scripts/dtc/dt-style-selftest/expected/dts-fragment-missing-prefix.dtsi.txt
@@ -0,0 +1,2 @@
+# mode=relaxed
+bad/dts-fragment-missing-prefix.dtsi:5: [indent-unit-dts] indent does not start with fragment offset
diff --git a/scripts/dtc/dt-style-selftest/expected/dts-indented-ref-node.dtsi.txt b/scripts/dtc/dt-style-selftest/expected/dts-indented-ref-node.dtsi.txt
new file mode 100644
index 000000000000..ed86cc9b36c6
--- /dev/null
+++ b/scripts/dtc/dt-style-selftest/expected/dts-indented-ref-node.dtsi.txt
@@ -0,0 +1,2 @@
+# mode=strict
+bad/dts-indented-ref-node.dtsi:5: [indent-unit-dts] indent unit must be 1 tab in DTS, got '\t\t'
--
2.55.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 2/2] dt-check-style: Handle indented fragments in indent-consistent
2026-08-30 18:24 [PATCH 0/2] dt-check-style support for indented include fragments Sven Peter
2026-08-30 18:24 ` [PATCH 1/2] dt-check-style: Handle indented fragments in indent-unit-dts Sven Peter
@ 2026-08-30 18:24 ` Sven Peter
2026-09-01 8:22 ` Krzysztof Kozlowski
1 sibling, 1 reply; 8+ messages in thread
From: Sven Peter @ 2026-08-30 18:24 UTC (permalink / raw)
To: Rob Herring, Saravana Kannan
Cc: Daniel Golle, Krzysztof Kozlowski, linux-kernel, devicetree,
asahi, Sven Peter
indent-consistent compares every line against its nesting depth without
accounting for the constant indentation prefix used for include fragments.
It thus rejects otherwise valid fragments.
Fix that by adding the fragment prefix to the expected indentation and add
test fixtures.
Signed-off-by: Sven Peter <sven@kernel.org>
---
scripts/dtc/dt-check-style | 3 ++-
.../dt-style-selftest/bad/dts-fragment-indent.dtsi | 12 ++++++++++++
.../expected/dts-fragment-indent.dtsi.txt | 3 +++
scripts/dtc/dt-style-selftest/good/dts-fragment.dtsi | 19 +++++++++++++++++++
4 files changed, 36 insertions(+), 1 deletion(-)
diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style
index 2afc05fa6602..f867cb6d8070 100755
--- a/scripts/dtc/dt-check-style
+++ b/scripts/dtc/dt-check-style
@@ -486,6 +486,7 @@ def check_indent_consistent(ctx):
if unit != '\t':
return
+ prefix = detect_fragment_offset(ctx)
for dl in ctx.lines:
if dl.linetype in (LineType.BLANK, LineType.PREPROCESSOR):
continue
@@ -498,7 +499,7 @@ def check_indent_consistent(ctx):
# The indent must be 'unit' repeated dl.depth times, exactly.
# NODE_CLOSE lines have depth equal to the post-decrement value,
# which matches the indent expected.
- expected = unit * dl.depth
+ expected = prefix + unit * dl.depth
if dl.indent_str != expected:
yield (dl.lineno,
'indent mismatch (expected depth %d * %r)' %
diff --git a/scripts/dtc/dt-style-selftest/bad/dts-fragment-indent.dtsi b/scripts/dtc/dt-style-selftest/bad/dts-fragment-indent.dtsi
new file mode 100644
index 000000000000..6d143c4dd9b2
--- /dev/null
+++ b/scripts/dtc/dt-style-selftest/bad/dts-fragment-indent.dtsi
@@ -0,0 +1,12 @@
+// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+/* Incorrect indentation inside an indented include fragment. */
+
+ bus@10000 {
+ compatible = "simple-bus";
+ reg = <0x10000 0x1000>;
+
+ device@100 {
+ compatible = "example,test";
+ reg = <0x100 0x10>;
+ };
+ };
diff --git a/scripts/dtc/dt-style-selftest/expected/dts-fragment-indent.dtsi.txt b/scripts/dtc/dt-style-selftest/expected/dts-fragment-indent.dtsi.txt
new file mode 100644
index 000000000000..84ec8eb73468
--- /dev/null
+++ b/scripts/dtc/dt-style-selftest/expected/dts-fragment-indent.dtsi.txt
@@ -0,0 +1,3 @@
+# mode=strict
+bad/dts-fragment-indent.dtsi:9: [indent-consistent] indent mismatch (expected depth 2 * '\t')
+bad/dts-fragment-indent.dtsi:10: [indent-consistent] indent mismatch (expected depth 2 * '\t')
diff --git a/scripts/dtc/dt-style-selftest/good/dts-fragment.dtsi b/scripts/dtc/dt-style-selftest/good/dts-fragment.dtsi
new file mode 100644
index 000000000000..58735112d3aa
--- /dev/null
+++ b/scripts/dtc/dt-style-selftest/good/dts-fragment.dtsi
@@ -0,0 +1,19 @@
+// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+/* Include fragment indented for its inclusion context. */
+
+ bus@10000 {
+ compatible = "simple-bus";
+ reg = <0x10000 0x1000>;
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ device@100 {
+ compatible = "example,test";
+ reg = <0x100 0x10>;
+ };
+ };
+
+ bus@20000 {
+ compatible = "simple-bus";
+ reg = <0x20000 0x1000>;
+ };
--
2.55.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] dt-check-style: Handle indented fragments in indent-unit-dts
2026-08-30 18:24 ` [PATCH 1/2] dt-check-style: Handle indented fragments in indent-unit-dts Sven Peter
@ 2026-09-01 8:21 ` Krzysztof Kozlowski
0 siblings, 0 replies; 8+ messages in thread
From: Krzysztof Kozlowski @ 2026-09-01 8:21 UTC (permalink / raw)
To: Sven Peter
Cc: Rob Herring, Saravana Kannan, Daniel Golle, linux-kernel,
devicetree, asahi
On Sun, Aug 30, 2026 at 08:24:54PM +0200, Sven Peter wrote:
> The multi-die Apple SoCs contain most of their nodes in a file that is
> included to instantiate the same nodes across both dies. These included
> fragments all have a tabs-only prefix that is correct in the final
> composed file. dt-check-style however finds the first line starting with
> two (or more) tabs and then indent-unit-dts rejects those correctly
> indented files.
>
> Fix that by detecing a tabs-only prefix shared by rootless files and
> treat that as a constant offset. Also add fixtures to test this.
>
> Signed-off-by: Sven Peter <sven@kernel.org>
> ---
> scripts/dtc/dt-check-style | 69 +++++++++++++++++-----
> .../bad/dts-fragment-missing-prefix.dtsi | 6 ++
> .../bad/dts-indented-ref-node.dtsi | 6 ++
> .../expected/dts-fragment-missing-prefix.dtsi.txt | 2 +
> .../expected/dts-indented-ref-node.dtsi.txt | 2 +
> 5 files changed, 70 insertions(+), 15 deletions(-)
>
> diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style
> index 96deffc0d8a7..2afc05fa6602 100755
> --- a/scripts/dtc/dt-check-style
> +++ b/scripts/dtc/dt-check-style
> @@ -380,12 +380,43 @@ def check_mixed_indent_chars(ctx):
> yield (cont.lineno, 'mixed tabs and spaces in indent')
>
I did not expect simultaneous work, so I did some renaming and moving
which unfortunately will cause you conflicts.
My patches got merged and they add _ to detect_indent_unit(), so please
follow. Also other functions go to a bit different place after sorting.
>
> +def detect_fragment_offset(ctx):
> + """Return the indentation inherited from an include context.
> +
> + A fragment has neither a root nor top-level reference nodes and all
What is a DTS fragment?
> + its top-level lines share the same tabs-only indentation.
I don't think you are fixing right problem or at least not completely.
The Apple DTS is incorrect, because - I assume we talk about
t600x-dieX.dtsi - this should not be indented with a tab in the first
place. Apple does not get separate coding style, although I am working
on supression tags to avoid certain warnings.
> + """
> + if ctx.file_type != 'dts':
> + return ''
> + offset = None
> + for dl in ctx.lines:
> + if dl.depth != 0:
> + continue
> + if dl.linetype not in (LineType.NODE_OPEN, LineType.NODE_CLOSE,
> + LineType.PROPERTY):
> + continue
> + if dl.linetype == LineType.NODE_OPEN and \
> + (dl.node_name == '/' or dl.ref_name is not None):
> + return ''
> + if offset is None:
> + offset = dl.indent_str
> + elif dl.indent_str != offset:
> + return ''
> + if not offset:
> + return ''
> + if any(char != '\t' for char in offset):
> + return ''
> + return offset
> +
> +
> def detect_indent_unit(ctx):
> """Find the indent unit used at depth 1 in this block.
>
> Returns tuple of string (one of: ' ' (2 spaces), ' ' (4 spaces),
> - '\\t' (tab), or None if depth-1 is empty or ambiguous) and line number when
> - detection was made)."""
> + '\\t' (tab), or None if depth-1 is empty or ambiguous), line number when
> + detection was made, and whether the detected fragment prefix is valid.
> + """
> + prefix = detect_fragment_offset(ctx)
> for dl in ctx.lines:
> if dl.depth != 1:
> continue
> @@ -395,20 +426,25 @@ def detect_indent_unit(ctx):
> continue
> if not dl.indent_str:
> continue
> - if dl.indent_str == '\t':
> - return ('\t', dl.lineno)
> - if dl.indent_str == ' ':
> - return (' ', dl.lineno)
> - if dl.indent_str == ' ':
> - return (' ', dl.lineno)
> + indent = dl.indent_str
> + if prefix and not indent.startswith(prefix):
> + return (indent, dl.lineno, False)
> + if prefix:
> + indent = indent[len(prefix):]
> + if indent == '\t':
> + return ('\t', dl.lineno, True)
> + if indent == ' ':
> + return (' ', dl.lineno, True)
> + if indent == ' ':
> + return (' ', dl.lineno, True)
> # Anything else at depth 1 is non-canonical; flag elsewhere.
> - return (dl.indent_str, dl.lineno)
> - return (None, None)
> + return (indent, dl.lineno, True)
> + return (None, None, True)
>
>
> def check_indent_unit_relaxed(ctx):
> """YAML examples: 2 or 4 spaces. Never tabs or other widths."""
> - (unit, lineno) = detect_indent_unit(ctx)
> + (unit, lineno, _) = detect_indent_unit(ctx)
> if unit is None:
> return
> if unit not in (' ', ' '):
> @@ -417,7 +453,10 @@ def check_indent_unit_relaxed(ctx):
>
> def check_indent_unit_dts(ctx):
> """DTS files: 1 tab per level. Always required."""
> - (unit, lineno) = detect_indent_unit(ctx)
> + (unit, lineno, prefix_valid) = detect_indent_unit(ctx)
> + if not prefix_valid:
> + yield (lineno, 'indent does not start with fragment offset')
> + return
> if unit is None:
> return
> if unit != '\t':
> @@ -426,7 +465,7 @@ def check_indent_unit_dts(ctx):
>
> def check_indent_unit_strict(ctx):
> """YAML: must be exactly 4 spaces. DTS: 1 tab (same as relaxed)."""
> - (unit, lineno) = detect_indent_unit(ctx)
> + (unit, lineno, _) = detect_indent_unit(ctx)
> if unit is None:
> return
> if ctx.file_type == 'yaml':
> @@ -437,8 +476,8 @@ def check_indent_unit_strict(ctx):
>
> def check_indent_consistent(ctx):
> """All indented lines must be a multiple of the detected unit."""
> - (unit, lineno) = detect_indent_unit(ctx)
> - if unit is None:
> + (unit, lineno, prefix_valid) = detect_indent_unit(ctx)
> + if unit is None or not prefix_valid:
> return
> if ctx.file_type == 'yaml':
> if unit not in (' ', ' '):
> diff --git a/scripts/dtc/dt-style-selftest/bad/dts-fragment-missing-prefix.dtsi b/scripts/dtc/dt-style-selftest/bad/dts-fragment-missing-prefix.dtsi
> new file mode 100644
> index 000000000000..a72735e0884b
> --- /dev/null
> +++ b/scripts/dtc/dt-style-selftest/bad/dts-fragment-missing-prefix.dtsi
> @@ -0,0 +1,6 @@
> +// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> +/* Include fragment whose child does not contain the inherited indentation. */
> +
> + bus@10000 {
> + compatible = "simple-bus";
> + };
> diff --git a/scripts/dtc/dt-style-selftest/bad/dts-indented-ref-node.dtsi b/scripts/dtc/dt-style-selftest/bad/dts-indented-ref-node.dtsi
> new file mode 100644
> index 000000000000..cabe4ee96d10
> --- /dev/null
> +++ b/scripts/dtc/dt-style-selftest/bad/dts-indented-ref-node.dtsi
> @@ -0,0 +1,6 @@
> +// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> +/* Reference nodes must remain at column zero. */
> +
> + &example {
> + status = "okay";
> + };
A good example would be useful and probably made the discussion easier -
we would see that "good" example is actually not desired/correct style.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/2] dt-check-style: Handle indented fragments in indent-consistent
2026-08-30 18:24 ` [PATCH 2/2] dt-check-style: Handle indented fragments in indent-consistent Sven Peter
@ 2026-09-01 8:22 ` Krzysztof Kozlowski
2026-09-01 8:49 ` Sven Peter
0 siblings, 1 reply; 8+ messages in thread
From: Krzysztof Kozlowski @ 2026-09-01 8:22 UTC (permalink / raw)
To: Sven Peter
Cc: Rob Herring, Saravana Kannan, Daniel Golle, linux-kernel,
devicetree, asahi
On Sun, Aug 30, 2026 at 08:24:55PM +0200, Sven Peter wrote:
> diff --git a/scripts/dtc/dt-style-selftest/expected/dts-fragment-indent.dtsi.txt b/scripts/dtc/dt-style-selftest/expected/dts-fragment-indent.dtsi.txt
> new file mode 100644
> index 000000000000..84ec8eb73468
> --- /dev/null
> +++ b/scripts/dtc/dt-style-selftest/expected/dts-fragment-indent.dtsi.txt
> @@ -0,0 +1,3 @@
> +# mode=strict
> +bad/dts-fragment-indent.dtsi:9: [indent-consistent] indent mismatch (expected depth 2 * '\t')
> +bad/dts-fragment-indent.dtsi:10: [indent-consistent] indent mismatch (expected depth 2 * '\t')
> diff --git a/scripts/dtc/dt-style-selftest/good/dts-fragment.dtsi b/scripts/dtc/dt-style-selftest/good/dts-fragment.dtsi
> new file mode 100644
> index 000000000000..58735112d3aa
> --- /dev/null
> +++ b/scripts/dtc/dt-style-selftest/good/dts-fragment.dtsi
> @@ -0,0 +1,19 @@
> +// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> +/* Include fragment indented for its inclusion context. */
> +
> + bus@10000 {
So here is a good example... and this is code is wrong.
You CANNOT have MMIO node outside of MMIO bus or a new node outside of
root node indented with one tab.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/2] dt-check-style: Handle indented fragments in indent-consistent
2026-09-01 8:22 ` Krzysztof Kozlowski
@ 2026-09-01 8:49 ` Sven Peter
2026-09-01 9:40 ` Krzysztof Kozlowski
0 siblings, 1 reply; 8+ messages in thread
From: Sven Peter @ 2026-09-01 8:49 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Rob Herring, Saravana Kannan, Daniel Golle, linux-kernel,
devicetree, asahi
On 9/1/26 10:22, Krzysztof Kozlowski wrote:
> On Sun, Aug 30, 2026 at 08:24:55PM +0200, Sven Peter wrote:
>> diff --git a/scripts/dtc/dt-style-selftest/expected/dts-fragment-indent.dtsi.txt b/scripts/dtc/dt-style-selftest/expected/dts-fragment-indent.dtsi.txt
>> new file mode 100644
>> index 000000000000..84ec8eb73468
>> --- /dev/null
>> +++ b/scripts/dtc/dt-style-selftest/expected/dts-fragment-indent.dtsi.txt
>> @@ -0,0 +1,3 @@
>> +# mode=strict
>> +bad/dts-fragment-indent.dtsi:9: [indent-consistent] indent mismatch (expected depth 2 * '\t')
>> +bad/dts-fragment-indent.dtsi:10: [indent-consistent] indent mismatch (expected depth 2 * '\t')
>> diff --git a/scripts/dtc/dt-style-selftest/good/dts-fragment.dtsi b/scripts/dtc/dt-style-selftest/good/dts-fragment.dtsi
>> new file mode 100644
>> index 000000000000..58735112d3aa
>> --- /dev/null
>> +++ b/scripts/dtc/dt-style-selftest/good/dts-fragment.dtsi
>> @@ -0,0 +1,19 @@
>> +// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
>> +/* Include fragment indented for its inclusion context. */
>> +
>> + bus@10000 {
> So here is a good example... and this is code is wrong.
>
> You CANNOT have MMIO node outside of MMIO bus or a new node outside of
> root node indented with one tab.
Fair enough, just ignore this series then.
I'll just do the whitespace fix then and un-indent the -dieX files for
apple which I think should make them pass the checker then.
Sven
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/2] dt-check-style: Handle indented fragments in indent-consistent
2026-09-01 8:49 ` Sven Peter
@ 2026-09-01 9:40 ` Krzysztof Kozlowski
2026-09-01 9:53 ` Krzysztof Kozlowski
0 siblings, 1 reply; 8+ messages in thread
From: Krzysztof Kozlowski @ 2026-09-01 9:40 UTC (permalink / raw)
To: Sven Peter
Cc: Rob Herring, Saravana Kannan, Daniel Golle, linux-kernel,
devicetree, asahi
On 01/09/2026 10:49, Sven Peter wrote:
>
>
> On 9/1/26 10:22, Krzysztof Kozlowski wrote:
>> On Sun, Aug 30, 2026 at 08:24:55PM +0200, Sven Peter wrote:
>>> diff --git a/scripts/dtc/dt-style-selftest/expected/dts-fragment-indent.dtsi.txt b/scripts/dtc/dt-style-selftest/expected/dts-fragment-indent.dtsi.txt
>>> new file mode 100644
>>> index 000000000000..84ec8eb73468
>>> --- /dev/null
>>> +++ b/scripts/dtc/dt-style-selftest/expected/dts-fragment-indent.dtsi.txt
>>> @@ -0,0 +1,3 @@
>>> +# mode=strict
>>> +bad/dts-fragment-indent.dtsi:9: [indent-consistent] indent mismatch (expected depth 2 * '\t')
>>> +bad/dts-fragment-indent.dtsi:10: [indent-consistent] indent mismatch (expected depth 2 * '\t')
>>> diff --git a/scripts/dtc/dt-style-selftest/good/dts-fragment.dtsi b/scripts/dtc/dt-style-selftest/good/dts-fragment.dtsi
>>> new file mode 100644
>>> index 000000000000..58735112d3aa
>>> --- /dev/null
>>> +++ b/scripts/dtc/dt-style-selftest/good/dts-fragment.dtsi
>>> @@ -0,0 +1,19 @@
>>> +// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
>>> +/* Include fragment indented for its inclusion context. */
>>> +
>>> + bus@10000 {
>> So here is a good example... and this is code is wrong.
>>
>> You CANNOT have MMIO node outside of MMIO bus or a new node outside of
>> root node indented with one tab.
>
> Fair enough, just ignore this series then.
> I'll just do the whitespace fix then and un-indent the -dieX files for
> apple which I think should make them pass the checker then.
>
I see Apple DTS two soc nodes, so overriding/extending by phandle is a
bit trickier, but this should work in t600x-dieX.dtsi:
// earlier macro (or however you concatenate these)
#define DIE_NODE die0
&DIE_NODE {
// here goes stuff with original indentation
DIE_NODE(cpufreq_e): cpufreq@210e20000 {
...
};
};
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/2] dt-check-style: Handle indented fragments in indent-consistent
2026-09-01 9:40 ` Krzysztof Kozlowski
@ 2026-09-01 9:53 ` Krzysztof Kozlowski
0 siblings, 0 replies; 8+ messages in thread
From: Krzysztof Kozlowski @ 2026-09-01 9:53 UTC (permalink / raw)
To: Sven Peter
Cc: Rob Herring, Saravana Kannan, Daniel Golle, linux-kernel,
devicetree, asahi
On 01/09/2026 11:40, Krzysztof Kozlowski wrote:
>>> You CANNOT have MMIO node outside of MMIO bus or a new node outside of
>>> root node indented with one tab.
>>
>> Fair enough, just ignore this series then.
>> I'll just do the whitespace fix then and un-indent the -dieX files for
>> apple which I think should make them pass the checker then.
>>
>
> I see Apple DTS two soc nodes, so overriding/extending by phandle is a
> bit trickier, but this should work in t600x-dieX.dtsi:
>
> // earlier macro (or however you concatenate these)
> #define DIE_NODE die0
>
> &DIE_NODE {
Obviously this should be called differently not to conflict with
existing DIE_NODE(), but I hope you get the point.
> // here goes stuff with original indentation
> DIE_NODE(cpufreq_e): cpufreq@210e20000 {
> ...
> };
> };
>
> Best regards,
> Krzysztof
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2026-09-01 9:53 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-30 18:24 [PATCH 0/2] dt-check-style support for indented include fragments Sven Peter
2026-08-30 18:24 ` [PATCH 1/2] dt-check-style: Handle indented fragments in indent-unit-dts Sven Peter
2026-09-01 8:21 ` Krzysztof Kozlowski
2026-08-30 18:24 ` [PATCH 2/2] dt-check-style: Handle indented fragments in indent-consistent Sven Peter
2026-09-01 8:22 ` Krzysztof Kozlowski
2026-09-01 8:49 ` Sven Peter
2026-09-01 9:40 ` Krzysztof Kozlowski
2026-09-01 9:53 ` Krzysztof Kozlowski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox