[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PULL 04/10] ide/isa: Replace unchecked qdev_init() by qdev

From: Andreas Färber
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

From: Markus Armbruster <address@hidden>

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 <address@hidden>
Cc: Stefan Hajnoczi <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
Signed-off-by: Andreas Färber <address@hidden>
 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) {

reply via email to

[Prev in Thread] Current Thread [Next in Thread]