[PATCH 1/6] dtc: dt-check-style: Sort rule directory by name

From: Krzysztof Kozlowski

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


Sort the array with all the rules, so managing this will be at bit
easier and simultaneous addons of new rules less conflict-prone. No
functional changes.

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

diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style
index 487e76b85105..49b5c28563eb 100755
--- a/scripts/dtc/dt-check-style
+++ b/scripts/dtc/dt-check-style
@@ -1036,22 +1036,7 @@ RULES = [
# 'relaxed' is the default; rules in this group must produce zero
# output on a clean kernel tree (post the small prep-cleanup
# commit at the head of this series).
- Rule('trailing-whitespace', 'relaxed',
- 'no trailing whitespace on any line',
- check_trailing_whitespace),
- # See also check_redundant_whitespace_strict() and check_value_whitespace()
- Rule('redundant-whitespace', 'relaxed',
- 'no redundant whitespace within code',
- check_redundant_whitespace),
- Rule('tab-in-yaml', 'relaxed',
- 'YAML (also DTS examples) may not contain tab characters',
- check_tab_in_yaml_example, applies_to=('yaml',)),
- Rule('mixed-indent-chars', 'relaxed',
- 'indent must not mix tabs and spaces',
- check_mixed_indent_chars, applies_to=('dts', 'dtsi', 'dtso')),
- Rule('unclosed-block-comment', 'relaxed',
- 'every /* block comment must close with */',
- check_unclosed_block_comment),
+ # Rules are sorted here by group (relaxed, strict, stricter) and name

# DTS files always use tabs; this is not negotiable per kernel
# coding style (.dts files are real source). Relaxed mode.
@@ -1059,19 +1044,26 @@ RULES = [
'DTS files: 1 tab per nesting level',
check_indent_unit_dts,
applies_to=('dts', 'dtsi', 'dtso')),
+ Rule('mixed-indent-chars', 'relaxed',
+ 'indent must not mix tabs and spaces',
+ check_mixed_indent_chars, applies_to=('dts', 'dtsi', 'dtso')),
+ # See also check_redundant_whitespace_strict() and check_value_whitespace()
+ Rule('redundant-whitespace', 'relaxed',
+ 'no redundant whitespace within code',
+ check_redundant_whitespace),
+ Rule('tab-in-yaml', 'relaxed',
+ 'YAML (also DTS examples) may not contain tab characters',
+ check_tab_in_yaml_example, applies_to=('yaml',)),
+ Rule('trailing-whitespace', 'relaxed',
+ 'no trailing whitespace on any line',
+ check_trailing_whitespace),
+ Rule('unclosed-block-comment', 'relaxed',
+ 'every /* block comment must close with */',
+ check_unclosed_block_comment),

# 'strict' rules are opt-in (e.g. for new submissions via
# checkpatch.pl in a follow-up series). They flag many existing
# files and can be promoted to relaxed once those are cleaned up.
- Rule('indent-unit', 'strict',
- 'YAML: 2 or 4 spaces per level',
- check_indent_unit_relaxed, applies_to=('yaml',)),
- Rule('indent-unit-strict', 'strict',
- 'YAML: must be 4 spaces per level',
- check_indent_unit_strict, applies_to=('yaml',)),
- Rule('indent-consistent', 'strict',
- 'every line indented at depth * unit',
- check_indent_consistent),
Rule('blank-lines', 'strict',
'no consecutive blanks; no blanks at node body edges',
check_blank_lines),
@@ -1081,37 +1073,43 @@ RULES = [
Rule('child-name-order', 'strict',
'unaddressed siblings must be in natural-sort name order',
check_child_name_order),
- Rule('property-order', 'strict',
- 'canonical bucket + pairing + natural-sort order of properties',
- check_property_order),
- Rule('required-blank-lines', 'strict',
- 'blank line before child nodes and before "status"',
- check_required_blank_lines),
+ Rule('continuation-alignment', 'strict',
+ 'multi-line property continuations align under <, " or the value under <',
+ check_continuation_alignment),
Rule('hex-case', 'strict',
'hex literals must be lowercase',
check_hex_case),
- Rule('unit-address-format', 'strict',
- 'unit addresses must be lowercase hex without leading zeros',
- check_unit_address_format),
- # See also check_redundant_whitespace() and check_value_whitespace()
- Rule('redundant-whitespace-strict', 'strict',
- 'no redundant whitespace within code',
- check_redundant_whitespace_strict),
- Rule('value-whitespace', 'strict',
- 'no whitespace directly inside <...> brackets',
- check_value_whitespace),
- Rule('node-close-alone', 'strict',
- 'closing brace must be on its own line',
- check_node_close_alone),
+ Rule('indent-consistent', 'strict',
+ 'every line indented at depth * unit',
+ check_indent_consistent),
+ Rule('indent-unit', 'strict',
+ 'YAML: 2 or 4 spaces per level',
+ check_indent_unit_relaxed, applies_to=('yaml',)),
+ Rule('indent-unit-strict', 'strict',
+ 'YAML: must be 4 spaces per level',
+ check_indent_unit_strict, applies_to=('yaml',)),
Rule('line-length', 'strict',
'lines must not exceed 80 columns',
check_line_length, applies_to=('yaml',)),
Rule('line-length-dts', 'stricter',
'lines must not exceed 80 columns',
check_line_length, applies_to=('dts', 'dtsi', 'dtso')),
- Rule('continuation-alignment', 'strict',
- 'multi-line property continuations align under <, " or the value under <',
- check_continuation_alignment),
+ Rule('node-close-alone', 'strict',
+ 'closing brace must be on its own line',
+ check_node_close_alone),
+ Rule('property-order', 'strict',
+ 'canonical bucket + pairing + natural-sort order of properties',
+ check_property_order),
+ # See also check_redundant_whitespace() and check_value_whitespace()
+ Rule('redundant-whitespace-strict', 'strict',
+ 'no redundant whitespace within code',
+ check_redundant_whitespace_strict),
+ Rule('required-blank-lines', 'strict',
+ 'blank line before child nodes and before "status"',
+ check_required_blank_lines),
+ Rule('unit-address-format', 'strict',
+ 'unit addresses must be lowercase hex without leading zeros',
+ check_unit_address_format),
Rule('unused-labels', 'strict',
'every label must be &-referenced in the same example/file '
'(skipped for .dtsi/.dtso since labels there are exported)',
@@ -1120,6 +1118,9 @@ RULES = [
'every label must be &-referenced in the same example/file '
'(skipped for .dtsi/.dtso since labels there are exported)',
check_unused_labels, applies_to=('dts',)),
+ Rule('value-whitespace', 'strict',
+ 'no whitespace directly inside <...> brackets',
+ check_value_whitespace),
]



--
2.53.0