From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40397) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a6zsj-0000l8-13 for qemu-devel@nongnu.org; Thu, 10 Dec 2015 06:59:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a6zse-0008T6-RR for qemu-devel@nongnu.org; Thu, 10 Dec 2015 06:59:32 -0500 Received: from mail-wm0-x235.google.com ([2a00:1450:400c:c09::235]:38497) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a6zse-0008St-LO for qemu-devel@nongnu.org; Thu, 10 Dec 2015 06:59:28 -0500 Received: by wmec201 with SMTP id c201so21495634wme.1 for ; Thu, 10 Dec 2015 03:59:28 -0800 (PST) References: <1449743372-17169-1-git-send-email-armbru@redhat.com> <1449743372-17169-11-git-send-email-armbru@redhat.com> From: Marcel Apfelbaum Message-ID: <5669691D.8040403@gmail.com> Date: Thu, 10 Dec 2015 13:59:25 +0200 MIME-Version: 1.0 In-Reply-To: <1449743372-17169-11-git-send-email-armbru@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH 10/12] isa: Clean up inappropriate hw_error() Reply-To: marcel@redhat.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , qemu-devel@nongnu.org Cc: =?UTF-8?Q?Herv=c3=a9_Poussineau?= , Richard Henderson , Mark Cave-Ayland , Aurelien Jarno , "Michael S. Tsirkin" On 12/10/2015 12:29 PM, Markus Armbruster wrote: > 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. Maybe we can be a little nicer add an assert ? :) Thanks, Marcel > > Cc: Richard Henderson > Cc: "Michael S. Tsirkin" > Cc: "Hervé Poussineau" > Cc: Aurelien Jarno > Cc: Mark Cave-Ayland > Signed-off-by: Markus Armbruster > --- > hw/isa/isa-bus.c | 11 ----------- > 1 file changed, 11 deletions(-) > > diff --git a/hw/isa/isa-bus.c b/hw/isa/isa-bus.c > index af6ffd6..630054c 100644 > --- a/hw/isa/isa-bus.c > +++ b/hw/isa/isa-bus.c > @@ -63,9 +63,6 @@ ISABus *isa_bus_new(DeviceState *dev, MemoryRegion* address_space, > > void isa_bus_irqs(ISABus *bus, qemu_irq *irqs) > { > - if (!bus) { > - hw_error("Can't set isa irqs with no isa bus present."); > - } > bus->irqs = irqs; > } > > @@ -137,10 +134,6 @@ ISADevice *isa_create(ISABus *bus, const char *name) > { > DeviceState *dev; > > - if (!bus) { > - hw_error("Tried to create isa device %s with no isa bus present.", > - name); > - } > dev = qdev_create(BUS(bus), name); > return ISA_DEVICE(dev); > } > @@ -149,10 +142,6 @@ ISADevice *isa_try_create(ISABus *bus, const char *name) > { > DeviceState *dev; > > - if (!bus) { > - hw_error("Tried to create isa device %s with no isa bus present.", > - name); > - } > dev = qdev_try_create(BUS(bus), name); > return ISA_DEVICE(dev); > } >