From patchwork Fri Aug 3 02:59:09 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 174861 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 27A9C2C0094 for ; Fri, 3 Aug 2012 13:44:34 +1000 (EST) Received: from localhost ([::1]:58736 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sx8DZ-00056N-8I for incoming@patchwork.ozlabs.org; Thu, 02 Aug 2012 23:06:25 -0400 Received: from eggs.gnu.org ([208.118.235.92]:37857) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sx8DG-0004mi-9m for qemu-devel@nongnu.org; Thu, 02 Aug 2012 23:06:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sx8DB-000694-UT for qemu-devel@nongnu.org; Thu, 02 Aug 2012 23:06:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56045) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sx8DB-00067g-LN for qemu-devel@nongnu.org; Thu, 02 Aug 2012 23:06:01 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q73361Se001761 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 2 Aug 2012 23:06:01 -0400 Received: from blackpad.lan.raisama.net (vpn1-5-140.gru2.redhat.com [10.97.5.140]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q7335xqJ027338; Thu, 2 Aug 2012 23:06:00 -0400 Received: by blackpad.lan.raisama.net (Postfix, from userid 500) id 52ABC200542; Thu, 2 Aug 2012 23:59:31 -0300 (BRT) From: Eduardo Habkost To: qemu-devel@nongnu.org Date: Thu, 2 Aug 2012 23:59:09 -0300 Message-Id: <1343962766-22024-3-git-send-email-ehabkost@redhat.com> In-Reply-To: <1343962766-22024-1-git-send-email-ehabkost@redhat.com> References: <1343962766-22024-1-git-send-email-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: Igor Mammedov , =?UTF-8?q?Andreas=20F=C3=A4rber?= Subject: [Qemu-devel] [RFC 02/19] x86_cpudef_setup: coding style change X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 9414d75..d546534 100644 --- a/target-i386/cpu.c +++ b/target-i386/cpu.c @@ -1526,20 +1526,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);