diff mbox series

[PULL,1/2] error: Remove NULL checks on error_propagate() calls (again)

Message ID 20201009064858.323624-2-armbru@redhat.com
State Superseded
Headers show
Series Error reporting patches for 2020-10-09 | expand

Commit Message

Markus Armbruster Oct. 9, 2020, 6:48 a.m. UTC
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>
Message-Id: <20200722084048.1726105-4-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
---
 hw/net/virtio-net.c   | 8 ++------
 migration/colo.c      | 4 +---
 migration/migration.c | 8 ++------
 3 files changed, 5 insertions(+), 15 deletions(-)

Comments

Jens Freimann Oct. 9, 2020, 9:43 a.m. UTC | #1
On Fri, Oct 09, 2020 at 08:48:57AM +0200, Markus Armbruster wrote:
>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>
>Message-Id: <20200722084048.1726105-4-armbru@redhat.com>
>Reviewed-by: Eric Blake <eblake@redhat.com>
>---
> hw/net/virtio-net.c   | 8 ++------
> migration/colo.c      | 4 +---
> migration/migration.c | 8 ++------
> 3 files changed, 5 insertions(+), 15 deletions(-)
>

Reviewed-by: Jens Freimann <jfreimann@redhat.com>
diff mbox series

Patch

diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 7bf27b9db7..a160a9da9c 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -817,9 +817,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)
@@ -873,9 +871,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 80788d46b5..3f1d3dfd95 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 aca7fdcd0b..0575ecb379 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -623,9 +623,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();
@@ -647,9 +645,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;
         }