* [PATCH v3 1/7] dtc: dt-check-style: Handle continued lines in check_hex_case()
2026-09-09 13:10 [PATCH v3 0/7] dtc: dt-check-style: Improvements for handling continued lines Krzysztof Kozlowski
@ 2026-09-09 13:10 ` Krzysztof Kozlowski
2026-09-09 13:10 ` [PATCH v3 2/7] dtc: dt-check-style: Handle continued lines in check_line_length() Krzysztof Kozlowski
` (6 subsequent siblings)
7 siblings, 0 replies; 10+ messages in thread
From: Krzysztof Kozlowski @ 2026-09-09 13:10 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Saravana Kannan
Cc: devicetree, linux-kernel, Krzysztof Kozlowski
Continued lines are not separate DtsLine items in ctx.lines, so they
need own iteration. Rule for hex case is applicable to continued values
as well.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
---
scripts/dtc/dt-check-style | 24 ++++++++++++++--------
.../dtc/dt-style-selftest/bad/yaml-hex-case.yaml | 5 ++++-
.../expected/yaml-hex-case.yaml.txt | 2 ++
3 files changed, 21 insertions(+), 10 deletions(-)
diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style
index 15a3ba82fd5f..6d978c4d9832 100755
--- a/scripts/dtc/dt-check-style
+++ b/scripts/dtc/dt-check-style
@@ -547,18 +547,24 @@ def check_continuation_alignment(ctx):
dl_value_complete = cont.stripped.endswith('",') or cont.stripped.endswith('>,')
+def _check_hex_case(dl):
+ if dl.linetype in (LineType.BLANK, LineType.COMMENT,
+ LineType.COMMENT_START, LineType.COMMENT_BODY,
+ LineType.COMMENT_END, LineType.PREPROCESSOR):
+ return
+ for m in re.finditer(r'\b0[xX][0-9a-fA-F]+\b', dl.code):
+ lit = m.group(0)
+ if any(c.isupper() for c in lit[2:]) or lit[1] == 'X':
+ yield (dl.lineno,
+ 'hex literal %r must be lowercase' % lit)
+
+
def check_hex_case(ctx):
"""Hex literals (0xN) must use lowercase digits and prefix."""
for dl in ctx.lines:
- if dl.linetype in (LineType.BLANK, LineType.COMMENT,
- LineType.COMMENT_START, LineType.COMMENT_BODY,
- LineType.COMMENT_END, LineType.PREPROCESSOR):
- continue
- for m in re.finditer(r'\b0[xX][0-9a-fA-F]+\b', dl.code):
- lit = m.group(0)
- if any(c.isupper() for c in lit[2:]) or lit[1] == 'X':
- yield (dl.lineno,
- 'hex literal %r must be lowercase' % lit)
+ yield from _check_hex_case(dl)
+ for cont in dl.continuations:
+ yield from _check_hex_case(cont)
def check_indent_consistent(ctx):
diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-hex-case.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-hex-case.yaml
index c55359a4ca68..b0b8683b883a 100644
--- a/scripts/dtc/dt-style-selftest/bad/yaml-hex-case.yaml
+++ b/scripts/dtc/dt-style-selftest/bad/yaml-hex-case.yaml
@@ -25,5 +25,8 @@ examples:
- |
foo@1000 {
compatible = "example,test-hex-case";
- reg = <0xABCD 0x100>;
+ reg = <0xABCD 0x100>,
+ <0x2BCD 0x100>,
+ <0x3BCD
+ 0x100>;
};
diff --git a/scripts/dtc/dt-style-selftest/expected/yaml-hex-case.yaml.txt b/scripts/dtc/dt-style-selftest/expected/yaml-hex-case.yaml.txt
index 6600f7cd1ba5..f42490256939 100644
--- a/scripts/dtc/dt-style-selftest/expected/yaml-hex-case.yaml.txt
+++ b/scripts/dtc/dt-style-selftest/expected/yaml-hex-case.yaml.txt
@@ -1,2 +1,4 @@
# mode=strict
bad/yaml-hex-case.yaml:28: example 0 [hex-case] hex literal '0xABCD' must be lowercase
+bad/yaml-hex-case.yaml:29: example 0 [hex-case] hex literal '0x2BCD' must be lowercase
+bad/yaml-hex-case.yaml:30: example 0 [hex-case] hex literal '0x3BCD' must be lowercase
--
2.53.0
^ permalink raw reply [flat|nested] 10+ messages in thread* [PATCH v3 2/7] dtc: dt-check-style: Handle continued lines in check_line_length()
2026-09-09 13:10 [PATCH v3 0/7] dtc: dt-check-style: Improvements for handling continued lines Krzysztof Kozlowski
2026-09-09 13:10 ` [PATCH v3 1/7] dtc: dt-check-style: Handle continued lines in check_hex_case() Krzysztof Kozlowski
@ 2026-09-09 13:10 ` Krzysztof Kozlowski
2026-09-09 13:10 ` [PATCH v3 3/7] dtc: dt-check-style: Handle continued lines in check_trailing_whitespace() Krzysztof Kozlowski
` (5 subsequent siblings)
7 siblings, 0 replies; 10+ messages in thread
From: Krzysztof Kozlowski @ 2026-09-09 13:10 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Saravana Kannan
Cc: devicetree, linux-kernel, Krzysztof Kozlowski
Continued lines are not separate DtsLine items in ctx.lines, so they
need own iteration. Rule for length of line is applicable to continued
values as well.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
---
scripts/dtc/dt-check-style | 18 ++++++++++++------
scripts/dtc/dt-style-selftest/bad/dts-line-length.dts | 3 ++-
.../dtc/dt-style-selftest/bad/yaml-line-length.yaml | 3 ++-
.../dt-style-selftest/expected/dts-line-length.dts.txt | 1 +
.../expected/yaml-line-length.yaml.txt | 1 +
5 files changed, 18 insertions(+), 8 deletions(-)
diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style
index 6d978c4d9832..ff5e715593df 100755
--- a/scripts/dtc/dt-check-style
+++ b/scripts/dtc/dt-check-style
@@ -627,16 +627,22 @@ def check_indent_unit_strict(ctx):
'got %r' % unit)
+def _check_line_length(dl):
+ if dl.linetype == LineType.BLANK:
+ return
+ cols = _display_col(dl.raw)
+ if cols > 80:
+ yield (dl.lineno,
+ 'line exceeds 80 columns (%d)' % cols)
+
+
def check_line_length(ctx):
"""Lines must not exceed 80 columns; tabs count as 8 (see
_display_col)."""
for dl in ctx.lines:
- if dl.linetype == LineType.BLANK:
- continue
- cols = _display_col(dl.raw)
- if cols > 80:
- yield (dl.lineno,
- 'line exceeds 80 columns (%d)' % cols)
+ yield from _check_line_length(dl)
+ for cont in dl.continuations:
+ yield from _check_line_length(cont)
def check_mixed_indent_chars(ctx):
diff --git a/scripts/dtc/dt-style-selftest/bad/dts-line-length.dts b/scripts/dtc/dt-style-selftest/bad/dts-line-length.dts
index bde91a922477..adf40e3c95f7 100644
--- a/scripts/dtc/dt-style-selftest/bad/dts-line-length.dts
+++ b/scripts/dtc/dt-style-selftest/bad/dts-line-length.dts
@@ -14,7 +14,8 @@ soc@0 {
#size-cells = <1>;
foo@1000 {
- compatible = "example,test-line-length-this-is-a-very-long-name-indeed-yeah";
+ compatible = "example,test-line-length-this-is-a-very-long-name-indeed-yeah",
+ "example,test-line-length-this-is-a-very-long-name-indeed-yeah-second";
reg = <0x1000 0x100>;
};
};
diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-line-length.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-line-length.yaml
index 6e4140e500b5..6b1209ee4f26 100644
--- a/scripts/dtc/dt-style-selftest/bad/yaml-line-length.yaml
+++ b/scripts/dtc/dt-style-selftest/bad/yaml-line-length.yaml
@@ -24,6 +24,7 @@ additionalProperties: false
examples:
- |
foo@1000 {
- compatible = "example,test-line-length-this-is-a-very-long-name-indeed-yeah";
+ compatible = "example,test-line-length-this-is-a-very-long-name-indeed-yeah",
+ "example,test-line-length-this-is-a-very-long-name-indeed-yeah-second";
reg = <0x1000 0x100>;
};
diff --git a/scripts/dtc/dt-style-selftest/expected/dts-line-length.dts.txt b/scripts/dtc/dt-style-selftest/expected/dts-line-length.dts.txt
index 8ed08c309632..9cdb7550b56c 100644
--- a/scripts/dtc/dt-style-selftest/expected/dts-line-length.dts.txt
+++ b/scripts/dtc/dt-style-selftest/expected/dts-line-length.dts.txt
@@ -1,2 +1,3 @@
# mode=stricter
bad/dts-line-length.dts:17: [line-length-dts] line exceeds 80 columns (101)
+bad/dts-line-length.dts:18: [line-length-dts] line exceeds 80 columns (108)
diff --git a/scripts/dtc/dt-style-selftest/expected/yaml-line-length.yaml.txt b/scripts/dtc/dt-style-selftest/expected/yaml-line-length.yaml.txt
index 89b36360caa4..f21b823c6136 100644
--- a/scripts/dtc/dt-style-selftest/expected/yaml-line-length.yaml.txt
+++ b/scripts/dtc/dt-style-selftest/expected/yaml-line-length.yaml.txt
@@ -1,2 +1,3 @@
# mode=strict
bad/yaml-line-length.yaml:27: example 0 [line-length] line exceeds 80 columns (81)
+bad/yaml-line-length.yaml:28: example 0 [line-length] line exceeds 80 columns (88)
--
2.53.0
^ permalink raw reply [flat|nested] 10+ messages in thread* [PATCH v3 3/7] dtc: dt-check-style: Handle continued lines in check_trailing_whitespace()
2026-09-09 13:10 [PATCH v3 0/7] dtc: dt-check-style: Improvements for handling continued lines Krzysztof Kozlowski
2026-09-09 13:10 ` [PATCH v3 1/7] dtc: dt-check-style: Handle continued lines in check_hex_case() Krzysztof Kozlowski
2026-09-09 13:10 ` [PATCH v3 2/7] dtc: dt-check-style: Handle continued lines in check_line_length() Krzysztof Kozlowski
@ 2026-09-09 13:10 ` Krzysztof Kozlowski
2026-09-09 13:10 ` [PATCH v3 4/7] dtc: dt-check-style: Unduplicate checks in check_mixed_indent_chars() Krzysztof Kozlowski
` (4 subsequent siblings)
7 siblings, 0 replies; 10+ messages in thread
From: Krzysztof Kozlowski @ 2026-09-09 13:10 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Saravana Kannan
Cc: devicetree, linux-kernel, Krzysztof Kozlowski
Continued lines are not separate DtsLine items in ctx.lines, so they
need own iteration. Rule for trailing white-space is applicable to
continued values as well.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
---
scripts/dtc/dt-check-style | 10 ++++++++--
scripts/dtc/dt-style-selftest/bad/dts-trailing-ws.dts | 8 ++++++++
scripts/dtc/dt-style-selftest/bad/yaml-trailing-ws.yaml | 5 ++++-
scripts/dtc/dt-style-selftest/expected/dts-trailing-ws.dts.txt | 1 +
.../dtc/dt-style-selftest/expected/yaml-trailing-ws.yaml.txt | 2 ++
5 files changed, 23 insertions(+), 3 deletions(-)
diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style
index ff5e715593df..3694b0b1ebb6 100755
--- a/scripts/dtc/dt-check-style
+++ b/scripts/dtc/dt-check-style
@@ -985,10 +985,16 @@ def check_tab_in_yaml_example(ctx):
yield (cont.lineno, 'tab character not allowed in DTS example')
+def _check_trailing_whitespace(dl):
+ if dl.raw != dl.raw.rstrip():
+ yield (dl.lineno, 'trailing whitespace')
+
+
def check_trailing_whitespace(ctx):
for dl in ctx.lines:
- if dl.raw != dl.raw.rstrip():
- yield (dl.lineno, 'trailing whitespace')
+ yield from _check_trailing_whitespace(dl)
+ for cont in dl.continuations:
+ yield from _check_trailing_whitespace(cont)
def check_unclosed_block_comment(ctx):
diff --git a/scripts/dtc/dt-style-selftest/bad/dts-trailing-ws.dts b/scripts/dtc/dt-style-selftest/bad/dts-trailing-ws.dts
index 1eb24d91c640..73c24525ce18 100644
--- a/scripts/dtc/dt-style-selftest/bad/dts-trailing-ws.dts
+++ b/scripts/dtc/dt-style-selftest/bad/dts-trailing-ws.dts
@@ -5,4 +5,12 @@ / {
compatible = "example,test-board";
#address-cells = <1>;
#size-cells = <1>;
+
+ interrupt-controller@10000 {
+ compatible = "example,intc";
+ reg = <0x10000 0x1000>;
+ clocks = <1 2 3>,
+ <4 5 6>,
+ <7 8 9>;
+ };
};
diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-trailing-ws.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-trailing-ws.yaml
index f338c14174e6..17eeed3411c6 100644
--- a/scripts/dtc/dt-style-selftest/bad/yaml-trailing-ws.yaml
+++ b/scripts/dtc/dt-style-selftest/bad/yaml-trailing-ws.yaml
@@ -25,5 +25,8 @@ examples:
- |
device@1000 {
compatible = "example,test-trailing";
- reg = <0x1000 0x100>;
+ reg = <0x1000 0x100>,
+ <0x2000 0x100>,
+ <0x3000
+ 0x100>;
};
diff --git a/scripts/dtc/dt-style-selftest/expected/dts-trailing-ws.dts.txt b/scripts/dtc/dt-style-selftest/expected/dts-trailing-ws.dts.txt
index 94d9ae9d616c..a15a7d637c30 100644
--- a/scripts/dtc/dt-style-selftest/expected/dts-trailing-ws.dts.txt
+++ b/scripts/dtc/dt-style-selftest/expected/dts-trailing-ws.dts.txt
@@ -1,2 +1,3 @@
# mode=relaxed
bad/dts-trailing-ws.dts:5: [trailing-whitespace] trailing whitespace
+bad/dts-trailing-ws.dts:13: [trailing-whitespace] trailing whitespace
diff --git a/scripts/dtc/dt-style-selftest/expected/yaml-trailing-ws.yaml.txt b/scripts/dtc/dt-style-selftest/expected/yaml-trailing-ws.yaml.txt
index cfdbc8476c73..4f2ec9572bc6 100644
--- a/scripts/dtc/dt-style-selftest/expected/yaml-trailing-ws.yaml.txt
+++ b/scripts/dtc/dt-style-selftest/expected/yaml-trailing-ws.yaml.txt
@@ -1,2 +1,4 @@
# mode=relaxed
bad/yaml-trailing-ws.yaml:27: example 0 [trailing-whitespace] trailing whitespace
+bad/yaml-trailing-ws.yaml:29: example 0 [trailing-whitespace] trailing whitespace
+bad/yaml-trailing-ws.yaml:30: example 0 [trailing-whitespace] trailing whitespace
--
2.53.0
^ permalink raw reply [flat|nested] 10+ messages in thread* [PATCH v3 4/7] dtc: dt-check-style: Unduplicate checks in check_mixed_indent_chars()
2026-09-09 13:10 [PATCH v3 0/7] dtc: dt-check-style: Improvements for handling continued lines Krzysztof Kozlowski
` (2 preceding siblings ...)
2026-09-09 13:10 ` [PATCH v3 3/7] dtc: dt-check-style: Handle continued lines in check_trailing_whitespace() Krzysztof Kozlowski
@ 2026-09-09 13:10 ` Krzysztof Kozlowski
2026-09-09 13:10 ` [PATCH v3 5/7] dtc: dt-check-style: Right strip whitespaces, leftovers before comments Krzysztof Kozlowski
` (3 subsequent siblings)
7 siblings, 0 replies; 10+ messages in thread
From: Krzysztof Kozlowski @ 2026-09-09 13:10 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Saravana Kannan
Cc: devicetree, linux-kernel, Krzysztof Kozlowski
Code checking each DtsLine and continuations is the same, so split it to
separate function to avoid duplicated code. This has a positive side
effect - if DtsLine did not have indentation, then check continued to
next one, but now it will still go through the continued lines in the
second loop.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
---
scripts/dtc/dt-check-style | 29 +++++++++++++----------------
1 file changed, 13 insertions(+), 16 deletions(-)
diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style
index 3694b0b1ebb6..2ff9fdc50367 100755
--- a/scripts/dtc/dt-check-style
+++ b/scripts/dtc/dt-check-style
@@ -645,27 +645,24 @@ def check_line_length(ctx):
yield from _check_line_length(cont)
+def _check_mixed_indent_chars(dl):
+ if not dl.indent_str:
+ return
+ if dl.linetype == LineType.PREPROCESSOR:
+ return
+ 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)')
+
+
def check_mixed_indent_chars(ctx):
"""Indent must be all-tabs, except for aligning indentation (comments
or continued lines)."""
for dl in ctx.lines:
- if not dl.indent_str:
- continue
- if dl.linetype == LineType.PREPROCESSOR:
- continue
- 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)')
+ yield from _check_mixed_indent_chars(dl)
for cont in dl.continuations:
- if not cont.indent_str:
- continue
- if cont.linetype == LineType.PREPROCESSOR:
- 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)')
+ yield from _check_mixed_indent_chars(cont)
def check_node_close_alone(ctx):
--
2.53.0
^ permalink raw reply [flat|nested] 10+ messages in thread* [PATCH v3 5/7] dtc: dt-check-style: Right strip whitespaces, leftovers before comments
2026-09-09 13:10 [PATCH v3 0/7] dtc: dt-check-style: Improvements for handling continued lines Krzysztof Kozlowski
` (3 preceding siblings ...)
2026-09-09 13:10 ` [PATCH v3 4/7] dtc: dt-check-style: Unduplicate checks in check_mixed_indent_chars() Krzysztof Kozlowski
@ 2026-09-09 13:10 ` Krzysztof Kozlowski
2026-09-09 13:10 ` [PATCH v3 6/7] dtc: dt-check-style: Properly detect comments in multi-line properties Krzysztof Kozlowski
` (2 subsequent siblings)
7 siblings, 0 replies; 10+ messages in thread
From: Krzysztof Kozlowski @ 2026-09-09 13:10 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Saravana Kannan
Cc: devicetree, linux-kernel, Krzysztof Kozlowski
Stripping a comment from a line to get the code leads trailing
whitespace (e.g. in a line like "enable-active-high; /* comment */")
which will break DtsLine.code.endswith() checks.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
---
scripts/dtc/dt-check-style | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style
index 2ff9fdc50367..b10e30f9d5b9 100755
--- a/scripts/dtc/dt-check-style
+++ b/scripts/dtc/dt-check-style
@@ -91,7 +91,8 @@ class DtsLine:
self.indent_str = indent_str # leading whitespace as-is
self.depth = depth
self.stripped = stripped # Code without indentation
- self.code = _strip_strings_and_comments(stripped) # Only the code, skipping trailing comments
+ # Only the code, skipping trailing comments and space between code and trailing comment
+ self.code = _strip_strings_and_comments(stripped).rstrip()
self.is_root = is_root
self.prop_name = None
self.continuations = []
--
2.53.0
^ permalink raw reply [flat|nested] 10+ messages in thread* [PATCH v3 6/7] dtc: dt-check-style: Properly detect comments in multi-line properties
2026-09-09 13:10 [PATCH v3 0/7] dtc: dt-check-style: Improvements for handling continued lines Krzysztof Kozlowski
` (4 preceding siblings ...)
2026-09-09 13:10 ` [PATCH v3 5/7] dtc: dt-check-style: Right strip whitespaces, leftovers before comments Krzysztof Kozlowski
@ 2026-09-09 13:10 ` Krzysztof Kozlowski
2026-09-09 13:10 ` [PATCH v3 7/7] dtc: dt-check-style: Relax property ordering rules (drop alphabetical) Krzysztof Kozlowski
2026-09-15 14:27 ` [PATCH v3 0/7] dtc: dt-check-style: Improvements for handling continued lines Rob Herring
7 siblings, 0 replies; 10+ messages in thread
From: Krzysztof Kozlowski @ 2026-09-09 13:10 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Saravana Kannan
Cc: devicetree, linux-kernel, Krzysztof Kozlowski
Code classifying given line exits on first condition match, thus a line
consisting only of a comment in a continued (multi-line) property, like:
interrupts = <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>,
/* Performance counter interrupts */
<GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>;
was treated as a comment-line line, not as continuation, leading to
false positive warnings of invalid indentation:
arch/arm64/boot/dts/tesla/fsd.dtsi:456: [indent-consistent] indent mismatch (expected depth 3 * '\t')
This needs two related fixes:
1. Move the judgment as a LineType.CONTINUATION earlier before one
classifying as a comment
2. Check the comment-stripped DtsLine.code, not DtsLine.stripped, to
verify if it is a continuation.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
---
scripts/dtc/dt-check-style | 19 ++++++++++---------
scripts/dtc/dt-style-selftest/bad/dts-cont-align.dts | 1 +
.../dtc/dt-style-selftest/bad/yaml-cont-align.yaml | 1 +
.../dt-style-selftest/expected/dts-cont-align.dts.txt | 11 ++++++-----
.../expected/yaml-cont-align.yaml.txt | 3 ++-
scripts/dtc/dt-style-selftest/good/dts-cont-align.dts | 1 +
.../dtc/dt-style-selftest/good/yaml-cont-align.yaml | 1 +
7 files changed, 22 insertions(+), 15 deletions(-)
diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style
index b10e30f9d5b9..9fcb2eeaf7fe 100755
--- a/scripts/dtc/dt-check-style
+++ b/scripts/dtc/dt-check-style
@@ -202,6 +202,14 @@ def classify_lines(text):
if opens_block:
in_block_comment = True
+ if not prev_complete:
+ dl = DtsLine(i, raw, LineType.CONTINUATION, depth, indent_str, code)
+ out.append(dl)
+ prev_complete = (code.endswith(';') or
+ code.endswith('{') or
+ code.endswith('};'))
+ continue
+
# Pure-comment line: nothing left after stripping. Classify as
# COMMENT_START (carries to next line) or COMMENT, and skip the
# structural classification entirely.
@@ -211,14 +219,6 @@ def classify_lines(text):
out.append(dl)
continue
- if not prev_complete:
- dl = DtsLine(i, raw, LineType.CONTINUATION, depth, indent_str, code)
- out.append(dl)
- prev_complete = (code.endswith(';') or
- code.endswith('{') or
- code.endswith('};'))
- continue
-
# NODE_CLOSE: the canonical form is "}" or "};" alone. A line
# that is nothing but closures (e.g. "}; };") is still treated
# as NODE_CLOSE for depth tracking, but the multi-closure case
@@ -545,7 +545,8 @@ def check_continuation_alignment(ctx):
'continuation should align to column %d '
'(%s)' % (target_col + target_offset + 1, err_msg_explanation))
# Align to the value within <> or "" of continuation (so the previous line)
- dl_value_complete = cont.stripped.endswith('",') or cont.stripped.endswith('>,')
+ if len(cont.code):
+ dl_value_complete = cont.code.endswith('",') or cont.code.endswith('>,')
def _check_hex_case(dl):
diff --git a/scripts/dtc/dt-style-selftest/bad/dts-cont-align.dts b/scripts/dtc/dt-style-selftest/bad/dts-cont-align.dts
index 5390ebbf4059..91a74887c774 100644
--- a/scripts/dtc/dt-style-selftest/bad/dts-cont-align.dts
+++ b/scripts/dtc/dt-style-selftest/bad/dts-cont-align.dts
@@ -11,6 +11,7 @@ interrupt-controller@10000 {
reg = <0x10000 0x1000>;
clocks = <1 2 3>, /* comments with " < , should not matter */
<4 5 6>,
+ /* but comments should be placed properly */
<7 8 9>;
interrupts = <1 2 3>, /* comments with " < , should not ... */
<4 5 6>,
diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-cont-align.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-cont-align.yaml
index a5a9eb17fc17..0189b654a5b0 100644
--- a/scripts/dtc/dt-style-selftest/bad/yaml-cont-align.yaml
+++ b/scripts/dtc/dt-style-selftest/bad/yaml-cont-align.yaml
@@ -27,6 +27,7 @@ examples:
compatible = "example,test-cont-align";
reg = <0x1000 0x100>, /* comments with " < , should not matter */
<0x2000 0x100>, /* comments with " < , should not matter */
+ /* but comments should be placed properly */
<0x3000
0x100>;
};
diff --git a/scripts/dtc/dt-style-selftest/expected/dts-cont-align.dts.txt b/scripts/dtc/dt-style-selftest/expected/dts-cont-align.dts.txt
index a7ed62677a2b..fd7f389d6cce 100644
--- a/scripts/dtc/dt-style-selftest/expected/dts-cont-align.dts.txt
+++ b/scripts/dtc/dt-style-selftest/expected/dts-cont-align.dts.txt
@@ -1,10 +1,11 @@
# mode=strict
bad/dts-cont-align.dts:13: [continuation-alignment] continuation should align to column 26 (to < or ")
bad/dts-cont-align.dts:14: [continuation-alignment] continuation should align to column 26 (to < or ")
-bad/dts-cont-align.dts:16: [continuation-alignment] continuation should align to column 30 (to < or ")
+bad/dts-cont-align.dts:15: [continuation-alignment] continuation should align to column 26 (to < or ")
bad/dts-cont-align.dts:17: [continuation-alignment] continuation should align to column 30 (to < or ")
-bad/dts-cont-align.dts:19: [continuation-alignment] continuation should align to column 27 (to the value under <)
-bad/dts-cont-align.dts:20: [continuation-alignment] continuation should align to column 26 (to < or ")
-bad/dts-cont-align.dts:21: [continuation-alignment] continuation should align to column 27 (to the value under <)
-bad/dts-cont-align.dts:23: [continuation-alignment] continuation should align to column 38 (to < or ")
+bad/dts-cont-align.dts:18: [continuation-alignment] continuation should align to column 30 (to < or ")
+bad/dts-cont-align.dts:20: [continuation-alignment] continuation should align to column 27 (to the value under <)
+bad/dts-cont-align.dts:21: [continuation-alignment] continuation should align to column 26 (to < or ")
+bad/dts-cont-align.dts:22: [continuation-alignment] continuation should align to column 27 (to the value under <)
bad/dts-cont-align.dts:24: [continuation-alignment] continuation should align to column 38 (to < or ")
+bad/dts-cont-align.dts:25: [continuation-alignment] continuation should align to column 38 (to < or ")
diff --git a/scripts/dtc/dt-style-selftest/expected/yaml-cont-align.yaml.txt b/scripts/dtc/dt-style-selftest/expected/yaml-cont-align.yaml.txt
index eb9a84d5c222..9e98c28867aa 100644
--- a/scripts/dtc/dt-style-selftest/expected/yaml-cont-align.yaml.txt
+++ b/scripts/dtc/dt-style-selftest/expected/yaml-cont-align.yaml.txt
@@ -1,3 +1,4 @@
# mode=strict
bad/yaml-cont-align.yaml:29: example 0 [continuation-alignment] continuation should align to column 11 (to < or ")
-bad/yaml-cont-align.yaml:31: example 0 [continuation-alignment] continuation should align to column 12 (to the value under <)
+bad/yaml-cont-align.yaml:30: example 0 [continuation-alignment] continuation should align to column 11 (to < or ")
+bad/yaml-cont-align.yaml:32: example 0 [continuation-alignment] continuation should align to column 12 (to the value under <)
diff --git a/scripts/dtc/dt-style-selftest/good/dts-cont-align.dts b/scripts/dtc/dt-style-selftest/good/dts-cont-align.dts
index b52ee6cccd8c..e6450a1d8209 100644
--- a/scripts/dtc/dt-style-selftest/good/dts-cont-align.dts
+++ b/scripts/dtc/dt-style-selftest/good/dts-cont-align.dts
@@ -17,6 +17,7 @@ interrupt-controller@10000 {
reg = <0x10000 0x1000>;
interrupts = <1 2 3>, /* comments with " < , should not ... */
<4 5 6>,
+ /* but comments should be placed properly */
<7 8 9>;
pinmux = <0x01
0x02>,
diff --git a/scripts/dtc/dt-style-selftest/good/yaml-cont-align.yaml b/scripts/dtc/dt-style-selftest/good/yaml-cont-align.yaml
index 8463075f9f4c..4a5b5ad43ee8 100644
--- a/scripts/dtc/dt-style-selftest/good/yaml-cont-align.yaml
+++ b/scripts/dtc/dt-style-selftest/good/yaml-cont-align.yaml
@@ -27,6 +27,7 @@ examples:
compatible = "example,test-cont-align";
reg = <0x1000 0x100>,
<0x2000 0x100>,
+ /* but comments should be placed properly */
<0x3000
0x100>;
};
--
2.53.0
^ permalink raw reply [flat|nested] 10+ messages in thread* [PATCH v3 7/7] dtc: dt-check-style: Relax property ordering rules (drop alphabetical)
2026-09-09 13:10 [PATCH v3 0/7] dtc: dt-check-style: Improvements for handling continued lines Krzysztof Kozlowski
` (5 preceding siblings ...)
2026-09-09 13:10 ` [PATCH v3 6/7] dtc: dt-check-style: Properly detect comments in multi-line properties Krzysztof Kozlowski
@ 2026-09-09 13:10 ` Krzysztof Kozlowski
2026-09-15 14:27 ` [PATCH v3 0/7] dtc: dt-check-style: Improvements for handling continued lines Rob Herring
7 siblings, 0 replies; 10+ messages in thread
From: Krzysztof Kozlowski @ 2026-09-09 13:10 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Saravana Kannan
Cc: devicetree, linux-kernel, Krzysztof Kozlowski
Existing rules checked whether properties follow DTS Coding Style
guidelines in respect of common properties and standard vs vendor
properties, plus additionally it enforced alphabetical order within each
of such group.
The in-tree DTS does not follow such style at all, so this lead to many
warnings. There is little value in fixing these warnings, because DTS
with non-alphabetical order of properties is exactly the same readable,
even though DTS Coding Style mentions natural order. Actually groupping
properties logically, e.g. all supplies together regardless of their
name, is more readable than pure natural sort.
Relax the property order rules to the most important aspects
(device_type, reg/reg-names, ranges, standard properties, vendor
properties, status) and skip the alphabetical sorting completely.
Assisted-by: LLM
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
---
.../devicetree/bindings/dts-coding-style.rst | 5 +-
scripts/dtc/dt-check-style | 137 +++++++++------------
.../dt-style-selftest/bad/dts-property-order.dts | 3 +
.../dt-style-selftest/bad/dts-property-order.dtso | 3 +
.../dtc/dt-style-selftest/bad/yaml-prop-order.yaml | 5 +
.../expected/dts-property-order.dts.txt | 7 +-
.../expected/dts-property-order.dtso.txt | 7 +-
.../expected/dts-property-pairing.dts.txt | 6 +-
.../expected/yaml-prop-order.yaml.txt | 1 +
.../expected/yaml-prop-pairing.yaml.txt | 6 +-
.../dt-style-selftest/good/dts-property-order.dts | 3 +
.../dt-style-selftest/good/dts-property-order.dtso | 3 +
12 files changed, 91 insertions(+), 95 deletions(-)
diff --git a/Documentation/devicetree/bindings/dts-coding-style.rst b/Documentation/devicetree/bindings/dts-coding-style.rst
index 63648db377e1..441436b7fa80 100644
--- a/Documentation/devicetree/bindings/dts-coding-style.rst
+++ b/Documentation/devicetree/bindings/dts-coding-style.rst
@@ -135,8 +135,9 @@ The above-described ordering follows this approach:
3. Status is the last information to annotate that device node is or is not
finished (board resources are needed).
-The individual properties inside each group shall use natural sort order by
-the property name.
+The individual properties inside each group shall use usually natural sort
+order by the property name, with exceptions of logical grouping of properties,
+e.g. supplies.
Example::
diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style
index 9fcb2eeaf7fe..99b22364d866 100755
--- a/scripts/dtc/dt-check-style
+++ b/scripts/dtc/dt-check-style
@@ -714,65 +714,40 @@ def check_property_name(ctx):
yield (dl.lineno, f'property name "{dl.prop_name}" is using discouraged style')
-def _property_bucket(name):
- """Return the canonical bucket index for a property:
- 0 device_type
+def _property_bucket(name, is_root=False):
+ """Return the canonical bucket (group) index for a property:
+ 0 device_type ('model' in the root node)
1 compatible
- 2 reg / reg-names
+ 2 reg, reg-names
3 ranges
4 standard properties (no vendor comma in #-stripped name)
5 vendor-specific properties
6 status
- Plus a sub-key inside the bucket for fixed slots (device_type, compatible,
- reg, reg-names, ranges, status). 'standard' and 'vendor' return None for
- the sub-key, signalling that the within-bucket key is computed by
- the pairing rules."""
+ Properties sharing a bucket compare equal: their relative order
+ within the group is not checked, only the pairing rules below
+ apply."""
stripped = name.lstrip('#')
- if name == 'device_type':
- return (0, 0)
+ if is_root:
+ if name == 'model':
+ return 0
+ elif name == 'device_type':
+ return 0
if name == 'compatible':
- return (1, 0)
- if name == 'reg':
- return (2, 0)
- if name == 'reg-names':
- return (2, 1)
+ return 1
+ if name in ('reg', 'reg-names'):
+ return 2
if name == 'ranges':
- return (3, 0)
+ return 3
if name == 'status':
- return (6, 0)
- return (5 if ',' in stripped else 4, None)
-
-
-def _property_bucket_root(name):
- """Return the canonical bucket index for a property:
- 0 model (for root nodes only)
- 1 compatible
- Plus a sub-key inside the bucket for fixed slots (device_type, compatible,
- reg, reg-names, ranges, status). 'standard' and 'vendor' return None for
- the sub-key, signalling that the within-bucket key is computed by
- the pairing rules."""
- stripped = name.lstrip('#')
- if name == 'model':
- return (0, 0)
- if name == 'compatible':
- return (1, 0)
- if name == 'reg':
- return (2, 0)
- if name == 'reg-names':
- return (2, 1)
- if name == 'ranges':
- return (3, 0)
- if name == 'status':
- return (6, 0)
- return (5 if ',' in stripped else 4, None)
+ return 6
+ return 5 if ',' in stripped else 4
# Declarative pairing rules: each is a callable
# (name, all_names) -> anchor_name_or_None
-# If a rule returns an anchor, the property sorts immediately after the
+# If a rule returns an anchor, the property must be placed after the
# anchor. Rules are tried in order; the first match wins. If none
-# matches, the within-bucket key falls back to natural sort by the
-# #-stripped name.
+# matches, the property can be placed anywhere within its bucket.
def _pair_pinctrl_names(name, all_names):
"""pinctrl-names follows the highest pinctrl-N in the same node."""
@@ -787,8 +762,7 @@ def _pair_pinctrl_names(name, all_names):
def _pair_x_names(name, all_names):
"""Generic <x>-names follows its owning property. The owner is
usually plural (clocks/clock-names, dmas/dma-names,
- resets/reset-names) but occasionally singular (reg/reg-names is
- handled by the fixed slot above; this rule catches anything else)."""
+ resets/reset-names) but occasionally singular (reg/reg-names)."""
if not name.endswith('-names'):
return None
base = name[:-len('-names')]
@@ -812,33 +786,27 @@ PAIRING_RULES = (_pair_pinctrl_names, _pair_x_names,
_pair_address_size_cells)
-def _property_sort_key(dl, name, all_names):
- """Sort key for a property among its node-body siblings.
-
- Format: (bucket, within_key, tiebreak). 'within_key' for
- standard/vendor buckets follows pairing rules: a property paired
- with anchor X sorts as if it were X with a higher tiebreak."""
- if dl.is_root:
- bucket, fixed_sub = _property_bucket_root(name)
- else:
- bucket, fixed_sub = _property_bucket(name)
- if fixed_sub is not None:
- return (bucket, (), fixed_sub)
-
+def _property_anchor(name, all_names):
+ """Return the property this one must be placed after, or None."""
for rule in PAIRING_RULES:
anchor = rule(name, all_names)
if anchor is not None:
- return (bucket, _natural_sort_key(anchor.lstrip('#')), 1)
-
- return (bucket, _natural_sort_key(name.lstrip('#')), 0)
+ return anchor
+ return None
def check_property_order(ctx):
- """Properties within a node body must appear in canonical order:
- compatible, reg(/reg-names), ranges, then the standard group, then
- the vendor-specific group, then status. Inside the standard and
- vendor groups, pairing rules apply (e.g. <x>-names follows <x>);
- everything else falls back to natural sort by the #-stripped name."""
+ """Properties within a node body must be grouped in canonical
+ order: device_type ('model' for the root node), compatible,
+ reg(/reg-names), ranges, then the standard group, then the
+ vendor-specific group, then status.
+
+ The order of properties within one group is free, e.g. it does not
+ matter whether '#address-cells' comes before or after 'clocks'.
+ Paired properties still keep their relative order: <x>-names
+ follows <x> (clocks/clock-names, reg/reg-names, ...), pinctrl-names
+ follows the pinctrl-N states and #size-cells follows
+ #address-cells."""
lines = ctx.lines
for i, dl in enumerate(lines):
if dl.linetype != LineType.NODE_OPEN:
@@ -856,16 +824,26 @@ def check_property_order(ctx):
if len(props) < 2:
continue
all_names = [p.prop_name for p in props]
- keyed = [(p, _property_sort_key(dl, p.prop_name, all_names))
- for p in props]
- for k in range(1, len(keyed)):
- if keyed[k][1] < keyed[k - 1][1]:
- p = keyed[k][0]
- prev = keyed[k - 1][0]
- yield (p.lineno,
- 'property %r out of canonical order '
- '(should sort before %r)' %
- (p.prop_name, prev.prop_name))
+ buckets = [_property_bucket(p.prop_name, dl.is_root) for p in props]
+ findings = []
+ # Group (bucket) order
+ for k in range(1, len(props)):
+ if buckets[k] < buckets[k - 1]:
+ findings.append((props[k].lineno,
+ 'property %r out of canonical order '
+ '(should sort before %r)' %
+ (props[k].prop_name,
+ props[k - 1].prop_name)))
+ # Pairing within a group: the anchor must come first
+ seen = set()
+ for p in props:
+ anchor = _property_anchor(p.prop_name, all_names)
+ if anchor is not None and anchor not in seen:
+ findings.append((p.lineno,
+ 'property %r must be placed after %r' %
+ (p.prop_name, anchor)))
+ seen.add(p.prop_name)
+ yield from sorted(findings)
def _check_redundant_whitespace(dl):
@@ -1161,7 +1139,8 @@ RULES = [
'property names use only recommended characters (see DTS Coding Style)',
check_property_name),
Rule('property-order', 'strict',
- 'canonical bucket + pairing + natural-sort order of properties',
+ 'canonical group + pairing order of properties (order within '
+ 'a group is not checked)',
check_property_order),
# See also check_redundant_whitespace() and check_value_whitespace()
Rule('redundant-whitespace-strict', 'strict',
diff --git a/scripts/dtc/dt-style-selftest/bad/dts-property-order.dts b/scripts/dtc/dt-style-selftest/bad/dts-property-order.dts
index ebe561e38766..eb36daa4fe72 100644
--- a/scripts/dtc/dt-style-selftest/bad/dts-property-order.dts
+++ b/scripts/dtc/dt-style-selftest/bad/dts-property-order.dts
@@ -43,6 +43,9 @@ interrupt-controller@10000 {
<4 5 6>,
<7 8 9>;
compatible = "example,intc";
+ qcom,calibration-variant = "foo";
+ clocks = <6>;
+ qcom,opp-fuse-level = <1>;
};
};
};
diff --git a/scripts/dtc/dt-style-selftest/bad/dts-property-order.dtso b/scripts/dtc/dt-style-selftest/bad/dts-property-order.dtso
index 64604fa6b8c3..b2e564f2af2b 100644
--- a/scripts/dtc/dt-style-selftest/bad/dts-property-order.dtso
+++ b/scripts/dtc/dt-style-selftest/bad/dts-property-order.dtso
@@ -44,6 +44,9 @@ interrupt-controller@10000 {
<4 5 6>,
<7 8 9>;
compatible = "example,intc";
+ qcom,calibration-variant = "foo";
+ clocks = <6>;
+ qcom,opp-fuse-level = <1>;
};
};
};
diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-prop-order.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-prop-order.yaml
index bf1480e97209..4d8a50d0e35a 100644
--- a/scripts/dtc/dt-style-selftest/bad/yaml-prop-order.yaml
+++ b/scripts/dtc/dt-style-selftest/bad/yaml-prop-order.yaml
@@ -26,4 +26,9 @@ examples:
device@1000 {
reg = <0x1000 0x100>;
compatible = "example,test-prop-order";
+
+ interrupts = <1>;
+ qcom,calibration-variant = "foo";
+ clocks = <6>;
+ qcom,opp-fuse-level = <1>;
};
diff --git a/scripts/dtc/dt-style-selftest/expected/dts-property-order.dts.txt b/scripts/dtc/dt-style-selftest/expected/dts-property-order.dts.txt
index 0ab832ccf07a..155b072f0ac2 100644
--- a/scripts/dtc/dt-style-selftest/expected/dts-property-order.dts.txt
+++ b/scripts/dtc/dt-style-selftest/expected/dts-property-order.dts.txt
@@ -6,6 +6,7 @@ bad/dts-property-order.dts:21: [property-order] property 'device_type' out of ca
bad/dts-property-order.dts:30: [property-order] property 'dma-coherent' out of canonical order (should sort before 'status')
bad/dts-property-order.dts:35: [property-order] property 'compatible' out of canonical order (should sort before 'ranges')
bad/dts-property-order.dts:45: [property-order] property 'compatible' out of canonical order (should sort before 'interrupts')
-bad/dts-property-order.dts:50: [redundant-whitespace] extra whitespace before {
-bad/dts-property-order.dts:52: [property-order] property 'model' out of canonical order (should sort before 'compatible')
-bad/dts-property-order.dts:57: [property-order] property 'model' out of canonical order (should sort before 'compatible')
+bad/dts-property-order.dts:47: [property-order] property 'clocks' out of canonical order (should sort before 'qcom,calibration-variant')
+bad/dts-property-order.dts:53: [redundant-whitespace] extra whitespace before {
+bad/dts-property-order.dts:55: [property-order] property 'model' out of canonical order (should sort before 'compatible')
+bad/dts-property-order.dts:60: [property-order] property 'model' out of canonical order (should sort before 'compatible')
diff --git a/scripts/dtc/dt-style-selftest/expected/dts-property-order.dtso.txt b/scripts/dtc/dt-style-selftest/expected/dts-property-order.dtso.txt
index 9f2a00916329..48c020d21b64 100644
--- a/scripts/dtc/dt-style-selftest/expected/dts-property-order.dtso.txt
+++ b/scripts/dtc/dt-style-selftest/expected/dts-property-order.dtso.txt
@@ -6,6 +6,7 @@ bad/dts-property-order.dtso:22: [property-order] property 'device_type' out of c
bad/dts-property-order.dtso:31: [property-order] property 'dma-coherent' out of canonical order (should sort before 'status')
bad/dts-property-order.dtso:36: [property-order] property 'compatible' out of canonical order (should sort before 'ranges')
bad/dts-property-order.dtso:46: [property-order] property 'compatible' out of canonical order (should sort before 'interrupts')
-bad/dts-property-order.dtso:51: [redundant-whitespace] extra whitespace before {
-bad/dts-property-order.dtso:53: [property-order] property 'model' out of canonical order (should sort before 'compatible')
-bad/dts-property-order.dtso:58: [property-order] property 'model' out of canonical order (should sort before 'compatible')
+bad/dts-property-order.dtso:48: [property-order] property 'clocks' out of canonical order (should sort before 'qcom,calibration-variant')
+bad/dts-property-order.dtso:54: [redundant-whitespace] extra whitespace before {
+bad/dts-property-order.dtso:56: [property-order] property 'model' out of canonical order (should sort before 'compatible')
+bad/dts-property-order.dtso:61: [property-order] property 'model' out of canonical order (should sort before 'compatible')
diff --git a/scripts/dtc/dt-style-selftest/expected/dts-property-pairing.dts.txt b/scripts/dtc/dt-style-selftest/expected/dts-property-pairing.dts.txt
index dad3d8485012..976471ca8068 100644
--- a/scripts/dtc/dt-style-selftest/expected/dts-property-pairing.dts.txt
+++ b/scripts/dtc/dt-style-selftest/expected/dts-property-pairing.dts.txt
@@ -1,5 +1,3 @@
# mode=strict
-bad/dts-property-pairing.dts:21: [property-order] property 'clocks' out of canonical order (should sort before 'clock-names')
-bad/dts-property-pairing.dts:25: [property-order] property '#address-cells' out of canonical order (should sort before 'interrupts')
-bad/dts-property-pairing.dts:27: [property-order] property 'pinctrl-0' out of canonical order (should sort before 'pinctrl-names')
-bad/dts-property-pairing.dts:28: [property-order] property '#size-cells' out of canonical order (should sort before 'pinctrl-0')
+bad/dts-property-pairing.dts:20: [property-order] property 'clock-names' must be placed after 'clocks'
+bad/dts-property-pairing.dts:26: [property-order] property 'pinctrl-names' must be placed after 'pinctrl-0'
diff --git a/scripts/dtc/dt-style-selftest/expected/yaml-prop-order.yaml.txt b/scripts/dtc/dt-style-selftest/expected/yaml-prop-order.yaml.txt
index 578df7209170..bb0dd5db5135 100644
--- a/scripts/dtc/dt-style-selftest/expected/yaml-prop-order.yaml.txt
+++ b/scripts/dtc/dt-style-selftest/expected/yaml-prop-order.yaml.txt
@@ -1,2 +1,3 @@
# mode=strict
bad/yaml-prop-order.yaml:28: example 0 [property-order] property 'compatible' out of canonical order (should sort before 'reg')
+bad/yaml-prop-order.yaml:32: example 0 [property-order] property 'clocks' out of canonical order (should sort before 'qcom,calibration-variant')
diff --git a/scripts/dtc/dt-style-selftest/expected/yaml-prop-pairing.yaml.txt b/scripts/dtc/dt-style-selftest/expected/yaml-prop-pairing.yaml.txt
index 025ec872f1b0..dcdee1cff506 100644
--- a/scripts/dtc/dt-style-selftest/expected/yaml-prop-pairing.yaml.txt
+++ b/scripts/dtc/dt-style-selftest/expected/yaml-prop-pairing.yaml.txt
@@ -1,5 +1,3 @@
# mode=strict
-bad/yaml-prop-pairing.yaml:30: example 0 [property-order] property 'clocks' out of canonical order (should sort before 'clock-names')
-bad/yaml-prop-pairing.yaml:31: example 0 [property-order] property '#address-cells' out of canonical order (should sort before 'clocks')
-bad/yaml-prop-pairing.yaml:33: example 0 [property-order] property 'pinctrl-0' out of canonical order (should sort before 'pinctrl-names')
-bad/yaml-prop-pairing.yaml:34: example 0 [property-order] property '#size-cells' out of canonical order (should sort before 'pinctrl-0')
+bad/yaml-prop-pairing.yaml:29: example 0 [property-order] property 'clock-names' must be placed after 'clocks'
+bad/yaml-prop-pairing.yaml:32: example 0 [property-order] property 'pinctrl-names' must be placed after 'pinctrl-0'
diff --git a/scripts/dtc/dt-style-selftest/good/dts-property-order.dts b/scripts/dtc/dt-style-selftest/good/dts-property-order.dts
index 3d847cc9fa3e..288fcfb9888f 100644
--- a/scripts/dtc/dt-style-selftest/good/dts-property-order.dts
+++ b/scripts/dtc/dt-style-selftest/good/dts-property-order.dts
@@ -40,7 +40,10 @@ soc@0 {
interrupt-controller@10000 {
compatible = "example,intc";
reg = <0x10000 0x1000>;
+ clocks = <6>;
interrupts = <1 2 3>;
+ qcom,calibration-variant = "foo";
+ qcom,opp-fuse-level = <1>;
};
};
};
diff --git a/scripts/dtc/dt-style-selftest/good/dts-property-order.dtso b/scripts/dtc/dt-style-selftest/good/dts-property-order.dtso
index 5ae78541f68b..60c68b3f908a 100644
--- a/scripts/dtc/dt-style-selftest/good/dts-property-order.dtso
+++ b/scripts/dtc/dt-style-selftest/good/dts-property-order.dtso
@@ -41,7 +41,10 @@ soc@0 {
interrupt-controller@10000 {
compatible = "example,intc";
reg = <0x10000 0x1000>;
+ clocks = <6>;
interrupts = <1 2 3>;
+ qcom,calibration-variant = "foo";
+ qcom,opp-fuse-level = <1>;
};
};
};
--
2.53.0
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH v3 0/7] dtc: dt-check-style: Improvements for handling continued lines
2026-09-09 13:10 [PATCH v3 0/7] dtc: dt-check-style: Improvements for handling continued lines Krzysztof Kozlowski
` (6 preceding siblings ...)
2026-09-09 13:10 ` [PATCH v3 7/7] dtc: dt-check-style: Relax property ordering rules (drop alphabetical) Krzysztof Kozlowski
@ 2026-09-15 14:27 ` Rob Herring
2026-09-15 16:14 ` Krzysztof Kozlowski
7 siblings, 1 reply; 10+ messages in thread
From: Rob Herring @ 2026-09-15 14:27 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Krzysztof Kozlowski, Conor Dooley, Saravana Kannan, devicetree,
linux-kernel
On Wed, Sep 09, 2026 at 03:10:34PM +0200, Krzysztof Kozlowski wrote:
> Changes in v3:
> - New commit:
> "dtc: dt-check-style: Relax property ordering rules (drop alphabetical)"
> - Improve commit msg of "Unduplicate checks in
> check_mixed_indent_chars()" patch.
> - Link to v2: https://patch.msgid.link/20260909-b4-dts-style-checker-continued-lines-v2-0-c5cb4c9d9b66@oss.qualcomm.com
>
> Changes in v2:
> 1. Four new commits 1-4
> 2. Drop last commit
> v1: https://lore.kernel.org/all/20260906180437.166760-6-krzysztof.kozlowski@oss.qualcomm.com/
>
> Best regards,
> Krzysztof
>
> ---
> Krzysztof Kozlowski (7):
> dtc: dt-check-style: Handle continued lines in check_hex_case()
> dtc: dt-check-style: Handle continued lines in check_line_length()
> dtc: dt-check-style: Handle continued lines in check_trailing_whitespace()
> dtc: dt-check-style: Unduplicate checks in check_mixed_indent_chars()
> dtc: dt-check-style: Right strip whitespaces, leftovers before comments
> dtc: dt-check-style: Properly detect comments in multi-line properties
> dtc: dt-check-style: Relax property ordering rules (drop alphabetical)
Patch 7 doesn't apply.
> base-commit: 694b801ceb1bea205878f2136e8b25c888e51be7
And I don't have this commit in my tree to resolve the conflicts.
Rob
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH v3 0/7] dtc: dt-check-style: Improvements for handling continued lines
2026-09-15 14:27 ` [PATCH v3 0/7] dtc: dt-check-style: Improvements for handling continued lines Rob Herring
@ 2026-09-15 16:14 ` Krzysztof Kozlowski
0 siblings, 0 replies; 10+ messages in thread
From: Krzysztof Kozlowski @ 2026-09-15 16:14 UTC (permalink / raw)
To: Rob Herring
Cc: Krzysztof Kozlowski, Conor Dooley, Saravana Kannan, devicetree,
linux-kernel
On 15/09/2026 16:27, Rob Herring wrote:
> On Wed, Sep 09, 2026 at 03:10:34PM +0200, Krzysztof Kozlowski wrote:
>> Changes in v3:
>> - New commit:
>> "dtc: dt-check-style: Relax property ordering rules (drop alphabetical)"
>> - Improve commit msg of "Unduplicate checks in
>> check_mixed_indent_chars()" patch.
>> - Link to v2: https://patch.msgid.link/20260909-b4-dts-style-checker-continued-lines-v2-0-c5cb4c9d9b66@oss.qualcomm.com
>>
>> Changes in v2:
>> 1. Four new commits 1-4
>> 2. Drop last commit
>> v1: https://lore.kernel.org/all/20260906180437.166760-6-krzysztof.kozlowski@oss.qualcomm.com/
>>
>> Best regards,
>> Krzysztof
>>
>> ---
>> Krzysztof Kozlowski (7):
>> dtc: dt-check-style: Handle continued lines in check_hex_case()
>> dtc: dt-check-style: Handle continued lines in check_line_length()
>> dtc: dt-check-style: Handle continued lines in check_trailing_whitespace()
>> dtc: dt-check-style: Unduplicate checks in check_mixed_indent_chars()
>> dtc: dt-check-style: Right strip whitespaces, leftovers before comments
>> dtc: dt-check-style: Properly detect comments in multi-line properties
>> dtc: dt-check-style: Relax property ordering rules (drop alphabetical)
>
> Patch 7 doesn't apply.
>
>> base-commit: 694b801ceb1bea205878f2136e8b25c888e51be7
>
> And I don't have this commit in my tree to resolve the conflicts.
Ah my bad, I had a WIP commit somewhere in the history used as base for
it. I'll rebase and send a new version
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 10+ messages in thread