From mboxrd@z Thu Jan 1 00:00:00 1970 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 Date: Sun, 23 Nov 2014 13:17:46 +0200 From: "Michael S. Tsirkin" 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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1416741307-32307-1-git-send-email-mst@redhat.com> Subject: [Qemu-devel] [PULL 03/15] pc: make pc_dimm_plug() more readble List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , Richard Henderson , Paolo Bonzini , Anthony Liguori , Igor Mammedov 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; } -- MST