From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56506) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9bWc-0007Bg-MB for qemu-devel@nongnu.org; Thu, 17 Dec 2015 11:35:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a9bWb-0003to-2B for qemu-devel@nongnu.org; Thu, 17 Dec 2015 11:35:30 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50240) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9bWa-0003tS-8u for qemu-devel@nongnu.org; Thu, 17 Dec 2015 11:35:28 -0500 From: Markus Armbruster Date: Thu, 17 Dec 2015 17:35:19 +0100 Message-Id: <1450370121-5768-12-git-send-email-armbru@redhat.com> In-Reply-To: <1450370121-5768-1-git-send-email-armbru@redhat.com> References: <1450370121-5768-1-git-send-email-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH v3 11/13] isa: Clean up inappropriate hw_error() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , Markus Armbruster , Mark Cave-Ayland , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Aurelien Jarno , Richard Henderson isa_bus_irqs(), isa_create() and isa_try_create() call hw_error() when passed a null bus. Use of hw_error() has always been questionable, because these are used only during machine initialization, and printing CPU registers isn't useful there. Since the previous commit, passing a null bus is a programming error. Drop the hw_error() and simply let it crash. Cc: Richard Henderson Cc: "Michael S. Tsirkin" Cc: "Herv=C3=A9 Poussineau" Cc: Aurelien Jarno Cc: Mark Cave-Ayland Signed-off-by: Markus Armbruster Reviewed-by: Herv=C3=A9 Poussineau --- hw/isa/isa-bus.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/hw/isa/isa-bus.c b/hw/isa/isa-bus.c index af6ffd6..a24d32c 100644 --- a/hw/isa/isa-bus.c +++ b/hw/isa/isa-bus.c @@ -63,9 +63,7 @@ ISABus *isa_bus_new(DeviceState *dev, MemoryRegion* add= ress_space, =20 void isa_bus_irqs(ISABus *bus, qemu_irq *irqs) { - if (!bus) { - hw_error("Can't set isa irqs with no isa bus present."); - } + assert(bus); bus->irqs =3D irqs; } =20 @@ -137,10 +135,7 @@ ISADevice *isa_create(ISABus *bus, const char *name) { DeviceState *dev; =20 - if (!bus) { - hw_error("Tried to create isa device %s with no isa bus present.= ", - name); - } + assert(bus); dev =3D qdev_create(BUS(bus), name); return ISA_DEVICE(dev); } @@ -149,10 +144,7 @@ ISADevice *isa_try_create(ISABus *bus, const char *n= ame) { DeviceState *dev; =20 - if (!bus) { - hw_error("Tried to create isa device %s with no isa bus present.= ", - name); - } + assert(bus); dev =3D qdev_try_create(BUS(bus), name); return ISA_DEVICE(dev); } --=20 2.4.3