mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-08-18 13:52:13 +00:00
verification/rvgen: Generate each variable definition only once
If a variable appears multiple times in the specification, ltl2k generates multiple variable definitions. This fails the build. Make sure each variable is only defined once. Cc: Masami Hiramatsu <mhiramat@kernel.org> Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Cc: Gabriele Monaco <gmonaco@redhat.com> Link: https://lore.kernel.org/107dcf0d0aa8482d5fbe0314c3138f61cd284e91.1752850449.git.namcao@linutronix.de Signed-off-by: Nam Cao <namcao@linutronix.de> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
This commit is contained in:
parent
8cfcf9b0e9
commit
6fb37c2a27
@ -112,14 +112,16 @@ class ltl2k(generator.Monitor):
|
||||
if node.op.is_temporal():
|
||||
continue
|
||||
|
||||
if isinstance(node.op, ltl2ba.Variable):
|
||||
buf.append("\tbool %s = test_bit(LTL_%s, mon->atoms);" % (node, node.op.name))
|
||||
elif isinstance(node.op, ltl2ba.AndOp):
|
||||
if isinstance(node.op, ltl2ba.AndOp):
|
||||
buf.append("\tbool %s = %s && %s;" % (node, node.op.left, node.op.right))
|
||||
elif isinstance(node.op, ltl2ba.OrOp):
|
||||
buf.append("\tbool %s = %s || %s;" % (node, node.op.left, node.op.right))
|
||||
elif isinstance(node.op, ltl2ba.NotOp):
|
||||
buf.append("\tbool %s = !%s;" % (node, node.op.child))
|
||||
|
||||
for atom in self.atoms:
|
||||
buf.append("\tbool %s = test_bit(LTL_%s, mon->atoms);" % (atom.lower(), atom))
|
||||
|
||||
buf.reverse()
|
||||
|
||||
buf2 = []
|
||||
|
Loading…
Reference in New Issue
Block a user