OSDN Git Service

pc: make pc_dimm_plug() more readble
authorIgor Mammedov <imammedo@redhat.com>
Fri, 31 Oct 2014 16:38:35 +0000 (16:38 +0000)
committerMichael S. Tsirkin <mst@redhat.com>
Sun, 23 Nov 2014 10:11:30 +0000 (12:11 +0200)
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 <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/i386/pc.c

index ce7b752..70ae3cf 100644 (file)
@@ -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;
     }