From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37160) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJIpt-0006lM-TC for qemu-devel@nongnu.org; Thu, 05 Feb 2015 04:35:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YJIps-0002Ep-PM for qemu-devel@nongnu.org; Thu, 05 Feb 2015 04:34:57 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50883) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJIps-0002Ek-Ha for qemu-devel@nongnu.org; Thu, 05 Feb 2015 04:34:56 -0500 From: Markus Armbruster Date: Thu, 5 Feb 2015 10:34:49 +0100 Message-Id: <1423128889-18260-4-git-send-email-armbru@redhat.com> In-Reply-To: <1423128889-18260-1-git-send-email-armbru@redhat.com> References: <1423128889-18260-1-git-send-email-armbru@redhat.com> Subject: [Qemu-devel] [PATCH 3/3] s390x: Replace unchecked qdev_init() by qdev_init_nofail() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Cornelia Huck , Christian Borntraeger , afaerber@suse.de, Alexander Graf s390_flic_init() is a helper to create and realize either "s390-flic-kvm" or "s390-flic-qemu". When qdev_init() fails, it complains to stderr and succeeds. Except it can't actually fail, because the "s390-flic-qemu" is a dummy without a realize method, and "s390-flic-kvm"'s realize can't fail, even when the kernel device is really unavailable. Odd. Replace qdev_init() by qdev_init_nofail() to make "can't fail" locally obvious, and get rid of the unreachable error reporting. Cc: Christian Borntraeger Cc: Cornelia Huck Cc: Alexander Graf Signed-off-by: Markus Armbruster --- hw/intc/s390_flic.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/hw/intc/s390_flic.c b/hw/intc/s390_flic.c index 03c5e89..02e10b7 100644 --- a/hw/intc/s390_flic.c +++ b/hw/intc/s390_flic.c @@ -30,7 +30,6 @@ S390FLICState *s390_get_flic(void) void s390_flic_init(void) { DeviceState *dev; - int r; dev = s390_flic_kvm_create(); if (!dev) { @@ -38,10 +37,7 @@ void s390_flic_init(void) object_property_add_child(qdev_get_machine(), TYPE_QEMU_S390_FLIC, OBJECT(dev), NULL); } - r = qdev_init(dev); - if (r) { - error_report("flic: couldn't create qdev"); - } + qdev_init_nofail(dev); } static int qemu_s390_register_io_adapter(S390FLICState *fs, uint32_t id, -- 1.9.3