From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48447) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cAHqR-0002Z4-S1 for qemu-devel@nongnu.org; Fri, 25 Nov 2016 09:51:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cAHqN-00055V-Ma for qemu-devel@nongnu.org; Fri, 25 Nov 2016 09:51:19 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50292) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cAHqN-00054d-Dz for qemu-devel@nongnu.org; Fri, 25 Nov 2016 09:51:15 -0500 From: Markus Armbruster References: <1475261386-20211-1-git-send-email-ehabkost@redhat.com> <1475261386-20211-6-git-send-email-ehabkost@redhat.com> Date: Fri, 25 Nov 2016 15:51:11 +0100 In-Reply-To: <1475261386-20211-6-git-send-email-ehabkost@redhat.com> (Eduardo Habkost's message of "Fri, 30 Sep 2016 15:49:39 -0300") Message-ID: <871sxzbokg.fsf@dusky.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v5 05/12] target-i386: Make plus_features/minus_features QOM-based List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost Cc: qemu-devel@nongnu.org, libvir-list@redhat.com, dahi@linux.vnet.ibm.com, Paolo Bonzini , Igor Mammedov , Jiri Denemark , Richard Henderson Eduardo Habkost writes: > Instead of using custom feature name lookup code for > plus_features/minus_features, save the property names used in > "[+-]feature" and use object_property_set_bool() to set them. > > We don't need a feat2prop() call because we now have alias > properties for the old names containing underscores. > > Signed-off-by: Eduardo Habkost > --- > Changes v4 -> v5: > * Removed feat2prop() call, as we now have property aliases for > the old names containing underscores > > Changes series v3 -> v4: > * New patch added to series > --- > target-i386/cpu.c | 106 +++++++++++------------------------------------------- > 1 file changed, 20 insertions(+), 86 deletions(-) > > diff --git a/target-i386/cpu.c b/target-i386/cpu.c > index 6b5bf59..cef4ecd 100644 > --- a/target-i386/cpu.c > +++ b/target-i386/cpu.c [...] > @@ -2047,10 +1967,12 @@ static void x86_cpu_parse_featurestr(const char *typename, char *features, > > /* Compatibility syntax: */ > if (featurestr[0] == '+') { > - add_flagname_to_bitmaps(featurestr + 1, plus_features, &local_err); > + plus_features = g_list_append(plus_features, > + g_strdup(featurestr + 1)); > continue; > } else if (featurestr[0] == '-') { > - add_flagname_to_bitmaps(featurestr + 1, minus_features, &local_err); > + minus_features = g_list_append(minus_features, > + g_strdup(featurestr + 1)); > continue; > } > Since removes the only assignments to local_err other than its initialization to null, it can't become non-null anymore. Coverity points out: *** CID 1365201: Possible Control flow issues (DEADCODE) /target-i386/cpu.c: 2050 in x86_cpu_parse_featurestr() 2044 prop->value = g_strdup(val); 2045 prop->errp = &error_fatal; 2046 qdev_prop_register_global(prop); 2047 } 2048 2049 if (local_err) { >>> CID 1365201: Possible Control flow issues (DEADCODE) >>> Execution cannot reach this statement: "error_propagate(errp, local...". 2050 error_propagate(errp, local_err); 2051 } 2052 } 2053 2054 static void x86_cpu_load_features(X86CPU *cpu, Error **errp); 2055 static int x86_cpu_filter_features(X86CPU *cpu); [...] Please clean this up.