From: "Cédric Le Goater" <clg@redhat.com>
To: qemu-devel@nongnu.org
Cc: qemu-s390x@nongnu.org, "Thomas Huth" <thuth@redhat.com>,
"Zhenzhong Duan" <zhenzhong.duan@intel.com>,
"Matthew Rosato" <mjrosato@linux.ibm.com>,
"Eric Farman" <farman@linux.ibm.com>,
"Tony Krowiak" <akrowiak@linux.ibm.com>,
"Cédric Le Goater" <clg@redhat.com>
Subject: [PATCH 3/7] hw/s390x/ccw: Remove local Error variable from s390_ccw_realize()
Date: Wed, 22 May 2024 19:01:03 +0200 [thread overview]
Message-ID: <20240522170107.289532-4-clg@redhat.com> (raw)
In-Reply-To: <20240522170107.289532-1-clg@redhat.com>
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>
---
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 4b8ede701df90949720262b6fc1b65f4e505e34d..b3d14c61d732880a651edcf28a040ca723cb9f5b 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.1
next prev parent reply other threads:[~2024-05-22 17:02 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-22 17:01 [PATCH 0/7] s390x/ccw: Error reporting cleanups Cédric Le Goater
2024-05-22 17:01 ` [PATCH 1/7] hw/s390x/ccw: Make s390_ccw_get_dev_info() return a bool Cédric Le Goater
2024-05-23 8:43 ` Duan, Zhenzhong
2024-05-24 13:13 ` Anthony Krowiak
2024-05-22 17:01 ` [PATCH 2/7] s390x/css: Make CCWDeviceClass::realize return bool Cédric Le Goater
2024-05-23 8:43 ` Duan, Zhenzhong
2024-05-24 13:14 ` Anthony Krowiak
2024-05-22 17:01 ` Cédric Le Goater [this message]
2024-05-23 8:44 ` [PATCH 3/7] hw/s390x/ccw: Remove local Error variable from s390_ccw_realize() Duan, Zhenzhong
2024-05-24 13:14 ` Anthony Krowiak
2024-05-22 17:01 ` [PATCH 4/7] s390x/css: Make S390CCWDeviceClass::realize return bool Cédric Le Goater
2024-05-23 8:45 ` Duan, Zhenzhong
2024-05-24 13:14 ` Anthony Krowiak
2024-05-22 17:01 ` [PATCH 5/7] vfio/ccw: Use the 'Error **errp' argument of vfio_ccw_realize() Cédric Le Goater
2024-05-23 8:45 ` Duan, Zhenzhong
2024-05-24 13:14 ` Anthony Krowiak
2024-05-22 17:01 ` [PATCH 6/7] vfio/ccw: Fix the missed unrealize() call in error path Cédric Le Goater
2024-05-23 8:52 ` Cédric Le Goater
2024-05-22 17:01 ` [PATCH 7/7] vfio/{ap, ccw}: Use warn_report_err() for IRQ notifier registration errors Cédric Le Goater
2024-05-23 8:45 ` Duan, Zhenzhong
2024-05-24 13:14 ` Anthony Krowiak
2024-05-23 20:27 ` [PATCH 0/7] s390x/ccw: Error reporting cleanups Eric Farman
2024-05-27 6:23 ` Thomas Huth
2024-05-27 6:43 ` Cédric Le Goater
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240522170107.289532-4-clg@redhat.com \
--to=clg@redhat.com \
--cc=akrowiak@linux.ibm.com \
--cc=farman@linux.ibm.com \
--cc=mjrosato@linux.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=thuth@redhat.com \
--cc=zhenzhong.duan@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.