aboutsummaryrefslogtreecommitdiff
path: root/tools/verification
diff options
context:
space:
mode:
Diffstat (limited to 'tools/verification')
-rw-r--r--tools/verification/dot2/automata.py18
-rw-r--r--tools/verification/rv/src/in_kernel.c4
-rw-r--r--tools/verification/rv/src/trace.c2
3 files changed, 12 insertions, 12 deletions
diff --git a/tools/verification/dot2/automata.py b/tools/verification/dot2/automata.py
index baffeb960ff0..bdeb98baa8b0 100644
--- a/tools/verification/dot2/automata.py
+++ b/tools/verification/dot2/automata.py
@@ -29,11 +29,11 @@ class Automata:
def __get_model_name(self):
basename = ntpath.basename(self.__dot_path)
- if basename.endswith(".dot") == False:
+ if not basename.endswith(".dot") and not basename.endswith(".gv"):
print("not a dot file")
raise Exception("not a dot file: %s" % self.__dot_path)
- model_name = basename[0:-4]
+ model_name = ntpath.splitext(basename)[0]
if model_name.__len__() == 0:
raise Exception("not a dot file: %s" % self.__dot_path)
@@ -68,9 +68,9 @@ class Automata:
def __get_cursor_begin_events(self):
cursor = 0
while self.__dot_lines[cursor].split()[0] != "{node":
- cursor += 1
+ cursor += 1
while self.__dot_lines[cursor].split()[0] == "{node":
- cursor += 1
+ cursor += 1
# skip initial state transition
cursor += 1
return cursor
@@ -94,11 +94,11 @@ class Automata:
initial_state = state[7:]
else:
states.append(state)
- if self.__dot_lines[cursor].__contains__("doublecircle") == True:
+ if "doublecircle" in self.__dot_lines[cursor]:
final_states.append(state)
has_final_states = True
- if self.__dot_lines[cursor].__contains__("ellipse") == True:
+ if "ellipse" in self.__dot_lines[cursor]:
final_states.append(state)
has_final_states = True
@@ -110,7 +110,7 @@ class Automata:
# Insert the initial state at the bein og the states
states.insert(0, initial_state)
- if has_final_states == False:
+ if not has_final_states:
final_states.append(initial_state)
return states, initial_state, final_states
@@ -120,7 +120,7 @@ class Automata:
cursor = self.__get_cursor_begin_events()
events = []
- while self.__dot_lines[cursor][1] == '"':
+ while self.__dot_lines[cursor].lstrip()[0] == '"':
# transitions have the format:
# "all_fired" -> "both_fired" [ label = "disable_irq" ];
# ------------ event is here ------------^^^^^
@@ -161,7 +161,7 @@ class Automata:
# and we are back! Let's fill the matrix
cursor = self.__get_cursor_begin_events()
- while self.__dot_lines[cursor][1] == '"':
+ while self.__dot_lines[cursor].lstrip()[0] == '"':
if self.__dot_lines[cursor].split()[1] == "->":
line = self.__dot_lines[cursor].split()
origin_state = line[0].replace('"','').replace(',','_')
diff --git a/tools/verification/rv/src/in_kernel.c b/tools/verification/rv/src/in_kernel.c
index f04479ecc96c..f2bbc75a76f4 100644
--- a/tools/verification/rv/src/in_kernel.c
+++ b/tools/verification/rv/src/in_kernel.c
@@ -332,7 +332,7 @@ static void ikm_print_header(struct trace_seq *s)
* ikm_event_handler - callback to handle event events
*
* Called any time a rv:"monitor"_event events is generated.
- * It parses and print event.
+ * It parses and prints event.
*/
static int
ikm_event_handler(struct trace_seq *s, struct tep_record *record,
@@ -384,7 +384,7 @@ ikm_event_handler(struct trace_seq *s, struct tep_record *record,
* ikm_error_handler - callback to handle error events
*
* Called any time a rv:"monitor"_errors events is generated.
- * It parses and print event.
+ * It parses and prints event.
*/
static int
ikm_error_handler(struct trace_seq *s, struct tep_record *record,
diff --git a/tools/verification/rv/src/trace.c b/tools/verification/rv/src/trace.c
index 2c7deed47f8d..1b9f9bfa1893 100644
--- a/tools/verification/rv/src/trace.c
+++ b/tools/verification/rv/src/trace.c
@@ -81,7 +81,7 @@ void trace_instance_destroy(struct trace_instance *trace)
}
/**
- * trace_instance_init - create an trace instance
+ * trace_instance_init - create a trace instance
*
* It is more than the tracefs instance, as it contains other
* things required for the tracing, such as the local events and