Commit 3f99144c authored by Markus Armbruster's avatar Markus Armbruster
Browse files

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: default avatarEric Blake <eblake@redhat.com>
Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
Reviewed-by: default avatarEric Blake <eblake@redhat.com>
parent 1f9a7a1a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -742,7 +742,7 @@ Example:
    static void qmp_marshal_input_my_command(QDict *args, QObject **ret, Error **errp)
    {
        Error *local_err = NULL;
        UserDefOne *retval = NULL;
        UserDefOne *retval;
        QmpInputVisitor *mi = qmp_input_visitor_new_strict(QOBJECT(args));
        QapiDeallocVisitor *md;
        Visitor *v;
+2 −6
Original line number Diff line number Diff line
@@ -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)