From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:60968) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UMdct-0003Yk-4u for qemu-devel@nongnu.org; Mon, 01 Apr 2013 08:14:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UMdck-0004RV-HG for qemu-devel@nongnu.org; Mon, 01 Apr 2013 08:14:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:16527) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UMdck-0004RJ-9F for qemu-devel@nongnu.org; Mon, 01 Apr 2013 08:14:06 -0400 Date: Mon, 1 Apr 2013 14:13:59 +0200 From: Igor Mammedov Message-ID: <20130401141359.3aa202b4@thinkpad.mammed.net> In-Reply-To: <20130330020121.GA32412@bom.nom.co> References: <20130330020121.GA32412@bom.nom.co> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] tweak lookup_feature() in target-i386/cpu.c List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael W. Bombardieri" Cc: qemu-devel@nongnu.org On Sat, 30 Mar 2013 10:01:21 +0800 "Michael W. Bombardieri" wrote: > Hi, > > The following patch removes variable 'found' from lookup_feature(). > We can just return true/false (found/not found) directly. > Does this look OK? We are aiming to remove lookup_feature() and related feature tables, so touching it without adding/fixing something looks like unnecessary code movement. > > - Michael > > > diff --git a/target-i386/cpu.c b/target-i386/cpu.c > index a0640db..9147aaf 100644 > --- a/target-i386/cpu.c > +++ b/target-i386/cpu.c > @@ -319,15 +319,14 @@ static bool lookup_feature(uint32_t *pval, const char *s, const char *e, > { > uint32_t mask; > const char **ppc; > - bool found = false; > > for (mask = 1, ppc = featureset; mask; mask <<= 1, ++ppc) { > if (*ppc && !altcmp(s, e, *ppc)) { > *pval |= mask; > - found = true; > + return true; > } > } > - return found; > + return false; > } > > static void add_flagname_to_bitmaps(const char *flagname, > -- Regards, Igor