[PATCH] dtc: dt-check-style: Allow space-aligning indentation in DTS

From: Krzysztof Kozlowski

Date: Mon Jul 06 2026 - 04:07:45 EST


DTS often have spaces after tabs in indentation for aligning continued
lines of comments or list properties, thus allow such cases to avoid
many false positives.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxxxxxxxx>
---
scripts/dtc/dt-check-style | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style
index 2d5723d41ea3..6d02d045f92d 100755
--- a/scripts/dtc/dt-check-style
+++ b/scripts/dtc/dt-check-style
@@ -365,8 +365,13 @@ def check_mixed_indent_chars(ctx):
continue
if dl.linetype == LineType.PREPROCESSOR:
continue
- if ' ' in dl.indent_str and '\t' in dl.indent_str:
- yield (dl.lineno, 'mixed tabs and spaces in indent')
+ if ctx.indent_kind == 'spaces':
+ if ' ' in dl.indent_str and '\t' in dl.indent_str:
+ yield (dl.lineno, 'mixed tabs and spaces in indent')
+ else:
+ # Spaces are used to align indentation in comments or continued lines
+ if dl.indent_str.count(' ') > 7:
+ yield (dl.lineno, 'too many space characters in indent (more than 7)')


def detect_indent_unit(ctx):
--
2.53.0