[PATCH 5/6] dtc: dt-check-style: Check for indentation also in continued lines of DTS

From: Krzysztof Kozlowski

Date: Sat Aug 29 2026 - 15:54:29 EST


Add missing code in check_mixed_indent_chars() for DTS to apply the same
rule of too many spaces for indentation also for continued lines
(iterating over all DtsLines is not enough).

Reported-by: sashiko-bot@xxxxxxxxxx
Closes: https://lore.kernel.org/all/20260709180118.6935B1F000E9@xxxxxxxxxxxxxxx/
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxxxxxxxx>
---
scripts/dtc/dt-check-style | 2 ++
scripts/dtc/dt-style-selftest/expected/dts-mixed-indent.dts.txt | 1 +
2 files changed, 3 insertions(+)

diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style
index 16586d0029ff..dc5a8ee23d68 100755
--- a/scripts/dtc/dt-check-style
+++ b/scripts/dtc/dt-check-style
@@ -652,6 +652,8 @@ def check_mixed_indent_chars(ctx):
continue
if re.search(r' \t', cont.indent_str):
yield (cont.lineno, 'mixed tabs and spaces in indent')
+ if cont.indent_str.count(' ') > 7:
+ yield (cont.lineno, 'too many space characters in indent (more than 7)')


def check_node_close_alone(ctx):
diff --git a/scripts/dtc/dt-style-selftest/expected/dts-mixed-indent.dts.txt b/scripts/dtc/dt-style-selftest/expected/dts-mixed-indent.dts.txt
index 93146cfb51c7..1706390f5664 100644
--- a/scripts/dtc/dt-style-selftest/expected/dts-mixed-indent.dts.txt
+++ b/scripts/dtc/dt-style-selftest/expected/dts-mixed-indent.dts.txt
@@ -6,4 +6,5 @@ bad/dts-mixed-indent.dts:12: [mixed-indent-chars] mixed tabs and spaces in inden
bad/dts-mixed-indent.dts:13: [indent-consistent] indent mismatch (expected depth 2 * '\t')
bad/dts-mixed-indent.dts:13: [mixed-indent-chars] mixed tabs and spaces in indent
bad/dts-mixed-indent.dts:16: [mixed-indent-chars] mixed tabs and spaces in indent
+bad/dts-mixed-indent.dts:18: [mixed-indent-chars] too many space characters in indent (more than 7)
bad/dts-mixed-indent.dts:19: [indent-consistent] indent mismatch (expected depth 2 * '\t')

--
2.53.0