From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Cc: Jens Freimann <jfreimann@redhat.com>,
Hailiang Zhang <zhang.zhanghailiang@huawei.com>,
Juan Quintela <quintela@redhat.com>
Subject: [PATCH 3/4] error: Remove NULL checks on error_propagate() calls (again)
Date: Wed, 22 Jul 2020 10:40:47 +0200 [thread overview]
Message-ID: <20200722084048.1726105-4-armbru@redhat.com> (raw)
In-Reply-To: <20200722084048.1726105-1-armbru@redhat.com>
Patch created mechanically by rerunning:
$ spatch --sp-file scripts/coccinelle/error_propagate_null.cocci \
--macro-file scripts/cocci-macro-file.h \
--use-gitgrep .
Cc: Jens Freimann <jfreimann@redhat.com>
Cc: Hailiang Zhang <zhang.zhanghailiang@huawei.com>
Cc: Juan Quintela <quintela@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
hw/net/virtio-net.c | 8 ++------
migration/colo.c | 4 +---
migration/migration.c | 8 ++------
3 files changed, 5 insertions(+), 15 deletions(-)
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 4895af1cbe..21b9a315ed 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -809,9 +809,7 @@ static void failover_add_primary(VirtIONet *n, Error **errp)
"sure primary device has parameter"
" failover_pair_id=<virtio-net-id>\n");
}
- if (err) {
- error_propagate(errp, err);
- }
+ error_propagate(errp, err);
}
static int is_my_primary(void *opaque, QemuOpts *opts, Error **errp)
@@ -865,9 +863,7 @@ static DeviceState *virtio_connect_failover_devices(VirtIONet *n,
n->primary_device_id = g_strdup(prim_dev->id);
n->primary_device_opts = prim_dev->opts;
} else {
- if (err) {
- error_propagate(errp, err);
- }
+ error_propagate(errp, err);
}
return prim_dev;
diff --git a/migration/colo.c b/migration/colo.c
index ea7d1e9d4e..c6848c829b 100644
--- a/migration/colo.c
+++ b/migration/colo.c
@@ -798,9 +798,7 @@ static void colo_incoming_process_checkpoint(MigrationIncomingState *mis,
colo_send_message(mis->to_src_file, COLO_MESSAGE_VMSTATE_LOADED,
&local_err);
- if (local_err) {
- error_propagate(errp, local_err);
- }
+ error_propagate(errp, local_err);
}
static void colo_wait_handle_message(MigrationIncomingState *mis,
diff --git a/migration/migration.c b/migration/migration.c
index 2ed9923227..6a458b8fe5 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -601,9 +601,7 @@ void migration_fd_process_incoming(QEMUFile *f, Error **errp)
}
if (migration_incoming_setup(f, &local_err)) {
- if (local_err) {
- error_propagate(errp, local_err);
- }
+ error_propagate(errp, local_err);
return;
}
migration_incoming_process();
@@ -625,9 +623,7 @@ void migration_ioc_process_incoming(QIOChannel *ioc, Error **errp)
}
if (migration_incoming_setup(f, &local_err)) {
- if (local_err) {
- error_propagate(errp, local_err);
- }
+ error_propagate(errp, local_err);
return;
}
--
2.26.2
next prev parent reply other threads:[~2020-07-22 8:42 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-22 8:40 [PATCH 0/4] error: Mechanical fixes & cleanups Markus Armbruster
2020-07-22 8:40 ` [PATCH 1/4] coccinelle/err-bad-newline: Fix for Python 3, and add patterns Markus Armbruster
2020-07-22 13:28 ` Eric Blake
2020-07-22 8:40 ` [PATCH 2/4] error: Strip trailing '\n' from error string arguments (again) Markus Armbruster
2020-07-22 10:04 ` Philippe Mathieu-Daudé
2020-07-22 10:33 ` David Gibson
2020-07-22 12:46 ` Peter Xu
2020-07-22 8:40 ` Markus Armbruster [this message]
2020-07-22 13:31 ` [PATCH 3/4] error: Remove NULL checks on error_propagate() calls (again) Eric Blake
2020-07-23 9:14 ` Markus Armbruster
2020-07-23 13:38 ` Markus Armbruster
2020-07-23 13:42 ` Eric Blake
2020-07-22 8:40 ` [PATCH 4/4] error: Use error_fatal to simplify obvious fatal errors (again) Markus Armbruster
2020-07-22 8:42 ` David Hildenbrand
2020-07-24 13:45 ` [PATCH 0/4] error: Mechanical fixes & cleanups Markus Armbruster
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=20200722084048.1726105-4-armbru@redhat.com \
--to=armbru@redhat.com \
--cc=jfreimann@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=zhang.zhanghailiang@huawei.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).