From patchwork Tue Apr 8 12:05:01 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen Gang X-Patchwork-Id: 337637 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 004D7140096 for ; Tue, 8 Apr 2014 22:06:09 +1000 (EST) Received: from localhost ([::1]:39839 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WXUn0-0000mX-L4 for incoming@patchwork.ozlabs.org; Tue, 08 Apr 2014 08:06:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54393) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WXUmZ-0000Y8-4b for qemu-devel@nongnu.org; Tue, 08 Apr 2014 08:05:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WXUmP-00058g-Vp for qemu-devel@nongnu.org; Tue, 08 Apr 2014 08:05:39 -0400 Received: from mail-pb0-x230.google.com ([2607:f8b0:400e:c01::230]:50394) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WXUm7-0004sT-NU; Tue, 08 Apr 2014 08:05:11 -0400 Received: by mail-pb0-f48.google.com with SMTP id md12so937753pbc.35 for ; Tue, 08 Apr 2014 05:05:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=HuYuKbNwwzHBg70l/241FyA6+0zN1qaTKzTqBWRBASc=; b=EypmrFN5T7GI+lRtpAVTKtICxQXjzWMzWg+N5vM/jZBmIujfokEK/QC6xQDks3XwR2 56DsN0xVYDBgvYkUkel5K7nP6owL4aBsBnjWPJug+J+r8lyzgok6sg+YzsQ0xayIf2wT Rkh1rJIQQ7OEO/4Fi75QxNOn7PSFKq4IwmqxtV9c2RjjihIzFx1Ec6p/tCjLrxPDsQ90 eQ2YaYP2qt+YBz9flfzEFHgSDXypIXWJVHbgEPw/DFzEdLE/iSDlcDcq8PZJBQOTYB7i RyZWD+Oke0pmgBwArJzeWM3tz2ADe9GEYniVJIwtLDw+q+KqNlN7IlPiPPk2bf0czYKn annQ== X-Received: by 10.68.100.1 with SMTP id eu1mr4218583pbb.36.1396958710861; Tue, 08 Apr 2014 05:05:10 -0700 (PDT) Received: from [192.168.1.104] ([124.126.227.121]) by mx.google.com with ESMTPSA id i10sm9413459pat.36.2014.04.08.05.05.05 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 08 Apr 2014 05:05:09 -0700 (PDT) Message-ID: <5343E5ED.2040906@gmail.com> Date: Tue, 08 Apr 2014 20:05:01 +0800 From: Chen Gang User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Michael Tokarev References: <53337BEB.90305@gmail.com> <87wqfgrp83.fsf@blackfin.pond.sub.org> <5333F6E2.9080202@gmail.com> <53382DDD.8050001@gmail.com> <87fvlylf02.fsf@blackfin.pond.sub.org> <53396545.805@gmail.com> <533969AB.4010505@gmail.com> <53396CE9.9090405@gmail.com> <533E7DD5.3090203@gmail.com> <5340F4FD.7040305@msgid.tls.msk.ru> <53414941.5040908@gmail.com> <5343E4D4.6070305@gmail.com> <5343E516.3020103@gmail.com> <5343E571.60407@gmail.com> In-Reply-To: <5343E571.60407@gmail.com> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400e:c01::230 Cc: QEMU Trivial , Peter Maydell , Markus Armbruster , Anthony Liguori , QEMU Developers Subject: [Qemu-devel] [PATCH trivial 3/3] vl: remove local variable 'args' in the middle of code block 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 For C code, it does not recommend to define a local variable in the middle of code block without "{...}". The original author may want to zero members not mentioned in structure assignment. So recommend to use structure initializing block "{...}" for structure assignment in the middle of code block. And at present, we can assume that all related gcc versions will be latest enough to notice about this grammar. Signed-off-by: Chen Gang Reviewed-by: Markus Armbruster Reviewed-by: Peter Crosthwaite --- vl.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/vl.c b/vl.c index 377f962..d381443 100644 --- a/vl.c +++ b/vl.c @@ -4368,15 +4368,15 @@ int main(int argc, char **argv, char **envp) qdev_machine_init(); - QEMUMachineInitArgs args = { .machine = machine, - .ram_size = ram_size, - .boot_order = boot_order, - .kernel_filename = kernel_filename, - .kernel_cmdline = kernel_cmdline, - .initrd_filename = initrd_filename, - .cpu_model = cpu_model }; - - current_machine->init_args = args; + current_machine->init_args = (QEMUMachineInitArgs) { + .machine = machine, + .ram_size = ram_size, + .boot_order = boot_order, + .kernel_filename = kernel_filename, + .kernel_cmdline = kernel_cmdline, + .initrd_filename = initrd_filename, + .cpu_model = cpu_model }; + machine->init(¤t_machine->init_args); audio_init();