Devicetree
 help / color / mirror / Atom feed
* [PATCH 1/3] dtc: dt-check-style: Right strip whitespaces, leftovers before comments
@ 2026-09-06 18:04 Krzysztof Kozlowski
  2026-09-06 18:04 ` [PATCH 2/3] dtc: dt-check-style: Properly detect comments in multi-line properties Krzysztof Kozlowski
  2026-09-06 18:04 ` [PATCH 3/3] dtc: dt-check-style: Consistently pass same content as stripped line Krzysztof Kozlowski
  0 siblings, 2 replies; 7+ messages in thread
From: Krzysztof Kozlowski @ 2026-09-06 18:04 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Saravana Kannan,
	devicetree, linux-kernel
  Cc: 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 15a3ba82fd5f..dfa9d3687852 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 related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-09-09  8:33 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-06 18:04 [PATCH 1/3] dtc: dt-check-style: Right strip whitespaces, leftovers before comments Krzysztof Kozlowski
2026-09-06 18:04 ` [PATCH 2/3] dtc: dt-check-style: Properly detect comments in multi-line properties Krzysztof Kozlowski
2026-09-06 18:15   ` sashiko-bot
2026-09-09  7:59     ` Krzysztof Kozlowski
2026-09-06 18:04 ` [PATCH 3/3] dtc: dt-check-style: Consistently pass same content as stripped line Krzysztof Kozlowski
2026-09-06 18:13   ` sashiko-bot
2026-09-09  8:33     ` Krzysztof Kozlowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox