From patchwork Sun Nov 23 11:17:46 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 413381 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 E91601400F1 for ; Sun, 23 Nov 2014 22:20:08 +1100 (AEDT) Received: from localhost ([::1]:48219 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XsVD4-0005tH-Qs for incoming@patchwork.ozlabs.org; Sun, 23 Nov 2014 06:20:06 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46951) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XsVB0-0002DO-SQ for qemu-devel@nongnu.org; Sun, 23 Nov 2014 06:18:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XsVAu-0004cv-Nx for qemu-devel@nongnu.org; Sun, 23 Nov 2014 06:17:58 -0500 Received: from mx1.redhat.com ([209.132.183.28]:40854) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XsVAu-0004cp-GR for qemu-devel@nongnu.org; Sun, 23 Nov 2014 06:17:52 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sANBHna9006037 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Sun, 23 Nov 2014 06:17:49 -0500 Received: from redhat.com (ovpn-116-38.ams2.redhat.com [10.36.116.38]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with SMTP id sANBHkvp018903; Sun, 23 Nov 2014 06:17:47 -0500 Date: Sun, 23 Nov 2014 13:17:46 +0200 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Message-ID: <1416741307-32307-4-git-send-email-mst@redhat.com> References: <1416741307-32307-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1416741307-32307-1-git-send-email-mst@redhat.com> X-Mutt-Fcc: =sent X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Peter Maydell , Richard Henderson , Paolo Bonzini , Anthony Liguori , Igor Mammedov Subject: [Qemu-devel] [PULL 03/15] pc: make pc_dimm_plug() more readble 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 From: Igor Mammedov split addr initialization from declaration so that later when new local vars are added property getter wouldn't drift off of error check. Signed-off-by: Igor Mammedov Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/i386/pc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index ce7b752..70ae3cf 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1556,8 +1556,9 @@ static void pc_dimm_plug(HotplugHandler *hotplug_dev, PCDIMMDevice *dimm = PC_DIMM(dev); PCDIMMDeviceClass *ddc = PC_DIMM_GET_CLASS(dimm); MemoryRegion *mr = ddc->get_memory_region(dimm); - uint64_t addr = object_property_get_int(OBJECT(dimm), PC_DIMM_ADDR_PROP, - &local_err); + uint64_t addr; + + addr = object_property_get_int(OBJECT(dimm), PC_DIMM_ADDR_PROP, &local_err); if (local_err) { goto out; }