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 /hw/i386/pc.c | |
parent | b8865591d4d5680b4f766c25ca1db110320b4d15 (diff) | |
download | qemu-34dde13685ebc2c07923f32ad69e40b27c0e0bb4.zip qemu-34dde13685ebc2c07923f32ad69e40b27c0e0bb4.tar.gz qemu-34dde13685ebc2c07923f32ad69e40b27c0e0bb4.tar.bz2 |
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>
Diffstat (limited to 'hw/i386/pc.c')
-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 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; } |