[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 03/11] hw/s390x/ccw: Remove local Error variable from s390_ccw_rea
From: |
Thomas Huth |
Subject: |
[PULL 03/11] hw/s390x/ccw: Remove local Error variable from s390_ccw_realize() |
Date: |
Mon, 24 Jun 2024 11:10:35 +0200 |
From: Cédric Le Goater <[email protected]>
Use the 'Error **errp' argument of s390_ccw_realize() instead and
remove the error_propagate() call.
Signed-off-by: Cédric Le Goater <[email protected]>
Reviewed-by: Zhenzhong Duan <[email protected]>
Reviewed-by: Anthony Krowiak <[email protected]>
Reviewed-by: Eric Farman <[email protected]>
Reviewed-by: Thomas Huth <[email protected]>
Message-ID: <[email protected]>
Signed-off-by: Thomas Huth <[email protected]>
---
hw/s390x/s390-ccw.c | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/hw/s390x/s390-ccw.c b/hw/s390x/s390-ccw.c
index 4b8ede701d..b3d14c61d7 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)
--
2.45.2
- [PULL 00/11] s390x and qtest patches 2024-06-24, Thomas Huth, 2024/06/24
- [PULL 01/11] hw/s390x/ccw: Make s390_ccw_get_dev_info() return a bool, Thomas Huth, 2024/06/24
- [PULL 02/11] s390x/css: Make CCWDeviceClass::realize return bool, Thomas Huth, 2024/06/24
- [PULL 04/11] s390x/css: Make S390CCWDeviceClass::realize return bool, Thomas Huth, 2024/06/24
- [PULL 06/11] vfio/ccw: Fix the missed unrealize() call in error path, Thomas Huth, 2024/06/24
- [PULL 05/11] vfio/ccw: Use the 'Error **errp' argument of vfio_ccw_realize(), Thomas Huth, 2024/06/24
- [PULL 03/11] hw/s390x/ccw: Remove local Error variable from s390_ccw_realize(),
Thomas Huth <=
- [PULL 08/11] tests/qtest/fuzz: fix memleak in qos_fuzz.c, Thomas Huth, 2024/06/24
- [PULL 10/11] MAINTAINERS: Cover all tests/qtest/migration-* files, Thomas Huth, 2024/06/24
- [PULL 09/11] target/s390x/arch_dump: use correct byte order for pid, Thomas Huth, 2024/06/24
- [PULL 11/11] target/s390x: Add a CONFIG switch to disable legacy CPUs, Thomas Huth, 2024/06/24
- [PULL 07/11] vfio/{ap, ccw}: Use warn_report_err() for IRQ notifier registration errors, Thomas Huth, 2024/06/24
- Re: [PULL 00/11] s390x and qtest patches 2024-06-24, Richard Henderson, 2024/06/24