From: Igor Mammedov <imammedo@redhat.com>
To: "Michael W. Bombardieri" <mb@ii.net>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] tweak lookup_feature() in target-i386/cpu.c
Date: Mon, 1 Apr 2013 14:13:59 +0200 [thread overview]
Message-ID: <20130401141359.3aa202b4@thinkpad.mammed.net> (raw)
In-Reply-To: <20130330020121.GA32412@bom.nom.co>
On Sat, 30 Mar 2013 10:01:21 +0800
"Michael W. Bombardieri" <mb@ii.net> 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
prev parent reply other threads:[~2013-04-01 12:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
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 message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130401141359.3aa202b4@thinkpad.mammed.net \
--to=imammedo@redhat.com \
--cc=mb@ii.net \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).