diff options
author | Markus Armbruster | 2020-07-07 18:06:04 +0200 |
---|---|---|
committer | Markus Armbruster | 2020-07-10 15:18:08 +0200 |
commit | 992861fb1e4cf410f30ec8f05bd2dc2a14a5a027 (patch) | |
tree | 9d4d5de47d4ebae50838cd7f8ea39b89a3604507 /hw/s390x/sclp.c | |
parent | error: Eliminate error_propagate() with Coccinelle, part 2 (diff) | |
download | qemu-992861fb1e4cf410f30ec8f05bd2dc2a14a5a027.tar.gz qemu-992861fb1e4cf410f30ec8f05bd2dc2a14a5a027.tar.xz qemu-992861fb1e4cf410f30ec8f05bd2dc2a14a5a027.zip |
error: Eliminate error_propagate() manually
When all we do with an Error we receive into a local variable is
propagating to somewhere else, we can just as well receive it there
right away. The previous two commits did that for sufficiently simple
cases with Coccinelle. Do it for several more manually.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20200707160613.848843-37-armbru@redhat.com>
Diffstat (limited to 'hw/s390x/sclp.c')
-rw-r--r-- | hw/s390x/sclp.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/hw/s390x/sclp.c b/hw/s390x/sclp.c index 03364343eb..a0ce444b4b 100644 --- a/hw/s390x/sclp.c +++ b/hw/s390x/sclp.c @@ -329,7 +329,6 @@ static void sclp_realize(DeviceState *dev, Error **errp) { MachineState *machine = MACHINE(qdev_get_machine()); SCLPDevice *sclp = SCLP(dev); - Error *err = NULL; uint64_t hw_limit; int ret; @@ -338,20 +337,17 @@ static void sclp_realize(DeviceState *dev, Error **errp) * as we can't find a fitting bus via the qom tree, we have to add the * event facility to the sysbus, so e.g. a sclp console can be created. */ - if (!sysbus_realize(SYS_BUS_DEVICE(sclp->event_facility), &err)) { - goto out; + if (!sysbus_realize(SYS_BUS_DEVICE(sclp->event_facility), errp)) { + return; } ret = s390_set_memory_limit(machine->maxram_size, &hw_limit); if (ret == -E2BIG) { - error_setg(&err, "host supports a maximum of %" PRIu64 " GB", + error_setg(errp, "host supports a maximum of %" PRIu64 " GB", hw_limit / GiB); } else if (ret) { - error_setg(&err, "setting the guest size failed"); + error_setg(errp, "setting the guest size failed"); } - -out: - error_propagate(errp, err); } static void sclp_memory_init(SCLPDevice *sclp) |