aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCédric Le Goater <clg@redhat.com>2024-05-22 19:01:03 +0200
committerThomas Huth <thuth@redhat.com>2024-06-24 08:03:33 +0200
commit19a1740fd3eb31ffc5b73ed101f1e3847c546631 (patch)
tree9818646f423ee21503405b28b0cd1631f683e945
parent4a6a90f30fa3b2973bbb6faf985466b4338f903f (diff)
downloadqemu-19a1740fd3eb31ffc5b73ed101f1e3847c546631.zip
qemu-19a1740fd3eb31ffc5b73ed101f1e3847c546631.tar.gz
qemu-19a1740fd3eb31ffc5b73ed101f1e3847c546631.tar.bz2
hw/s390x/ccw: Remove local Error variable from s390_ccw_realize()
Use the 'Error **errp' argument of s390_ccw_realize() instead and remove the error_propagate() call. Signed-off-by: Cédric Le Goater <clg@redhat.com> Reviewed-by: Zhenzhong Duan <zhenzhong.duan@intel.com> Reviewed-by: Anthony Krowiak <akrowiak@linux.ibm.com> Reviewed-by: Eric Farman <farman@linux.ibm.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-ID: <20240522170107.289532-4-clg@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
-rw-r--r--hw/s390x/s390-ccw.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/hw/s390x/s390-ccw.c b/hw/s390x/s390-ccw.c
index 4b8ede7..b3d14c6 100644
--- a/hw/s390x/s390-ccw.c
+++ b/hw/s390x/s390-ccw.c
@@ -115,13 +115,12 @@ static void s390_ccw_realize(S390CCWDevice *cdev, char *sysfsdev, Error **errp)
DeviceState *parent = DEVICE(ccw_dev);
SubchDev *sch;
int ret;
- Error *err = NULL;
- if (!s390_ccw_get_dev_info(cdev, sysfsdev, &err)) {
- goto out_err_propagate;
+ if (!s390_ccw_get_dev_info(cdev, sysfsdev, errp)) {
+ return;
}
- sch = css_create_sch(ccw_dev->devno, &err);
+ sch = css_create_sch(ccw_dev->devno, errp);
if (!sch) {
goto out_mdevid_free;
}
@@ -132,12 +131,12 @@ static void s390_ccw_realize(S390CCWDevice *cdev, char *sysfsdev, Error **errp)
ccw_dev->sch = sch;
ret = css_sch_build_schib(sch, &cdev->hostid);
if (ret) {
- error_setg_errno(&err, -ret, "%s: Failed to build initial schib",
+ error_setg_errno(errp, -ret, "%s: Failed to build initial schib",
__func__);
goto out_err;
}
- if (!ck->realize(ccw_dev, &err)) {
+ if (!ck->realize(ccw_dev, errp)) {
goto out_err;
}
@@ -151,8 +150,6 @@ out_err:
g_free(sch);
out_mdevid_free:
g_free(cdev->mdevid);
-out_err_propagate:
- error_propagate(errp, err);
}
static void s390_ccw_unrealize(S390CCWDevice *cdev)