* [PATCH v3 0/6] dtc: dt-check-style: Improvement after using on DTS
@ 2026-07-06 15:53 Krzysztof Kozlowski
2026-07-06 15:53 ` [PATCH v3 1/6] dtc: dt-check-style: Narrow disallowing of tab in DTS only to YAML Krzysztof Kozlowski
` (5 more replies)
0 siblings, 6 replies; 14+ messages in thread
From: Krzysztof Kozlowski @ 2026-07-06 15:53 UTC (permalink / raw)
To: Rob Herring, Saravana Kannan, Krzysztof Kozlowski, Conor Dooley,
Test User
Cc: devicetree, linux-kernel, Daniel Golle, Krzysztof Kozlowski
Changes in v3:
1. Patch #2: Use re.search
2. Patch #2: Add dts-mixed-indent.dts test case
3. Several new patches 3-7.
v2: https://lore.kernel.org/r/20260706102421.343639-4-krzysztof.kozlowski@oss.qualcomm.com/
Changes in v2:
1. Patch #2: Rework idea.
2. Adjust function doc/comment.
v1: https://lore.kernel.org/r/20260706071446.87669-2-krzysztof.kozlowski@oss.qualcomm.com/
(I was not using b4 for v1 and v2, so b4 diff might fail)
Best regards,
Krzysztof
---
Krzysztof Kozlowski (6):
dtc: dt-check-style: Narrow disallowing of tab in DTS only to YAML
dtc: dt-check-style: Allow space-aligning indentation in DTS
dtc: dt-check-style: Rework handling YAML/DTS in rules
dtc: dt-check-style: Expect first device_type
dtc: dt-check-style: Do not sort top-level nodes in DTS by unit address
dtc: dt-check-style: Handle properly DTC-style includes
.../devicetree/bindings/dts-coding-style.rst | 15 ++--
scripts/dtc/dt-check-style | 84 +++++++++++++---------
.../dt-style-selftest/bad/dts-digit-node-order.dts | 40 +++++++++++
.../dtc/dt-style-selftest/bad/dts-mixed-indent.dts | 20 ++++++
.../dt-style-selftest/bad/dts-property-order.dts | 36 ++++++++++
.../bad/yaml-prop-order-device-type.yaml | 31 ++++++++
.../expected/dts-digit-node-order.dts.txt | 2 +
.../expected/dts-mixed-indent.dts.txt | 8 +++
.../expected/dts-property-order.dts.txt | 5 ++
.../expected/yaml-mixed-indent.yaml.txt | 1 -
.../expected/yaml-prop-order-device-type.yaml.txt | 2 +
scripts/dtc/dt-style-selftest/good/dts-dtc.dts | 20 ++++++
.../dt-style-selftest/good/dts-preprocessor.dts | 20 ++++++
scripts/dtc/dt-style-selftest/good/soc.dtsi | 40 +++++++++++
14 files changed, 284 insertions(+), 40 deletions(-)
---
base-commit: 3190fb5798e880161c46f2a623a354b23892dc36
change-id: 20260706-dts-style-checker-750a187f41d7
Best regards,
--
Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH v3 1/6] dtc: dt-check-style: Narrow disallowing of tab in DTS only to YAML
2026-07-06 15:53 [PATCH v3 0/6] dtc: dt-check-style: Improvement after using on DTS Krzysztof Kozlowski
@ 2026-07-06 15:53 ` Krzysztof Kozlowski
2026-07-06 15:59 ` sashiko-bot
2026-07-06 15:53 ` [PATCH v3 2/6] dtc: dt-check-style: Allow space-aligning indentation in DTS Krzysztof Kozlowski
` (4 subsequent siblings)
5 siblings, 1 reply; 14+ messages in thread
From: Krzysztof Kozlowski @ 2026-07-06 15:53 UTC (permalink / raw)
To: Rob Herring, Saravana Kannan, Krzysztof Kozlowski, Conor Dooley,
Test User
Cc: devicetree, linux-kernel, Daniel Golle, Krzysztof Kozlowski
DTS in the bindings (example in a YAML file) does not have tabs at all,
but regular DTS do, therefore entire check check_tab_in_dts() has
confusing name and should apply only to YAML files.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
---
Changes in v2:
1. New patch
---
scripts/dtc/dt-check-style | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style
index 2d5723d41ea3..34e0f7e2a57a 100755
--- a/scripts/dtc/dt-check-style
+++ b/scripts/dtc/dt-check-style
@@ -340,7 +340,7 @@ def check_trailing_whitespace(ctx):
yield (dl.lineno, 'trailing whitespace')
-def check_tab_in_dts(ctx):
+def check_tab_in_yaml_example(ctx):
"""Reject literal tabs in DTS lines when input is YAML.
For YAML examples, indent and content must use spaces. Tabs inside
@@ -929,7 +929,7 @@ RULES = [
check_trailing_whitespace),
Rule('tab-in-dts', 'relaxed',
'YAML examples may not contain tab characters',
- check_tab_in_dts, applies_to=('yaml',)),
+ check_tab_in_yaml_example, applies_to=('yaml',)),
Rule('mixed-indent-chars', 'relaxed',
'indent must not mix tabs and spaces',
check_mixed_indent_chars),
--
2.53.0
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH v3 2/6] dtc: dt-check-style: Allow space-aligning indentation in DTS
2026-07-06 15:53 [PATCH v3 0/6] dtc: dt-check-style: Improvement after using on DTS Krzysztof Kozlowski
2026-07-06 15:53 ` [PATCH v3 1/6] dtc: dt-check-style: Narrow disallowing of tab in DTS only to YAML Krzysztof Kozlowski
@ 2026-07-06 15:53 ` Krzysztof Kozlowski
2026-07-06 15:53 ` [PATCH v3 3/6] dtc: dt-check-style: Rework handling YAML/DTS in rules Krzysztof Kozlowski
` (3 subsequent siblings)
5 siblings, 0 replies; 14+ messages in thread
From: Krzysztof Kozlowski @ 2026-07-06 15:53 UTC (permalink / raw)
To: Rob Herring, Saravana Kannan, Krzysztof Kozlowski, Conor Dooley,
Test User
Cc: devicetree, linux-kernel, Daniel Golle, Krzysztof Kozlowski
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. What we can easily detect is a space followed by
tab or too many spaces (more than alignment).
OTOH, DTS example in YAML files does not have tabs at all and there is
already rule for that, thus there is no point to check for mixed
indentation there.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
---
Changes in v3:
1. Use re.search
2. Add dts-mixed-indent.dts test case
v2: https://lore.kernel.org/r/20260706102421.343639-4-krzysztof.kozlowski@oss.qualcomm.com/
Changes in v2:
1. Rework idea.
2. Adjust function doc/comment.
v1: https://lore.kernel.org/r/20260706071446.87669-2-krzysztof.kozlowski@oss.qualcomm.com/
---
scripts/dtc/dt-check-style | 9 ++++++---
.../dtc/dt-style-selftest/bad/dts-mixed-indent.dts | 20 ++++++++++++++++++++
.../expected/dts-mixed-indent.dts.txt | 8 ++++++++
.../expected/yaml-mixed-indent.yaml.txt | 1 -
4 files changed, 34 insertions(+), 4 deletions(-)
diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style
index 34e0f7e2a57a..29a2ee658e2b 100755
--- a/scripts/dtc/dt-check-style
+++ b/scripts/dtc/dt-check-style
@@ -359,14 +359,17 @@ def check_tab_in_yaml_example(ctx):
def check_mixed_indent_chars(ctx):
- """Indent must be all-spaces or all-tabs, never mixed on one line."""
+ """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 ' ' in dl.indent_str and '\t' in dl.indent_str:
+ 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 detect_indent_unit(ctx):
@@ -932,7 +935,7 @@ RULES = [
check_tab_in_yaml_example, applies_to=('yaml',)),
Rule('mixed-indent-chars', 'relaxed',
'indent must not mix tabs and spaces',
- check_mixed_indent_chars),
+ check_mixed_indent_chars, applies_to=('dts', 'dtsi', 'dtso')),
Rule('unclosed-block-comment', 'relaxed',
'every /* block comment must close with */',
check_unclosed_block_comment),
diff --git a/scripts/dtc/dt-style-selftest/bad/dts-mixed-indent.dts b/scripts/dtc/dt-style-selftest/bad/dts-mixed-indent.dts
new file mode 100644
index 000000000000..f0e40cfc910c
--- /dev/null
+++ b/scripts/dtc/dt-style-selftest/bad/dts-mixed-indent.dts
@@ -0,0 +1,20 @@
+// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+/* Test fixture: a .dts using wrong indent. */
+
+/dts-v1/;
+
+/ {
+ compatible = "example,test-board";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ soc@0 {
+ compatible = "simple-bus";
+ ranges = <0 0 0 0xc0000000>;
+
+ clocks = <1>,
+ <2>,
+ <3>;
+ resets = <5>;
+ };
+};
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
new file mode 100644
index 000000000000..54ddf3608244
--- /dev/null
+++ b/scripts/dtc/dt-style-selftest/expected/dts-mixed-indent.dts.txt
@@ -0,0 +1,8 @@
+# mode=strict
+bad/dts-mixed-indent.dts:11: [indent-consistent] indent mismatch (expected depth 1 * '\t')
+bad/dts-mixed-indent.dts:11: [mixed-indent-chars] too many space characters in indent (more than 7)
+bad/dts-mixed-indent.dts:12: [indent-consistent] indent mismatch (expected depth 2 * '\t')
+bad/dts-mixed-indent.dts:12: [mixed-indent-chars] mixed tabs and spaces in indent
+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:18: [indent-consistent] indent mismatch (expected depth 2 * '\t')
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 c989f8f19853..0089c62963f5 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,3 +1,2 @@
# mode=relaxed
-bad/yaml-mixed-indent.yaml:27: example 0 [mixed-indent-chars] mixed tabs and spaces in indent
bad/yaml-mixed-indent.yaml:27: example 0 [tab-in-dts] tab character not allowed in DTS example
--
2.53.0
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH v3 3/6] dtc: dt-check-style: Rework handling YAML/DTS in rules
2026-07-06 15:53 [PATCH v3 0/6] dtc: dt-check-style: Improvement after using on DTS Krzysztof Kozlowski
2026-07-06 15:53 ` [PATCH v3 1/6] dtc: dt-check-style: Narrow disallowing of tab in DTS only to YAML Krzysztof Kozlowski
2026-07-06 15:53 ` [PATCH v3 2/6] dtc: dt-check-style: Allow space-aligning indentation in DTS Krzysztof Kozlowski
@ 2026-07-06 15:53 ` Krzysztof Kozlowski
2026-07-06 15:53 ` [PATCH v3 4/6] dtc: dt-check-style: Expect first device_type Krzysztof Kozlowski
` (2 subsequent siblings)
5 siblings, 0 replies; 14+ messages in thread
From: Krzysztof Kozlowski @ 2026-07-06 15:53 UTC (permalink / raw)
To: Rob Herring, Saravana Kannan, Krzysztof Kozlowski, Conor Dooley,
Test User
Cc: devicetree, linux-kernel, Daniel Golle, Krzysztof Kozlowski
Individual rules behave differently depending whether they handle
bindings (YAML) or DTS, but the code was focusing on type of indentation
(spaces vs tabs). That indentation is actually irrelevant in some
rules, so differentiate based on file type. This will be more relevant
in the future when more rules act differently on DTS, than on bindings.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
---
Changes in v3:
New patch
---
scripts/dtc/dt-check-style | 23 ++++++++++++-----------
1 file changed, 12 insertions(+), 11 deletions(-)
diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style
index 29a2ee658e2b..cf61e92d0568 100755
--- a/scripts/dtc/dt-check-style
+++ b/scripts/dtc/dt-check-style
@@ -311,13 +311,16 @@ def collect_labels_and_refs(text):
class Ctx:
"""Context passed to each rule check. Carries the parsed lines,
- raw text, mode, and indent kind."""
+ raw text, mode and kind."""
- def __init__(self, lines, text, mode, indent_kind):
+ def __init__(self, lines, text, mode, kind):
self.lines = lines
self.text = text
self.mode = mode # 'relaxed' or 'strict'
- self.indent_kind = indent_kind # 'spaces' or 'tab'
+ if kind in DTS_FAMILY:
+ self.file_type = 'dts'
+ else:
+ self.file_type = 'yaml'
class Rule:
@@ -347,7 +350,7 @@ def check_tab_in_yaml_example(ctx):
a #define value are tolerated (those are CPP macros, not DTS).
For .dts files, this rule does not apply -- tabs are required.
"""
- if ctx.indent_kind != 'spaces':
+ if ctx.file_type != 'yaml':
return
for dl in ctx.lines:
if dl.linetype == LineType.PREPROCESSOR:
@@ -420,7 +423,7 @@ def check_indent_unit_strict(ctx):
unit = detect_indent_unit(ctx)
if unit is None:
return
- if ctx.indent_kind == 'spaces':
+ if ctx.file_type == 'yaml':
if unit != ' ':
yield (1, 'indent unit must be 4 spaces in strict mode, '
'got %r' % unit)
@@ -431,7 +434,7 @@ def check_indent_consistent(ctx):
unit = detect_indent_unit(ctx)
if unit is None:
return
- if ctx.indent_kind == 'spaces':
+ if ctx.file_type == 'yaml':
if unit not in (' ', ' '):
return # let check_indent_unit_* report this
else:
@@ -1016,11 +1019,11 @@ def select_rules(mode, input_kind):
# Block runner
# ---------------------------------------------------------------------------
-def check_block(text, mode, indent_kind, input_type):
+def check_block(text, mode, input_type):
"""Run all selected rules on a single block of DTS text. Returns a
list of (lineno, rule_name, message) tuples."""
lines = classify_lines(text)
- ctx = Ctx(lines, text, mode, indent_kind)
+ ctx = Ctx(lines, text, mode, input_type)
rules = select_rules(mode, input_type)
findings = []
for r in rules:
@@ -1100,17 +1103,15 @@ def collect_findings(filepath, mode):
formatted output strings; count is the number of findings."""
kind = input_kind(filepath)
if kind == 'yaml':
- indent_kind = 'spaces'
iterator = iter_yaml_examples(filepath)
elif kind in DTS_FAMILY:
- indent_kind = 'tab'
iterator = iter_dts_file(filepath)
else:
return (['%s: unknown file type, skipping' % filepath], 0)
out = []
for text, base, idx in iterator:
- for lineno, rule, msg in check_block(text, mode, indent_kind, kind):
+ for lineno, rule, msg in check_block(text, mode, kind):
abs_line = base + lineno - 1
ex_tag = '' if idx is None else ' example %d' % idx
out.append('%s:%d:%s [%s] %s' %
--
2.53.0
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH v3 4/6] dtc: dt-check-style: Expect first device_type
2026-07-06 15:53 [PATCH v3 0/6] dtc: dt-check-style: Improvement after using on DTS Krzysztof Kozlowski
` (2 preceding siblings ...)
2026-07-06 15:53 ` [PATCH v3 3/6] dtc: dt-check-style: Rework handling YAML/DTS in rules Krzysztof Kozlowski
@ 2026-07-06 15:53 ` Krzysztof Kozlowski
2026-07-06 16:07 ` sashiko-bot
2026-07-06 15:53 ` [PATCH v3 5/6] dtc: dt-check-style: Do not sort top-level nodes in DTS by unit address Krzysztof Kozlowski
2026-07-06 15:53 ` [PATCH v3 6/6] dtc: dt-check-style: Handle properly DTC-style includes Krzysztof Kozlowski
5 siblings, 1 reply; 14+ messages in thread
From: Krzysztof Kozlowski @ 2026-07-06 15:53 UTC (permalink / raw)
To: Rob Herring, Saravana Kannan, Krzysztof Kozlowski, Conor Dooley,
Test User
Cc: devicetree, linux-kernel, Daniel Golle, Krzysztof Kozlowski
A few nodes do have "device_type" property which is mostly, but not always,
the first property in a device node, when applicable. Adjust the DTS
coding style rules to actually expect the device_type first and improve
the dt-check-style to handle this correctly.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
---
Changes in v3:
New patch
---
.../devicetree/bindings/dts-coding-style.rst | 15 ++++-----
scripts/dtc/dt-check-style | 29 +++++++++--------
.../dt-style-selftest/bad/dts-property-order.dts | 36 ++++++++++++++++++++++
.../bad/yaml-prop-order-device-type.yaml | 31 +++++++++++++++++++
.../expected/dts-property-order.dts.txt | 5 +++
.../expected/yaml-prop-order-device-type.yaml.txt | 2 ++
6 files changed, 98 insertions(+), 20 deletions(-)
diff --git a/Documentation/devicetree/bindings/dts-coding-style.rst b/Documentation/devicetree/bindings/dts-coding-style.rst
index 4a02ea60cbbe..63648db377e1 100644
--- a/Documentation/devicetree/bindings/dts-coding-style.rst
+++ b/Documentation/devicetree/bindings/dts-coding-style.rst
@@ -114,15 +114,16 @@ Order of Properties in Device Node
The following order of properties in device nodes is preferred:
-1. "compatible"
-2. "reg"
-3. "ranges"
-4. Standard/common properties (defined by common bindings, e.g. without
+1. "device_type" (if applicable)
+2. "compatible"
+3. "reg"
+4. "ranges"
+5. Standard/common properties (defined by common bindings, e.g. without
vendor-prefixes)
-5. Vendor-specific properties
-6. "status" (if applicable), preceded by a blank line if there is content
+6. Vendor-specific properties
+7. "status" (if applicable), preceded by a blank line if there is content
before the property
-7. Child nodes, where each node is preceded with a blank line
+8. Child nodes, where each node is preceded with a blank line
The "status" property is by default "okay", thus it can be omitted.
diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style
index cf61e92d0568..d9080297bd4d 100755
--- a/scripts/dtc/dt-check-style
+++ b/scripts/dtc/dt-check-style
@@ -558,28 +558,31 @@ def check_child_name_order(ctx):
def _property_bucket(name):
"""Return the canonical bucket index for a property:
- 0 compatible
- 1 reg / reg-names
- 2 ranges
- 3 standard properties (no vendor comma in #-stripped name)
- 4 vendor-specific properties
- 5 status
+ 0 device_type
+ 1 compatible
+ 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 (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 == 'compatible':
+ if name == 'device_type':
return (0, 0)
- if name == 'reg':
+ if name == 'compatible':
return (1, 0)
- if name == 'reg-names':
- return (1, 1)
- if name == 'ranges':
+ if name == 'reg':
return (2, 0)
+ if name == 'reg-names':
+ return (2, 1)
+ if name == 'ranges':
+ return (3, 0)
if name == 'status':
- return (5, 0)
- return (4 if ',' in stripped else 3, None)
+ return (6, 0)
+ return (5 if ',' in stripped else 4, None)
# Declarative pairing rules: each is a callable
diff --git a/scripts/dtc/dt-style-selftest/bad/dts-property-order.dts b/scripts/dtc/dt-style-selftest/bad/dts-property-order.dts
new file mode 100644
index 000000000000..9e55d683a071
--- /dev/null
+++ b/scripts/dtc/dt-style-selftest/bad/dts-property-order.dts
@@ -0,0 +1,36 @@
+// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+/*
+ * Test fixture: Incorrect property order
+ */
+
+/dts-v1/;
+
+/ {
+ memory@a0000000 {
+ reg = <0x0 0xa0000000 0x0 0x0>;
+ device_type = "memory";
+ };
+
+ pmu {
+ compatible = "example,pmu";
+
+ status = "disabled";
+ dma-coherent;
+ };
+
+ soc@0 {
+ ranges = <0 0 0 0xc0000000>;
+ compatible = "simple-bus";
+
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ interrupt-controller@10000 {
+ reg = <0x10000 0x1000>;
+ interrupts = <1 2 3>,
+ <4 5 6>,
+ <7 8 9>;
+ compatible = "example,intc";
+ };
+ };
+};
diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-prop-order-device-type.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-prop-order-device-type.yaml
new file mode 100644
index 000000000000..433afb731dde
--- /dev/null
+++ b/scripts/dtc/dt-style-selftest/bad/yaml-prop-order-device-type.yaml
@@ -0,0 +1,31 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/test-bad-prop-order.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Test fixture with device_type
+
+maintainers:
+ - Test User <test@example.com>
+
+properties:
+ compatible:
+ const: example,test-prop-order-device-type
+ reg:
+ maxItems: 1
+ device_type: true
+
+required:
+ - compatible
+ - reg
+
+additionalProperties: false
+
+examples:
+ - |
+ device@1000 {
+ compatible = "example,test-prop-order";
+ device_type = "cpu";
+ reg = <0x1000 0x100>;
+ };
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
new file mode 100644
index 000000000000..7b1a6bae3741
--- /dev/null
+++ b/scripts/dtc/dt-style-selftest/expected/dts-property-order.dts.txt
@@ -0,0 +1,5 @@
+# mode=strict
+bad/dts-property-order.dts:11: [property-order] property 'device_type' out of canonical order (should sort before 'reg')
+bad/dts-property-order.dts:18: [property-order] property 'dma-coherent' out of canonical order (should sort before 'status')
+bad/dts-property-order.dts:23: [property-order] property 'compatible' out of canonical order (should sort before 'ranges')
+bad/dts-property-order.dts:33: [property-order] property 'compatible' out of canonical order (should sort before 'interrupts')
diff --git a/scripts/dtc/dt-style-selftest/expected/yaml-prop-order-device-type.yaml.txt b/scripts/dtc/dt-style-selftest/expected/yaml-prop-order-device-type.yaml.txt
new file mode 100644
index 000000000000..9350e2b80f75
--- /dev/null
+++ b/scripts/dtc/dt-style-selftest/expected/yaml-prop-order-device-type.yaml.txt
@@ -0,0 +1,2 @@
+# mode=strict
+bad/yaml-prop-order-device-type.yaml:29: example 0 [property-order] property 'device_type' out of canonical order (should sort before 'compatible')
--
2.53.0
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH v3 5/6] dtc: dt-check-style: Do not sort top-level nodes in DTS by unit address
2026-07-06 15:53 [PATCH v3 0/6] dtc: dt-check-style: Improvement after using on DTS Krzysztof Kozlowski
` (3 preceding siblings ...)
2026-07-06 15:53 ` [PATCH v3 4/6] dtc: dt-check-style: Expect first device_type Krzysztof Kozlowski
@ 2026-07-06 15:53 ` Krzysztof Kozlowski
2026-07-06 16:05 ` sashiko-bot
2026-07-06 15:53 ` [PATCH v3 6/6] dtc: dt-check-style: Handle properly DTC-style includes Krzysztof Kozlowski
5 siblings, 1 reply; 14+ messages in thread
From: Krzysztof Kozlowski @ 2026-07-06 15:53 UTC (permalink / raw)
To: Rob Herring, Saravana Kannan, Krzysztof Kozlowski, Conor Dooley,
Test User
Cc: devicetree, linux-kernel, Daniel Golle, Krzysztof Kozlowski
Top-level DTS (but not example in the bindings) has only two nodes with
unit-addresses: memory@ and soc@. There are two special cases here, in
terms of coding style:
1. The unit-address of memory is often not known thus set to @0, because
it is filled up by bootloader.
2. There is mixture of non-unit-address and unit-address nodes.
Therefore usually the DTS chooses sorting by the node name, not the unit
address, for the top-level part. Disable sorting by the unit address if
depth of node is less than '2'.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
---
Changes in v3:
New patch
---
scripts/dtc/dt-check-style | 8 ++++-
.../dt-style-selftest/bad/dts-digit-node-order.dts | 40 ++++++++++++++++++++++
.../expected/dts-digit-node-order.dts.txt | 2 ++
3 files changed, 49 insertions(+), 1 deletion(-)
diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style
index d9080297bd4d..3c1aa9e28347 100755
--- a/scripts/dtc/dt-check-style
+++ b/scripts/dtc/dt-check-style
@@ -515,12 +515,18 @@ def _natural_sort_key(s):
def check_child_address_order(ctx):
"""Addressed siblings (foo@N) must appear in ascending address
- order within their parent node body."""
+ order within their parent node body.
+ Exception: Top-level in DTS follows name order, regardless of unit address
+ in memory@N and soc@N nodes
+ """
for children in _walk_bodies(ctx.lines):
addressed = []
for c in children:
if c.node_addr is None:
continue
+ if (ctx.file_type == 'dts') and (c.depth < 2):
+ # Top-level does not use unit address sorting usually
+ continue
try:
parts = tuple(int(p, 16) for p in c.node_addr.split(','))
except ValueError:
diff --git a/scripts/dtc/dt-style-selftest/bad/dts-digit-node-order.dts b/scripts/dtc/dt-style-selftest/bad/dts-digit-node-order.dts
new file mode 100644
index 000000000000..29b931ccfdbd
--- /dev/null
+++ b/scripts/dtc/dt-style-selftest/bad/dts-digit-node-order.dts
@@ -0,0 +1,40 @@
+// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+/ {
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ memory@a0000000 {
+ device_type = "memory";
+ reg = <0x0 0xa0000000 0x0 0x0>;
+ };
+
+ pmu {
+ compatible = "example,pmu";
+ };
+
+ soc@0 {
+ compatible = "simple-bus";
+ ranges = <0 0 0 0xc0000000>;
+
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ serial@20000 {
+ compatible = "example,serial";
+ reg = <0x20000 0x1000>;
+ };
+
+ interrupt-controller@10000 {
+ compatible = "example,intc";
+ reg = <0x10000 0x1000>;
+ interrupts = <1 2 3>,
+ <4 5 6>,
+ <7 8 9>;
+ };
+
+ serial@30000 {
+ compatible = "example,serial";
+ reg = <0x30000 0x1000>;
+ };
+ };
+};
diff --git a/scripts/dtc/dt-style-selftest/expected/dts-digit-node-order.dts.txt b/scripts/dtc/dt-style-selftest/expected/dts-digit-node-order.dts.txt
new file mode 100644
index 000000000000..4d681ea4f639
--- /dev/null
+++ b/scripts/dtc/dt-style-selftest/expected/dts-digit-node-order.dts.txt
@@ -0,0 +1,2 @@
+# mode=strict
+bad/dts-digit-node-order.dts:27: [child-address-order] child node @10000 out of address order
--
2.53.0
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH v3 6/6] dtc: dt-check-style: Handle properly DTC-style includes
2026-07-06 15:53 [PATCH v3 0/6] dtc: dt-check-style: Improvement after using on DTS Krzysztof Kozlowski
` (4 preceding siblings ...)
2026-07-06 15:53 ` [PATCH v3 5/6] dtc: dt-check-style: Do not sort top-level nodes in DTS by unit address Krzysztof Kozlowski
@ 2026-07-06 15:53 ` Krzysztof Kozlowski
2026-07-06 16:13 ` sashiko-bot
5 siblings, 1 reply; 14+ messages in thread
From: Krzysztof Kozlowski @ 2026-07-06 15:53 UTC (permalink / raw)
To: Rob Herring, Saravana Kannan, Krzysztof Kozlowski, Conor Dooley,
Test User
Cc: devicetree, linux-kernel, Daniel Golle, Krzysztof Kozlowski
dt-check-style was not properly handling DTC directives (starting with
'/', e.g. /dts-v1/ or /include/), thus a few DTS files had false
positive like:
apm/apm-merlin.dts:1: [indent-unit-dts] indent unit must be 1 tab in DTS, got '\t\t'
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
---
Changes in v3:
New patch
---
scripts/dtc/dt-check-style | 11 ++++--
scripts/dtc/dt-style-selftest/good/dts-dtc.dts | 20 +++++++++++
.../dt-style-selftest/good/dts-preprocessor.dts | 20 +++++++++++
scripts/dtc/dt-style-selftest/good/soc.dtsi | 40 ++++++++++++++++++++++
4 files changed, 89 insertions(+), 2 deletions(-)
diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style
index 3c1aa9e28347..b8ba6dbee86d 100755
--- a/scripts/dtc/dt-check-style
+++ b/scripts/dtc/dt-check-style
@@ -49,6 +49,9 @@ re_cpp_directive = re.compile(
r'^#\s*(include|define|undef|ifdef|ifndef|if|else|elif|endif|'
r'pragma|error|warning)\b')
+re_dtc_directive = re.compile(
+ r'^/(dts-v1|include)/[;\s]')
+
# label: name@addr { -- label and addr optional; name can be "/"
# Per the DT spec a node name may start with a digit (e.g. 1wire@...).
# The address part is captured loosely (any non-space, non-brace run) so
@@ -66,7 +69,11 @@ re_ref_node = re.compile(
def is_preprocessor(stripped):
"""Tell C preprocessor directives apart from DTS '#'-prefixed props."""
- return re_cpp_directive.match(stripped) is not None
+ if re_cpp_directive.match(stripped) is not None:
+ return True
+ if re_dtc_directive.match(stripped) is not None:
+ return True
+ return False
class DtsLine:
@@ -178,7 +185,7 @@ def classify_lines(text):
out.append(dl)
continue
- if stripped.startswith('#') and is_preprocessor(stripped):
+ if (stripped.startswith('#') or stripped.startswith('/')) and is_preprocessor(stripped):
dl = DtsLine(i, raw, LineType.PREPROCESSOR,
indent_str, stripped)
dl.depth = depth
diff --git a/scripts/dtc/dt-style-selftest/good/dts-dtc.dts b/scripts/dtc/dt-style-selftest/good/dts-dtc.dts
new file mode 100644
index 000000000000..4f249e9406c7
--- /dev/null
+++ b/scripts/dtc/dt-style-selftest/good/dts-dtc.dts
@@ -0,0 +1,20 @@
+// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+/*
+ * Test fixture: dtc directive
+ */
+
+/dts-v1/;
+
+/include/ "soc.dtsi"
+
+/ {
+ compatible = "example,test-board";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ leds {
+ led-0 {
+ compatible = "example,led";
+ };
+ };
+};
diff --git a/scripts/dtc/dt-style-selftest/good/dts-preprocessor.dts b/scripts/dtc/dt-style-selftest/good/dts-preprocessor.dts
new file mode 100644
index 000000000000..86cfd33086ee
--- /dev/null
+++ b/scripts/dtc/dt-style-selftest/good/dts-preprocessor.dts
@@ -0,0 +1,20 @@
+// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+/*
+ * Test fixture: preprocessor directive
+ */
+
+/dts-v1/;
+
+#include "soc.dtsi"
+
+/ {
+ compatible = "example,test-board";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ leds {
+ led-0 {
+ compatible = "example,led";
+ };
+ };
+};
diff --git a/scripts/dtc/dt-style-selftest/good/soc.dtsi b/scripts/dtc/dt-style-selftest/good/soc.dtsi
new file mode 100644
index 000000000000..af7477cb8e3d
--- /dev/null
+++ b/scripts/dtc/dt-style-selftest/good/soc.dtsi
@@ -0,0 +1,40 @@
+// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+/ {
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ memory@a0000000 {
+ device_type = "memory";
+ reg = <0x0 0xa0000000 0x0 0x0>;
+ };
+
+ pmu {
+ compatible = "example,pmu";
+ };
+
+ soc@0 {
+ compatible = "simple-bus";
+ ranges = <0 0 0 0xc0000000>;
+
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ interrupt-controller@10000 {
+ compatible = "example,intc";
+ reg = <0x10000 0x1000>;
+ interrupts = <1 2 3>,
+ <4 5 6>,
+ <7 8 9>;
+ };
+
+ serial@20000 {
+ compatible = "example,serial";
+ reg = <0x20000 0x1000>;
+ };
+
+ serial@30000 {
+ compatible = "example,serial";
+ reg = <0x30000 0x1000>;
+ };
+ };
+};
--
2.53.0
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH v3 1/6] dtc: dt-check-style: Narrow disallowing of tab in DTS only to YAML
2026-07-06 15:53 ` [PATCH v3 1/6] dtc: dt-check-style: Narrow disallowing of tab in DTS only to YAML Krzysztof Kozlowski
@ 2026-07-06 15:59 ` sashiko-bot
2026-07-06 16:00 ` Krzysztof Kozlowski
0 siblings, 1 reply; 14+ messages in thread
From: sashiko-bot @ 2026-07-06 15:59 UTC (permalink / raw)
To: Krzysztof Kozlowski; +Cc: conor+dt, devicetree, robh
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The commit renames the function `check_tab_in_dts` to `check_tab_in_yaml_example` to resolve confusion, but fails to update the user-facing rule name `'tab-in-dts'`. This introduces an inconsistency between the internal function name and the rule string.
--
commit 9c825da9bb864c8e87cb2f6ad98274fc217a08b7
Author: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
dtc: dt-check-style: Narrow disallowing of tab in DTS only to YAML
This commit narrows the scope of the tab-in-dts style check to only apply
to YAML files. It renames the internal checking function to avoid confusion
since regular DTS files do allow tabs.
> diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style
> index 2d5723d41ea39..34e0f7e2a57a4 100755
> --- a/scripts/dtc/dt-check-style
> +++ b/scripts/dtc/dt-check-style
[ ... ]
> @@ -929,7 +929,7 @@ RULES = [
> check_trailing_whitespace),
> Rule('tab-in-dts', 'relaxed',
[Severity: Low]
Should the user-facing rule name 'tab-in-dts' be updated here as well?
Since this string is printed in warnings when a tab is found in a YAML example,
leaving it as 'tab-in-dts' might still cause the same confusion this patch aims
to resolve. Changing it to something like 'tab-in-yaml' might better align with
the new function name.
> 'YAML examples may not contain tab characters',
> - check_tab_in_dts, applies_to=('yaml',)),
> + check_tab_in_yaml_example, applies_to=('yaml',)),
> Rule('mixed-indent-chars', 'relaxed',
> 'indent must not mix tabs and spaces',
> check_mixed_indent_chars),
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260706-dts-style-checker-v3-0-03ffacff9226@oss.qualcomm.com?part=1
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v3 1/6] dtc: dt-check-style: Narrow disallowing of tab in DTS only to YAML
2026-07-06 15:59 ` sashiko-bot
@ 2026-07-06 16:00 ` Krzysztof Kozlowski
0 siblings, 0 replies; 14+ messages in thread
From: Krzysztof Kozlowski @ 2026-07-06 16:00 UTC (permalink / raw)
To: sashiko-reviews; +Cc: conor+dt, devicetree, robh
On 06/07/2026 17:59, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [Low] The commit renames the function `check_tab_in_dts` to `check_tab_in_yaml_example` to resolve confusion, but fails to update the user-facing rule name `'tab-in-dts'`. This introduces an inconsistency between the internal function name and the rule string.
> --
>
Ack
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v3 5/6] dtc: dt-check-style: Do not sort top-level nodes in DTS by unit address
2026-07-06 15:53 ` [PATCH v3 5/6] dtc: dt-check-style: Do not sort top-level nodes in DTS by unit address Krzysztof Kozlowski
@ 2026-07-06 16:05 ` sashiko-bot
0 siblings, 0 replies; 14+ messages in thread
From: sashiko-bot @ 2026-07-06 16:05 UTC (permalink / raw)
To: Krzysztof Kozlowski; +Cc: conor+dt, robh, devicetree
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] The checker script inadvertently disables unit address sorting validation for all immediate children of top-level reference nodes.
- [Medium] Top-level nodes with unit addresses are completely excluded from both address-based and name-based sorting checks.
--
commit 52ef4b5728a3b53330c7623fdea74a0e2eddd12d
Author: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
dtc: dt-check-style: Do not sort top-level nodes in DTS by unit address
This commit modifies the dt-check-style script to stop enforcing unit
address sorting for top-level nodes in DTS files. It notes that top-level
nodes with unit addresses are typically sorted by node name instead.
> diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style
> index d9080297bd4db..3c1aa9e28347e 100755
> --- a/scripts/dtc/dt-check-style
> +++ b/scripts/dtc/dt-check-style
> @@ -515,12 +515,18 @@ def _natural_sort_key(s):
>
> def check_child_address_order(ctx):
> """Addressed siblings (foo@N) must appear in ascending address
> - order within their parent node body."""
> + order within their parent node body.
> + Exception: Top-level in DTS follows name order, regardless of unit address
> + in memory@N and soc@N nodes
> + """
> for children in _walk_bodies(ctx.lines):
> addressed = []
> for c in children:
> if c.node_addr is None:
> continue
> + if (ctx.file_type == 'dts') and (c.depth < 2):
> + # Top-level does not use unit address sorting usually
> + continue
[Severity: Medium]
Does this unintentionally disable address-order validation for the vast
majority of peripheral nodes added in board files?
When using top-level reference nodes (e.g., &i2c0 { sensor@50 { ... }; };)
in a .dts or .dtso file, the lexical depth of &i2c0 is 0. This makes the
depth of sensor@50 equal to 1. Since c.depth < 2 is true here, won't this
skip the unit address validation for all immediate children of top-level
references?
[Severity: Medium]
The commit message states that the DTS usually chooses sorting by node
name for the top-level part. However, does this change leave top-level
nodes with unit addresses completely unvalidated?
Looking at check_child_name_order() elsewhere in this script, it explicitly
skips all nodes with a unit address:
scripts/dtc/dt-check-style:check_child_name_order() {
for children in _walk_bodies(ctx.lines):
for c in children:
if c.node_addr is not None:
continue
...
}
Since check_child_name_order() bypasses nodes with unit addresses, and
this new logic skips them in check_child_address_order(), will nodes like
memory@0 and soc@0 bypass both sorting checks?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260706-dts-style-checker-v3-0-03ffacff9226@oss.qualcomm.com?part=5
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v3 4/6] dtc: dt-check-style: Expect first device_type
2026-07-06 15:53 ` [PATCH v3 4/6] dtc: dt-check-style: Expect first device_type Krzysztof Kozlowski
@ 2026-07-06 16:07 ` sashiko-bot
2026-07-06 16:09 ` Krzysztof Kozlowski
0 siblings, 1 reply; 14+ messages in thread
From: sashiko-bot @ 2026-07-06 16:07 UTC (permalink / raw)
To: Krzysztof Kozlowski; +Cc: conor+dt, devicetree, robh
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Docstrings in `dt-check-style` were not fully updated to reflect the new `device_type` canonical order.
--
commit bb6e224694e154bb051ff9fc5122693c0b1a4366
Author: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
dtc: dt-check-style: Expect first device_type
A few nodes do have "device_type" property which is mostly, but not always,
the first property in a device node, when applicable. Adjust the DTS
coding style rules to actually expect the device_type first and improve
the dt-check-style to handle this correctly.
> diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style
> index cf61e92d0568e..d9080297bd4db 100755
> --- a/scripts/dtc/dt-check-style
> +++ b/scripts/dtc/dt-check-style
> @@ -558,28 +558,31 @@ def check_child_name_order(ctx):
>
> def _property_bucket(name):
> """Return the canonical bucket index for a property:
> - 0 compatible
> - 1 reg / reg-names
> - 2 ranges
> - 3 standard properties (no vendor comma in #-stripped name)
> - 4 vendor-specific properties
> - 5 status
> + 0 device_type
> + 1 compatible
> + 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 (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."""
[Severity: Low]
This isn't a bug, but the explanatory text directly below the list wasn't
updated. Should "device_type" also be added to the enumerated list of
fixed slots in the "(compatible, reg, reg-names, ranges, status)" text?
Also, in check_property_order() further down the file, the docstring
describing the overall canonical property order still starts with
"compatible, reg(/reg-names)..." and misses "device_type". Should that
be updated as well?
> stripped = name.lstrip('#')
> - if name == 'compatible':
> + if name == 'device_type':
> return (0, 0)
> - if name == 'reg':
> + if name == 'compatible':
> return (1, 0)
> + if name == 'reg':
> + return (2, 0)
> if name == 'reg-names':
> - return (1, 1)
> + return (2, 1)
> if name == 'ranges':
> - return (2, 0)
> + return (3, 0)
> if name == 'status':
> - return (5, 0)
> - return (4 if ',' in stripped else 3, None)
> + return (6, 0)
> + return (5 if ',' in stripped else 4, None)
>
>
> # Declarative pairing rules: each is a callable
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260706-dts-style-checker-v3-0-03ffacff9226@oss.qualcomm.com?part=4
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v3 4/6] dtc: dt-check-style: Expect first device_type
2026-07-06 16:07 ` sashiko-bot
@ 2026-07-06 16:09 ` Krzysztof Kozlowski
0 siblings, 0 replies; 14+ messages in thread
From: Krzysztof Kozlowski @ 2026-07-06 16:09 UTC (permalink / raw)
To: sashiko-reviews; +Cc: conor+dt, devicetree, robh
On 06/07/2026 18:07, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [Low] Docstrings in `dt-check-style` were not fully updated to reflect the new `device_type` canonical order.
> --
False positive
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v3 6/6] dtc: dt-check-style: Handle properly DTC-style includes
2026-07-06 15:53 ` [PATCH v3 6/6] dtc: dt-check-style: Handle properly DTC-style includes Krzysztof Kozlowski
@ 2026-07-06 16:13 ` sashiko-bot
2026-07-06 16:20 ` Krzysztof Kozlowski
0 siblings, 1 reply; 14+ messages in thread
From: sashiko-bot @ 2026-07-06 16:13 UTC (permalink / raw)
To: Krzysztof Kozlowski; +Cc: devicetree, robh, conor+dt
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The regular expression `re_dtc_directive` fails to match `/include/` directives that omit trailing whitespace before the quoted filename, leaving the original false-positive indent warnings unfixed for such cases.
--
commit d544e9f7ca01b23db8faca49c7b36dba2a77d032
Author: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
dtc: dt-check-style: Handle properly DTC-style includes
This commit updates dt-check-style to properly handle DTC-style include
directives to avoid false positive indent warnings.
> diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style
> index 3c1aa9e28347e..b8ba6dbee86d5 100755
> --- a/scripts/dtc/dt-check-style
> +++ b/scripts/dtc/dt-check-style
> @@ -49,6 +49,9 @@ re_cpp_directive = re.compile(
> r'^#\s*(include|define|undef|ifdef|ifndef|if|else|elif|endif|'
> r'pragma|error|warning)\b')
>
> +re_dtc_directive = re.compile(
> + r'^/(dts-v1|include)/[;\s]')
[Severity: Low]
Does this regular expression miss valid /include/ directives that omit trailing
whitespace before the quoted filename?
If a .dts file contains a directive without a space, such as
/include/"file.dtsi", it is not matched by re_dtc_directive because it lacks a
space or semicolon. This could cause the script to treat it as an incomplete
property, bypassing the brace depth tracking and triggering the exact false
positive this patch aims to fix.
Should the character class be expanded to include double quotes, such as
[;\s"]?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260706-dts-style-checker-v3-0-03ffacff9226@oss.qualcomm.com?part=6
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v3 6/6] dtc: dt-check-style: Handle properly DTC-style includes
2026-07-06 16:13 ` sashiko-bot
@ 2026-07-06 16:20 ` Krzysztof Kozlowski
0 siblings, 0 replies; 14+ messages in thread
From: Krzysztof Kozlowski @ 2026-07-06 16:20 UTC (permalink / raw)
To: sashiko-reviews; +Cc: devicetree, robh, conor+dt
On 06/07/2026 18:13, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [Low] The regular expression `re_dtc_directive` fails to match `/include/` directives that omit trailing whitespace before the quoted filename, leaving the original false-positive indent warnings unfixed for such cases.
> --
>
Ack
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2026-07-06 16:20 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-06 15:53 [PATCH v3 0/6] dtc: dt-check-style: Improvement after using on DTS Krzysztof Kozlowski
2026-07-06 15:53 ` [PATCH v3 1/6] dtc: dt-check-style: Narrow disallowing of tab in DTS only to YAML Krzysztof Kozlowski
2026-07-06 15:59 ` sashiko-bot
2026-07-06 16:00 ` Krzysztof Kozlowski
2026-07-06 15:53 ` [PATCH v3 2/6] dtc: dt-check-style: Allow space-aligning indentation in DTS Krzysztof Kozlowski
2026-07-06 15:53 ` [PATCH v3 3/6] dtc: dt-check-style: Rework handling YAML/DTS in rules Krzysztof Kozlowski
2026-07-06 15:53 ` [PATCH v3 4/6] dtc: dt-check-style: Expect first device_type Krzysztof Kozlowski
2026-07-06 16:07 ` sashiko-bot
2026-07-06 16:09 ` Krzysztof Kozlowski
2026-07-06 15:53 ` [PATCH v3 5/6] dtc: dt-check-style: Do not sort top-level nodes in DTS by unit address Krzysztof Kozlowski
2026-07-06 16:05 ` sashiko-bot
2026-07-06 15:53 ` [PATCH v3 6/6] dtc: dt-check-style: Handle properly DTC-style includes Krzysztof Kozlowski
2026-07-06 16:13 ` sashiko-bot
2026-07-06 16:20 ` Krzysztof Kozlowski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox