qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] tweak lookup_feature() in target-i386/cpu.c
@ 2013-03-30  2:01 Michael W. Bombardieri
  2013-04-01 12:13 ` Igor Mammedov
  0 siblings, 1 reply; 2+ messages in thread
From: Michael W. Bombardieri @ 2013-03-30  2:01 UTC (permalink / raw)
  To: qemu-devel

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,

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-04-01 12:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-30  2:01 [Qemu-devel] [PATCH] tweak lookup_feature() in target-i386/cpu.c Michael W. Bombardieri
2013-04-01 12:13 ` Igor Mammedov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).