diff options
author | Igor Mammedov <imammedo@redhat.com> | 2014-10-31 16:38:35 +0000 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2014-11-23 12:11:30 +0200 |
commit | 34dde13685ebc2c07923f32ad69e40b27c0e0bb4 (patch) | |
tree | 49118404a7167a6f8a2169a6400bb71f959d521a | |
parent | b8865591d4d5680b4f766c25ca1db110320b4d15 (diff) |
pc: make pc_dimm_plug() more readble
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>
-rw-r--r-- | hw/i386/pc.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/hw/i386/pc.c b/hw/i386/pc.c index ce7b75217a..70ae3cfde6 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; } |