From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:58920) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TBWPF-0007Wp-HK for qemu-devel@nongnu.org; Tue, 11 Sep 2012 15:45:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TBWPE-0007D0-LM for qemu-devel@nongnu.org; Tue, 11 Sep 2012 15:45:57 -0400 Received: from hub021-nj-8.exch021.serverdata.net ([206.225.164.233]:9917) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TBWPE-0007Cw-Gv for qemu-devel@nongnu.org; Tue, 11 Sep 2012 15:45:56 -0400 Message-ID: <504F94F3.6090609@CloudSwitch.Com> Date: Tue, 11 Sep 2012 15:45:55 -0400 From: Don Slutz MIME-Version: 1.0 References: <1346877673-9136-1-git-send-email-ehabkost@redhat.com> <1346877673-9136-7-git-send-email-ehabkost@redhat.com> In-Reply-To: <1346877673-9136-7-git-send-email-ehabkost@redhat.com> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 6/7] x86_cpudef_setup: coding style change List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost Cc: Peter Maydell , Igor Mammedov , qemu-devel@nongnu.org, Anthony Liguori , =?ISO-8859-1?Q?Andreas_F=E4rber?= On 09/05/12 16:41, Eduardo Habkost wrote: > Make source code lines shorter. > > Signed-off-by: Eduardo Habkost > --- > 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