qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 10/12] isa: Clean up inappropriate hw_error()


From: Marcel Apfelbaum
Subject: Re: [Qemu-devel] [PATCH 10/12] isa: Clean up inappropriate hw_error()
Date: Thu, 10 Dec 2015 13:59:25 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0

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 <address@hidden>
Cc: "Michael S. Tsirkin" <address@hidden>
Cc: "Hervé Poussineau" <address@hidden>
Cc: Aurelien Jarno <address@hidden>
Cc: Mark Cave-Ayland <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
---
  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);
  }





reply via email to

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