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

From: Krzysztof Kozlowski

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


Add missing code in check_tab_in_yaml_example() for example in the
bindings to apply the same rule of discouraged tab character also for
continued lines (iterating over all DtsLines is not enough).

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxxxxxxxx>
---
scripts/dtc/dt-check-style | 3 +++
scripts/dtc/dt-style-selftest/bad/yaml-mixed-indent.yaml | 2 ++
scripts/dtc/dt-style-selftest/expected/yaml-mixed-indent.yaml.txt | 1 +
3 files changed, 6 insertions(+)

diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style
index dc5a8ee23d68..0ebbe658b893 100755
--- a/scripts/dtc/dt-check-style
+++ b/scripts/dtc/dt-check-style
@@ -959,6 +959,9 @@ def check_tab_in_yaml_example(ctx):
continue
if '\t' in dl.raw:
yield (dl.lineno, 'tab character not allowed in DTS example')
+ for cont in dl.continuations:
+ if '\t' in cont.raw:
+ yield (cont.lineno, 'tab character not allowed in DTS example')


def check_trailing_whitespace(ctx):
diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-mixed-indent.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-mixed-indent.yaml
index c25a0d1a999e..4f76188b5e23 100644
--- a/scripts/dtc/dt-style-selftest/bad/yaml-mixed-indent.yaml
+++ b/scripts/dtc/dt-style-selftest/bad/yaml-mixed-indent.yaml
@@ -26,4 +26,6 @@ examples:
device@1000 {
compatible = "example,test-mixed";
reg = <0x1000 0x100>;
+ clocks = <1>,
+ <2>;
};
diff --git a/scripts/dtc/dt-style-selftest/expected/yaml-mixed-indent.yaml.txt b/scripts/dtc/dt-style-selftest/expected/yaml-mixed-indent.yaml.txt
index bc3fc3cf00cc..442f21f90e83 100644
--- a/scripts/dtc/dt-style-selftest/expected/yaml-mixed-indent.yaml.txt
+++ b/scripts/dtc/dt-style-selftest/expected/yaml-mixed-indent.yaml.txt
@@ -1,2 +1,3 @@
# mode=relaxed
bad/yaml-mixed-indent.yaml:27: example 0 [tab-in-yaml] tab character not allowed in DTS example
+bad/yaml-mixed-indent.yaml:30: example 0 [tab-in-yaml] tab character not allowed in DTS example

--
2.53.0