Received: from eggs.gnu.org ([208.118.235.92]:44165) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TaRTw-00030Q-Eg for qemu-devel@nongnu.org; Mon, 19 Nov 2012 08:33:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TaRTt-0008G9-C6 for qemu-devel@nongnu.org; Mon, 19 Nov 2012 08:33:48 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51599) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TaRTt-0008Fc-46 for qemu-devel@nongnu.org; Mon, 19 Nov 2012 08:33:45 -0500 Date: Mon, 19 Nov 2012 11:35:07 -0200 From: Eduardo Habkost Message-ID: <20121119133507.GA12995@otherpad.lan.raisama.net> References: <1352808709-11215-1-git-send-email-borntraeger@de.ibm.com> <3CA9BC2F-0996-46CA-AB82-BFE7D3364272@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3CA9BC2F-0996-46CA-AB82-BFE7D3364272@suse.de> Subject: Re: [Qemu-devel] [PATCH 06/24] Remove local ram_size that hides global one List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: Christian Borntraeger , Heinz Graalfs , "qemu-devel@nongnu.org qemu-devel" On Mon, Nov 19, 2012 at 02:14:27PM +0100, Alexander Graf wrote: > > On 13.11.2012, at 13:11, Christian Borntraeger wrote: > > > From: Heinz Graalfs > > > > The global variable 'ram_size' is hidden by the local variable > > declaration in s390_init() > > That's the point of Eduardo's patch, no? Or do we need access to the global to change its value afterwards? If so, please write a reasonable patch description that actually explains the problem. > Actually, I wanted to keep the existing behavior (whatever it was), and use local variables to replace the old function parameters, and change nothing else. Most machines used a local variable named 'ram_size', but the parameter to s390_init() was named 'my_ram_size'. So, considering that this at least restores the previous behavior: Reviewed-by: Eduardo Habkost > > Alex > > > > > Signed-off-by: Heinz Graalfs > > Signed-off-by: Christian Borntraeger > > --- > > hw/s390-virtio.c | 1 - > > 1 file changed, 1 deletion(-) > > > > diff --git a/hw/s390-virtio.c b/hw/s390-virtio.c > > index ebec844..78477af 100644 > > --- a/hw/s390-virtio.c > > +++ b/hw/s390-virtio.c > > @@ -155,7 +155,6 @@ unsigned s390_del_running_cpu(CPUS390XState *env) > > static void s390_init(QEMUMachineInitArgs *args) > > { > > ram_addr_t my_ram_size = args->ram_size; > > - ram_addr_t ram_size = args->ram_size; > > const char *cpu_model = args->cpu_model; > > const char *kernel_filename = args->kernel_filename; > > const char *kernel_cmdline = args->kernel_cmdline; > > -- > > 1.7.10.1 > > > -- Eduardo