qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Vivier <laurent@vivier.eu>
To: qemu-devel@nongnu.org
Cc: "Halil Pasic" <pasic@linux.ibm.com>,
	"Laurent Vivier" <laurent@vivier.eu>,
	qemu-block@nongnu.org, "Cornelia Huck" <cohuck@redhat.com>,
	"Christian Borntraeger" <borntraeger@de.ibm.com>,
	"Michael Tokarev" <mjt@tls.msk.ru>,
	"Richard Henderson" <rth@twiddle.net>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Michael Roth" <mdroth@linux.vnet.ibm.com>,
	"Eduardo Habkost" <ehabkost@redhat.com>,
	qemu-s390x@nongnu.org, "Collin Walling" <walling@linux.ibm.com>,
	"Markus Armbruster" <armbru@redhat.com>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"David Hildenbrand" <david@redhat.com>,
	"Kevin Wolf" <kwolf@redhat.com>, "Max Reitz" <mreitz@redhat.com>,
	qemu-trivial@nongnu.org
Subject: [Qemu-devel] [PULL 4/4] error: Remove NULL checks on error_propagate() calls
Date: Tue, 18 Dec 2018 15:28:51 +0100	[thread overview]
Message-ID: <20181218142851.9477-5-laurent@vivier.eu> (raw)
In-Reply-To: <20181218142851.9477-1-laurent@vivier.eu>

From: Markus Armbruster <armbru@redhat.com>

Patch created mechanically by rerunning:

  $  spatch --sp-file scripts/coccinelle/error_propagate_null.cocci \
            --macro-file scripts/cocci-macro-file.h \
            --dir . --in-place

Whitespace tidied up manually.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20181213173113.11211-1-armbru@redhat.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 blockdev.c              | 4 +---
 hw/s390x/s390-pci-bus.c | 4 +---
 qga/commands-posix.c    | 7 ++-----
 3 files changed, 4 insertions(+), 11 deletions(-)

diff --git a/blockdev.c b/blockdev.c
index e6c8349409..a6f71f9d83 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -992,9 +992,7 @@ DriveInfo *drive_new(QemuOpts *all_opts, BlockInterfaceType block_default_type,
     blk = blockdev_init(filename, bs_opts, &local_err);
     bs_opts = NULL;
     if (!blk) {
-        if (local_err) {
-            error_propagate(errp, local_err);
-        }
+        error_propagate(errp, local_err);
         goto fail;
     } else {
         assert(!local_err);
diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c
index 99d0368868..f7458445c0 100644
--- a/hw/s390x/s390-pci-bus.c
+++ b/hw/s390x/s390-pci-bus.c
@@ -731,9 +731,7 @@ static void s390_pcihost_realize(DeviceState *dev, Error **errp)
 
     css_register_io_adapters(CSS_IO_ADAPTER_PCI, true, false,
                              S390_ADAPTER_SUPPRESSIBLE, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
-    }
+    error_propagate(errp, local_err);
 }
 
 static int s390_pci_msix_init(S390PCIBusDevice *pbdev)
diff --git a/qga/commands-posix.c b/qga/commands-posix.c
index 1877976522..2e719d9b6b 100644
--- a/qga/commands-posix.c
+++ b/qga/commands-posix.c
@@ -1573,10 +1573,7 @@ static bool systemd_supports_mode(SuspendMode mode, Error **errp)
         return true;
     }
 
-    if (local_err) {
-        error_propagate(errp, local_err);
-    }
-
+    error_propagate(errp, local_err);
     return false;
 }
 
@@ -1782,7 +1779,7 @@ static void guest_suspend(SuspendMode mode, Error **errp)
     if (!mode_supported) {
         error_setg(errp,
                    "the requested suspend mode is not supported by the guest");
-    } else if (local_err) {
+    } else {
         error_propagate(errp, local_err);
     }
 }
-- 
2.19.2

  parent reply	other threads:[~2018-12-18 14:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-18 14:28 [Qemu-devel] [PULL 0/4] Trivial patches patches Laurent Vivier
2018-12-18 14:28 ` [Qemu-devel] [PULL 1/4] docs/devel/build-system: fix 'softmu' typo Laurent Vivier
2018-12-18 14:28 ` [Qemu-devel] [PULL 2/4] i386: hvf: drop debug printf in decode_sldtgroup Laurent Vivier
2018-12-18 14:28 ` [Qemu-devel] [PULL 3/4] vl: Use error_fatal to simplify obvious fatal errors (again) Laurent Vivier
2018-12-18 14:28 ` Laurent Vivier [this message]
2018-12-19 18:49 ` [Qemu-devel] [PULL 0/4] Trivial patches patches Peter Maydell

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=20181218142851.9477-5-laurent@vivier.eu \
    --to=laurent@vivier.eu \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=borntraeger@de.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=david@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=mjt@tls.msk.ru \
    --cc=mreitz@redhat.com \
    --cc=pasic@linux.ibm.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=walling@linux.ibm.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).