Received: from eggs.gnu.org ([208.118.235.92]:43831) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULl8r-00035G-0d for qemu-devel@nongnu.org; Fri, 29 Mar 2013 22:03:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ULl8n-0004LI-Ck for qemu-devel@nongnu.org; Fri, 29 Mar 2013 22:03:36 -0400 Received: from [203.217.0.115] (port=27177 helo=bom.nom.co) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULl8m-0004Kv-NN for qemu-devel@nongnu.org; Fri, 29 Mar 2013 22:03:33 -0400 Received: from bom.nom.co (mwb@localhost [127.0.0.1]) by bom.nom.co (8.14.5/8.14.3) with ESMTP id r2U21M6g002342 for ; Sat, 30 Mar 2013 10:01:24 +0800 (WST) Received: (from mwb@localhost) by bom.nom.co (8.14.5/8.14.3/Submit) id r2U21LVc003107 for qemu-devel@nongnu.org; Sat, 30 Mar 2013 10:01:21 +0800 (WST) Date: Sat, 30 Mar 2013 10:01:21 +0800 From: "Michael W. Bombardieri" Message-ID: <20130330020121.GA32412@bom.nom.co> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: [Qemu-devel] [PATCH] tweak lookup_feature() in target-i386/cpu.c List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Hi, The following patch removes variable 'found' from lookup_feature(). We can just return true/false (found/not found) directly. Does this look OK? - 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,