Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

rv/rvgen: fix PEP 8 whitespace violations

Fix whitespace violations throughout the rvgen codebase to comply
with PEP 8 style guidelines. The changes address missing whitespace
after commas, around operators, and in collection literals that
were flagged by pycodestyle.

The fixes include adding whitespace after commas in string replace
chains and function arguments, adding whitespace around arithmetic
operators, removing extra whitespace in list comprehensions, and
fixing dictionary literal spacing. These changes improve code
readability and consistency with Python coding standards.

Signed-off-by: Wander Lairson Costa <wander@redhat.com>
Reviewed-by: Gabriele Monaco <gmonaco@redhat.com>
Reviewed-by: Nam Cao <namcao@linutronix.de>
Link: https://lore.kernel.org/r/20260223162407.147003-9-wander@redhat.com
Signed-off-by: Gabriele Monaco <gmonaco@redhat.com>

authored by

Wander Lairson Costa and committed by
Gabriele Monaco
0d5c9f10 76ad28af

+8 -8
+4 -4
tools/verification/rvgen/rvgen/automata.py
··· 135 135 raw_state = line[-1] 136 136 137 137 # "enabled_fired"}; -> enabled_fired 138 - state = raw_state.replace('"', '').replace('};', '').replace(',','_') 138 + state = raw_state.replace('"', '').replace('};', '').replace(',', '_') 139 139 if state[0:7] == "__init_": 140 140 initial_state = state[7:] 141 141 else: ··· 264 264 nr_state += 1 265 265 266 266 # declare the matrix.... 267 - matrix = [[ self.invalid_state_str for x in range(nr_event)] for y in range(nr_state)] 267 + matrix = [[self.invalid_state_str for x in range(nr_event)] for y in range(nr_state)] 268 268 constraints: dict[_ConstraintKey, list[str]] = {} 269 269 270 270 # and we are back! Let's fill the matrix ··· 273 273 while self.__dot_lines[cursor].lstrip()[0] == '"': 274 274 if self.__dot_lines[cursor].split()[1] == "->": 275 275 line = self.__dot_lines[cursor].split() 276 - origin_state = line[0].replace('"','').replace(',','_') 277 - dest_state = line[2].replace('"','').replace(',','_') 276 + origin_state = line[0].replace('"', '').replace(',', '_') 277 + dest_state = line[2].replace('"', '').replace(',', '_') 278 278 possible_events = "".join(line[line.index("label") + 2:-1]).replace('"', '') 279 279 for event in possible_events.split("\\n"): 280 280 event, *constr = event.split(";")
+1 -1
tools/verification/rvgen/rvgen/dot2c.py
··· 182 182 line += f"\t\t\t{next_state}" 183 183 else: 184 184 line += f"{next_state:>{maxlen}}" 185 - if y != nr_events-1: 185 + if y != nr_events - 1: 186 186 line += ",\n" if linetoolong else ", " 187 187 else: 188 188 line += ",\n\t\t}," if linetoolong else " },"
+2 -2
tools/verification/rvgen/rvgen/dot2k.py
··· 134 134 tp_args = tp_args_dict[tp_type] 135 135 if self._is_id_monitor(): 136 136 tp_args.insert(0, tp_args_id) 137 - tp_proto_c = ", ".join([a+b for a,b in tp_args]) 138 - tp_args_c = ", ".join([b for a,b in tp_args]) 137 + tp_proto_c = ", ".join([a + b for a, b in tp_args]) 138 + tp_args_c = ", ".join([b for a, b in tp_args]) 139 139 buff.append(f" TP_PROTO({tp_proto_c}),") 140 140 buff.append(f" TP_ARGS({tp_args_c})") 141 141 return '\n'.join(buff)
+1 -1
tools/verification/rvgen/rvgen/generator.py
··· 228 228 229 229 230 230 class Monitor(RVGenerator): 231 - monitor_types = { "global" : 1, "per_cpu" : 2, "per_task" : 3, "per_obj" : 4 } 231 + monitor_types = {"global": 1, "per_cpu": 2, "per_task": 3, "per_obj": 4} 232 232 233 233 def __init__(self, extra_params={}): 234 234 super().__init__(extra_params)