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/block/fdc.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/block/fdc.c')
-rw-r--r-- | hw/block/fdc.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/hw/block/fdc.c b/hw/block/fdc.c index f22f46c9c9..e9ed3eef45 100644 --- a/hw/block/fdc.c +++ b/hw/block/fdc.c @@ -2528,7 +2528,7 @@ static void fdctrl_connect_drives(FDCtrl *fdctrl, DeviceState *fdc_dev, FDrive *drive; DeviceState *dev; BlockBackend *blk; - Error *local_err = NULL; + bool ok; const char *fdc_name, *drive_suffix; for (i = 0; i < MAX_FD; i++) { @@ -2567,11 +2567,9 @@ static void fdctrl_connect_drives(FDCtrl *fdctrl, DeviceState *fdc_dev, blk_ref(blk); blk_detach_dev(blk, fdc_dev); fdctrl->qdev_for_drives[i].blk = NULL; - qdev_prop_set_drive_err(dev, "drive", blk, &local_err); + ok = qdev_prop_set_drive_err(dev, "drive", blk, errp); blk_unref(blk); - - if (local_err) { - error_propagate(errp, local_err); + if (!ok) { return; } |