aboutsummaryrefslogtreecommitdiff
path: root/scripts/qapi-commands.py
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2015-07-31 18:51:18 +0200
committerMarkus Armbruster <armbru@redhat.com>2015-09-04 15:47:15 +0200
commit3f99144cd9afbf51a7fbddf20b921402c2d4f68c (patch)
tree8cd6255d70fcd406366a8402e6b537e2440d72e5 /scripts/qapi-commands.py
parent1f9a7a1a5862ad224aa86f9b4c046248ffc27aa3 (diff)
qapi-commands: Drop useless initialization
In generated command handlers, the assignment to retval dominates its only use. Therefore, its initialization is useless. Drop it. Suggested-by: Eric Blake <eblake@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'scripts/qapi-commands.py')
-rw-r--r--scripts/qapi-commands.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/scripts/qapi-commands.py b/scripts/qapi-commands.py
index cfbd59c84e..8bf84a77dd 100644
--- a/scripts/qapi-commands.py
+++ b/scripts/qapi-commands.py
@@ -205,14 +205,10 @@ def gen_marshal_input(name, args, ret_type, middle_mode):
header=hdr)
if ret_type:
- if is_c_ptr(ret_type):
- retval = " %s retval = NULL;" % c_type(ret_type)
- else:
- retval = " %s retval;" % c_type(ret_type)
ret += mcgen('''
-%(retval)s
+ %(c_type)s retval;
''',
- retval=retval)
+ c_type=c_type(ret_type))
if len(args) > 0:
ret += gen_visitor_input_containers_decl(args)