Thread (95 messages) 95 messages, 3 authors, 2026-01-23

[PATCH 05/26] rv/rvgen: remove unnecessary semicolons

flat view
STALE262d SUPERSEDED

From: Wander Lairson Costa <hidden>
Date: 2026-01-19 21:00:45
Also in: lkml
Subsystem: runtime verification (rv), the rest · Maintainers: Steven Rostedt, Gabriele Monaco, Linus Torvalds

Revision v1 of 3 in this series.

Revisions (3)
  1. v1 current
  2. v2 [diff vs current]
  3. v3 [diff vs current]
Remove unnecessary semicolons from Python code in the rvgen tool.
Python does not require semicolons to terminate statements, and
their presence goes against PEP 8 style guidelines. These semicolons
were likely added out of habit from C-style languages.

The changes affect four instances across two files. In dot2c.py, one
semicolon is removed from a boolean assignment. In dot2k.py, three
semicolons are removed from string append operations that build
generated C code. Note that the semicolons inside the string literals
themselves are correctly preserved as they are part of the C code
being generated, not Python syntax.

This cleanup improves consistency with Python coding standards and
aligns with the recent improvements to remove other Python
anti-patterns from the codebase.

Signed-off-by: Wander Lairson Costa <redacted>
---
 tools/verification/rvgen/rvgen/dot2c.py | 2 +-
 tools/verification/rvgen/rvgen/dot2k.py | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/tools/verification/rvgen/rvgen/dot2c.py b/tools/verification/rvgen/rvgen/dot2c.py
index 0fb3617ad8ce9..b9a2c009a9246 100644
--- a/tools/verification/rvgen/rvgen/dot2c.py
+++ b/tools/verification/rvgen/rvgen/dot2c.py
@@ -120,7 +120,7 @@ class Dot2c(Automata):
         for entry in buff:
             if first:
                 string = string + "\t\t\"" + entry
-                first = False;
+                first = False
             else:
                 string = string + "\",\n\t\t\"" + entry
         string = string + "\""
diff --git a/tools/verification/rvgen/rvgen/dot2k.py b/tools/verification/rvgen/rvgen/dot2k.py
index 1c0d0235bdf62..291385adb2c20 100644
--- a/tools/verification/rvgen/rvgen/dot2k.py
+++ b/tools/verification/rvgen/rvgen/dot2k.py
@@ -37,10 +37,10 @@ class dot2k(Monitor, Dot2c):
                 buff.append("\t/* XXX: validate that this event is only valid in the initial state */")
                 handle = "handle_start_run_event"
             if self.monitor_type == "per_task":
-                buff.append("\tstruct task_struct *p = /* XXX: how do I get p? */;");
-                buff.append(f"\tda_{handle}_{self.name}(p, {event}{self.enum_suffix});");
+                buff.append("\tstruct task_struct *p = /* XXX: how do I get p? */;")
+                buff.append(f"\tda_{handle}_{self.name}(p, {event}{self.enum_suffix});")
             else:
-                buff.append(f"\tda_{handle}_{self.name}({event}{self.enum_suffix});");
+                buff.append(f"\tda_{handle}_{self.name}({event}{self.enum_suffix});")
             buff.append("}")
             buff.append("")
         return '\n'.join(buff)
-- 
2.52.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help