From patchwork Tue Oct 6 23:15:59 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 35172 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 14F3EB7BC3 for ; Wed, 7 Oct 2009 10:27:49 +1100 (EST) Received: from localhost ([127.0.0.1]:34207 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MvJRa-0006wM-A0 for incoming@patchwork.ozlabs.org; Tue, 06 Oct 2009 19:27:46 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MvJGR-0003OF-MW for qemu-devel@nongnu.org; Tue, 06 Oct 2009 19:16:15 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MvJGL-0003LV-7g for qemu-devel@nongnu.org; Tue, 06 Oct 2009 19:16:13 -0400 Received: from [199.232.76.173] (port=52563 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MvJGL-0003LS-1b for qemu-devel@nongnu.org; Tue, 06 Oct 2009 19:16:09 -0400 Received: from oxygen.pond.sub.org ([213.239.205.148]:50058) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MvJGK-0005IY-Lq for qemu-devel@nongnu.org; Tue, 06 Oct 2009 19:16:08 -0400 Received: from pike.pond.sub.org (pD9E3BD77.dip.t-dialin.net [217.227.189.119]) by oxygen.pond.sub.org (Postfix) with ESMTPA id 96767276D50 for ; Wed, 7 Oct 2009 01:16:07 +0200 (CEST) Received: by pike.pond.sub.org (Postfix, from userid 1000) id 3D5E61009D; Wed, 7 Oct 2009 01:16:01 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Wed, 7 Oct 2009 01:15:59 +0200 Message-Id: X-Mailer: git-send-email 1.6.0.6 In-Reply-To: References: X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [Qemu-devel] [PATCH 5/7] Make isa_create() terminate program on failure X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Callers don't check the return value anyway. Signed-off-by: Markus Armbruster --- hw/isa-bus.c | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-) diff --git a/hw/isa-bus.c b/hw/isa-bus.c index f7e73d2..4d489d2 100644 --- a/hw/isa-bus.c +++ b/hw/isa-bus.c @@ -114,8 +114,8 @@ ISADevice *isa_create(const char *name) DeviceState *dev; if (!isabus) { - fprintf(stderr, "Tried to create isa device %s with no isa bus present.\n", name); - return NULL; + hw_error("Tried to create isa device %s with no isa bus present.\n", + name); } dev = qdev_create(&isabus->qbus, name); return DO_UPCAST(ISADevice, qdev, dev); @@ -126,9 +126,7 @@ ISADevice *isa_create_simple(const char *name) ISADevice *dev; dev = isa_create(name); - if (qdev_init(&dev->qdev) != 0) { - return NULL; - } + qdev_init_nofail(&dev->qdev); return dev; }