qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Andreas Färber" <afaerber@suse.de>
To: qemu-devel@nongnu.org
Cc: "Kevin Wolf" <kwolf@redhat.com>,
	"Markus Armbruster" <armbru@redhat.com>,
	"Stefan Hajnoczi" <stefanha@redhat.com>,
	"Andreas Färber" <afaerber@suse.de>
Subject: [Qemu-devel] [PULL 04/10] ide/isa: Replace unchecked qdev_init() by qdev_init_nofail()
Date: Tue, 24 Feb 2015 14:58:24 +0100	[thread overview]
Message-ID: <1424786311-22387-5-git-send-email-afaerber@suse.de> (raw)
In-Reply-To: <1424786311-22387-1-git-send-email-afaerber@suse.de>

From: Markus Armbruster <armbru@redhat.com>

isa_ide_init()'s callers don't check for failure.  isa_ide_init()
looks like it could fail, but since isa_ide_realizefn() can't fail, it
actually can't.  Replace its qdev_init() by qdev_init_nofail() to make
it obvious.

Cc: Kevin Wolf <kwolf@redhat.com>
Cc: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
 hw/ide/isa.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/hw/ide/isa.c b/hw/ide/isa.c
index b084162..c0c4e1b 100644
--- a/hw/ide/isa.c
+++ b/hw/ide/isa.c
@@ -88,9 +88,7 @@ ISADevice *isa_ide_init(ISABus *bus, int iobase, int iobase2, int isairq,
     qdev_prop_set_uint32(dev, "iobase",  iobase);
     qdev_prop_set_uint32(dev, "iobase2", iobase2);
     qdev_prop_set_uint32(dev, "irq",     isairq);
-    if (qdev_init(dev) < 0) {
-        return NULL;
-    }
+    qdev_init_nofail(dev);
 
     s = ISA_IDE(dev);
     if (hd0) {
-- 
2.1.4

  parent reply	other threads:[~2015-02-24 14:01 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-24 13:58 [Qemu-devel] [PULL 00/10] QOM devices patch queue 2015-02-24 Andreas Färber
2015-02-24 13:58 ` [Qemu-devel] [PULL 01/10] qdev: Avoid type assertion in qdev_build_hotpluggable_device_list() Andreas Färber
2015-02-24 13:58 ` [Qemu-devel] [PULL 02/10] qom: Fix typo, 'my_class_init' -> 'derived_class_init' Andreas Färber
2015-02-24 13:58 ` [Qemu-devel] [PULL 03/10] qdev: Improve qdev_init_nofail()'s error reporting Andreas Färber
2015-02-24 13:58 ` Andreas Färber [this message]
2015-02-24 13:58 ` [Qemu-devel] [PULL 05/10] leon3: Replace unchecked qdev_init() by qdev_init_nofail() Andreas Färber
2015-02-24 13:58 ` [Qemu-devel] [PULL 06/10] etsec: Replace " Andreas Färber
2015-02-24 13:58 ` [Qemu-devel] [PULL 07/10] serial: Factor out common serial_hds_isa_init() Andreas Färber
2015-02-24 13:58 ` [Qemu-devel] [PULL 08/10] serial: serial_hds_isa_init() shouldn't fail Andreas Färber
2015-02-24 13:58 ` [Qemu-devel] [PULL 09/10] parallel: Factor out common parallel_hds_isa_init() Andreas Färber
2015-02-24 13:58 ` [Qemu-devel] [PULL 10/10] parallel: parallel_hds_isa_init() shouldn't fail Andreas Färber
2015-02-24 19:17 ` [Qemu-devel] [PULL 00/10] QOM devices patch queue 2015-02-24 Mark Cave-Ayland
2015-03-02 14:21 ` 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=1424786311-22387-5-git-send-email-afaerber@suse.de \
    --to=afaerber@suse.de \
    --cc=armbru@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.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).