qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Don Slutz <Don@CloudSwitch.Com>
To: Eduardo Habkost <ehabkost@redhat.com>
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	"Igor Mammedov" <imammedo@redhat.com>,
	qemu-devel@nongnu.org, "Anthony Liguori" <anthony@codemonkey.ws>,
	"Andreas Färber" <afaerber@suse.de>
Subject: Re: [Qemu-devel] [PATCH 6/7] x86_cpudef_setup: coding style change
Date: Tue, 11 Sep 2012 15:45:55 -0400	[thread overview]
Message-ID: <504F94F3.6090609@CloudSwitch.Com> (raw)
In-Reply-To: <1346877673-9136-7-git-send-email-ehabkost@redhat.com>

On 09/05/12 16:41, Eduardo Habkost wrote:
> Make source code lines shorter.
>
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> ---
>   target-i386/cpu.c | 15 +++++++++------
>   1 file changed, 9 insertions(+), 6 deletions(-)
>
> diff --git a/target-i386/cpu.c b/target-i386/cpu.c
> index 73302d8..e13e6d5 100644
> --- a/target-i386/cpu.c
> +++ b/target-i386/cpu.c
> @@ -1513,20 +1513,23 @@ void x86_cpudef_setup(void)
>       static const char *model_with_versions[] = { "qemu32", "qemu64", "athlon" };
>   
>       for (i = 0; i < ARRAY_SIZE(builtin_x86_defs); ++i) {
> -        builtin_x86_defs[i].next = x86_defs;
> -        builtin_x86_defs[i].flags = 1;
> +        x86_def_t *def = &builtin_x86_defs[i];
> +        def->next = x86_defs;
> +        def->flags = 1;
>   
>           /* Look for specific "cpudef" models that */
>           /* have the QEMU version in .model_id */
>           for (j = 0; j < ARRAY_SIZE(model_with_versions); j++) {
> -            if (strcmp(model_with_versions[j], builtin_x86_defs[i].name) == 0) {
> -                pstrcpy(builtin_x86_defs[i].model_id, sizeof(builtin_x86_defs[i].model_id), "QEMU Virtual CPU version ");
> -                pstrcat(builtin_x86_defs[i].model_id, sizeof(builtin_x86_defs[i].model_id), qemu_get_version());
> +            if (strcmp(model_with_versions[j], def->name) == 0) {
> +                pstrcpy(def->model_id, sizeof(def->model_id),
> +                        "QEMU Virtual CPU version ");
> +                pstrcat(def->model_id, sizeof(def->model_id),
> +                        qemu_get_version());
>                   break;
>               }
>           }
>   
> -        x86_defs = &builtin_x86_defs[i];
> +        x86_defs = def;
>       }
>   #if !defined(CONFIG_USER_ONLY)
>       qemu_opts_foreach(qemu_find_opts("cpudef"), cpudef_register, NULL, 0);
Reviewed-by: Don Slutz <Don@CloudSwitch.com>

  reply	other threads:[~2012-09-11 19:45 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-05 20:41 [Qemu-devel] [PATCH 0/7] x86 CPU patches that didn't get into 1.2 Eduardo Habkost
2012-09-05 20:41 ` [Qemu-devel] [PATCH 1/7] target-i386: Fold -cpu ?cpuid, ?model output into -cpu help, drop ?dump Eduardo Habkost
2012-09-10  9:40   ` Igor Mammedov
2012-09-05 20:41 ` [Qemu-devel] [PATCH 2/7] Drop cpu_list_id macro Eduardo Habkost
2012-09-10  9:46   ` Igor Mammedov
2012-09-05 20:41 ` [Qemu-devel] [PATCH 3/7] i386: add missing CPUID_* constants Eduardo Habkost
2012-09-10  9:57   ` Igor Mammedov
2012-09-05 20:41 ` [Qemu-devel] [PATCH 4/7] move CPU models from cpus-x86_64.conf to C Eduardo Habkost
2012-09-10 12:18   ` Igor Mammedov
2012-09-10 12:31     ` Igor Mammedov
2012-09-10 13:04       ` Igor Mammedov
2012-09-10 14:50         ` Don Slutz
2012-09-10 14:58           ` Andreas Färber
2012-09-10 15:07             ` Eduardo Habkost
2012-09-10 15:13               ` Andreas Färber
2012-09-10 15:04         ` Eduardo Habkost
2012-09-10 13:40   ` Igor Mammedov
2012-09-11 19:45     ` Don Slutz
2012-09-05 20:41 ` [Qemu-devel] [PATCH 5/7] eliminate cpus-x86_64.conf file Eduardo Habkost
2012-09-10 13:46   ` Igor Mammedov
2012-09-05 20:41 ` [Qemu-devel] [PATCH 6/7] x86_cpudef_setup: coding style change Eduardo Habkost
2012-09-11 19:45   ` Don Slutz [this message]
2012-09-05 20:41 ` [Qemu-devel] [PATCH 7/7] i386: kill cpudef config section support Eduardo Habkost
2012-09-10 14:20   ` Igor Mammedov
2012-09-10 15:17 ` [Qemu-devel] [PATCH 0/7] x86 CPU patches that didn't get into 1.2 Andreas Färber
2012-09-10 15:30   ` Igor Mammedov
2012-09-10 15:46   ` [Qemu-devel] CPU code roadmap (was Re: [PATCH 0/7] x86 CPU patches that didn't get into 1.2) Eduardo Habkost
2012-09-11 14:59     ` Eduardo Habkost
2012-09-17 17:29 ` [Qemu-devel] [PATCH 0/7] x86 CPU patches that didn't get into 1.2 Andreas Färber

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=504F94F3.6090609@CloudSwitch.Com \
    --to=don@cloudswitch.com \
    --cc=afaerber@suse.de \
    --cc=anthony@codemonkey.ws \
    --cc=ehabkost@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=peter.maydell@linaro.org \
    --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).