qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
	Blue Swirl <blauwirbel@gmail.com>,
	Anthony Liguori <aliguori@amazon.com>,
	Leon Alrae <leon.alrae@imgtec.com>,
	afaerber@suse.de, Aurelien Jarno <aurelien@aurel32.net>,
	Richard Henderson <rth@twiddle.net>
Subject: [Qemu-devel] [PATCH 6/8] serial: serial_hds_isa_init() shouldn't fail
Date: Wed,  4 Feb 2015 18:33:06 +0100	[thread overview]
Message-ID: <1423071188-1085-7-git-send-email-armbru@redhat.com> (raw)
In-Reply-To: <1423071188-1085-1-git-send-email-armbru@redhat.com>

It shouldn't fail, and no caller checks for failure.  Make failure
fatal.

Maintainers of affected machines cc'ed.

Cc: Richard Henderson <rth@twiddle.net>
Cc: Anthony Liguori <aliguori@amazon.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Aurelien Jarno <aurelien@aurel32.net>
Cc: Leon Alrae <leon.alrae@imgtec.com>
Cc: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 hw/char/serial-isa.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/hw/char/serial-isa.c b/hw/char/serial-isa.c
index 059ceb8..f3db024 100644
--- a/hw/char/serial-isa.c
+++ b/hw/char/serial-isa.c
@@ -119,22 +119,16 @@ static void serial_register_types(void)
 
 type_init(serial_register_types)
 
-static bool serial_isa_init(ISABus *bus, int index, CharDriverState *chr)
+static void serial_isa_init(ISABus *bus, int index, CharDriverState *chr)
 {
     DeviceState *dev;
     ISADevice *isadev;
 
-    isadev = isa_try_create(bus, TYPE_ISA_SERIAL);
-    if (!isadev) {
-        return false;
-    }
+    isadev = isa_create(bus, TYPE_ISA_SERIAL);
     dev = DEVICE(isadev);
     qdev_prop_set_uint32(dev, "index", index);
     qdev_prop_set_chr(dev, "chardev", chr);
-    if (qdev_init(dev) < 0) {
-        return false;
-    }
-    return true;
+    qdev_init_nofail(dev);
 }
 
 void serial_hds_isa_init(ISABus *bus, int n)
-- 
1.9.3

  parent reply	other threads:[~2015-02-04 17:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-04 17:33 [Qemu-devel] [PATCH 0/8] Cleanups around unchecked qdev_init() Markus Armbruster
2015-02-04 17:33 ` [Qemu-devel] [PATCH 1/8] qdev: Improve qdev_init_nofail()'s error reporting Markus Armbruster
2015-02-04 17:33 ` [Qemu-devel] [PATCH 2/8] ide/isa: Replace unchecked qdev_init() by qdev_init_nofail() Markus Armbruster
2015-02-04 17:33 ` [Qemu-devel] [PATCH 3/8] leon3: " Markus Armbruster
2015-02-12  9:30   ` Fabien Chouteau
2015-02-04 17:33 ` [Qemu-devel] [PATCH 4/8] etsec: Replace " Markus Armbruster
2015-02-04 17:33 ` [Qemu-devel] [PATCH 5/8] serial: Factor out common serial_hds_isa_init() Markus Armbruster
2015-02-04 17:33 ` Markus Armbruster [this message]
2015-02-04 17:33 ` [Qemu-devel] [PATCH 7/8] parallel: Factor out common parallel_hds_isa_init() Markus Armbruster
2015-02-04 17:33 ` [Qemu-devel] [PATCH 8/8] parallel: parallel_hds_isa_init() shouldn't fail 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=1423071188-1085-7-git-send-email-armbru@redhat.com \
    --to=armbru@redhat.com \
    --cc=afaerber@suse.de \
    --cc=aliguori@amazon.com \
    --cc=aurelien@aurel32.net \
    --cc=blauwirbel@gmail.com \
    --cc=leon.alrae@imgtec.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /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).