All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] isa-bus.c: use hw_error instead of fprintf
@ 2010-12-03 11:05 Tristan Gingold
  2010-12-11 18:35 ` Blue Swirl
  0 siblings, 1 reply; 2+ messages in thread
From: Tristan Gingold @ 2010-12-03 11:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: Tristan Gingold

Minor clean-up in isa-bus.c.  Using hw_error is more consistent.
There is a difference however: hw_error dumps the cpu state.

Signed-off-by: Tristan Gingold <gingold@adacore.com>
---
 hw/isa-bus.c |   11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/hw/isa-bus.c b/hw/isa-bus.c
index 4e306de..3a6c961 100644
--- a/hw/isa-bus.c
+++ b/hw/isa-bus.c
@@ -68,12 +68,10 @@ void isa_bus_irqs(qemu_irq *irqs)
 qemu_irq isa_reserve_irq(int isairq)
 {
     if (isairq < 0 || isairq > 15) {
-        fprintf(stderr, "isa irq %d invalid\n", isairq);
-        exit(1);
+        hw_error("isa irq %d invalid", isairq);
     }
     if (isabus->assigned & (1 << isairq)) {
-        fprintf(stderr, "isa irq %d already assigned\n", isairq);
-        exit(1);
+        hw_error("isa irq %d already assigned", isairq);
     }
     isabus->assigned |= (1 << isairq);
     return isabus->irqs[isairq];
@@ -83,8 +81,7 @@ void isa_init_irq(ISADevice *dev, qemu_irq *p, int isairq)
 {
     assert(dev->nirqs < ARRAY_SIZE(dev->isairq));
     if (isabus->assigned & (1 << isairq)) {
-        fprintf(stderr, "isa irq %d already assigned\n", isairq);
-        exit(1);
+        hw_error("isa irq %d already assigned", isairq);
     }
     isabus->assigned |= (1 << isairq);
     dev->isairq[dev->nirqs] = isairq;
@@ -115,7 +112,7 @@ ISADevice *isa_create(const char *name)
     DeviceState *dev;
 
     if (!isabus) {
-        hw_error("Tried to create isa device %s with no isa bus present.\n",
+        hw_error("Tried to create isa device %s with no isa bus present.",
                  name);
     }
     dev = qdev_create(&isabus->qbus, name);
-- 
1.7.3.GIT

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] isa-bus.c: use hw_error instead of fprintf
  2010-12-03 11:05 [Qemu-devel] [PATCH] isa-bus.c: use hw_error instead of fprintf Tristan Gingold
@ 2010-12-11 18:35 ` Blue Swirl
  0 siblings, 0 replies; 2+ messages in thread
From: Blue Swirl @ 2010-12-11 18:35 UTC (permalink / raw)
  To: Tristan Gingold; +Cc: qemu-devel

Thanks, applied.

On Fri, Dec 3, 2010 at 11:05 AM, Tristan Gingold <gingold@adacore.com> wrote:
> Minor clean-up in isa-bus.c.  Using hw_error is more consistent.
> There is a difference however: hw_error dumps the cpu state.
>
> Signed-off-by: Tristan Gingold <gingold@adacore.com>
> ---
>  hw/isa-bus.c |   11 ++++-------
>  1 files changed, 4 insertions(+), 7 deletions(-)
>
> diff --git a/hw/isa-bus.c b/hw/isa-bus.c
> index 4e306de..3a6c961 100644
> --- a/hw/isa-bus.c
> +++ b/hw/isa-bus.c
> @@ -68,12 +68,10 @@ void isa_bus_irqs(qemu_irq *irqs)
>  qemu_irq isa_reserve_irq(int isairq)
>  {
>     if (isairq < 0 || isairq > 15) {
> -        fprintf(stderr, "isa irq %d invalid\n", isairq);
> -        exit(1);
> +        hw_error("isa irq %d invalid", isairq);
>     }
>     if (isabus->assigned & (1 << isairq)) {
> -        fprintf(stderr, "isa irq %d already assigned\n", isairq);
> -        exit(1);
> +        hw_error("isa irq %d already assigned", isairq);
>     }
>     isabus->assigned |= (1 << isairq);
>     return isabus->irqs[isairq];
> @@ -83,8 +81,7 @@ void isa_init_irq(ISADevice *dev, qemu_irq *p, int isairq)
>  {
>     assert(dev->nirqs < ARRAY_SIZE(dev->isairq));
>     if (isabus->assigned & (1 << isairq)) {
> -        fprintf(stderr, "isa irq %d already assigned\n", isairq);
> -        exit(1);
> +        hw_error("isa irq %d already assigned", isairq);
>     }
>     isabus->assigned |= (1 << isairq);
>     dev->isairq[dev->nirqs] = isairq;
> @@ -115,7 +112,7 @@ ISADevice *isa_create(const char *name)
>     DeviceState *dev;
>
>     if (!isabus) {
> -        hw_error("Tried to create isa device %s with no isa bus present.\n",
> +        hw_error("Tried to create isa device %s with no isa bus present.",
>                  name);
>     }
>     dev = qdev_create(&isabus->qbus, name);
> --
> 1.7.3.GIT
>
>
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-12-11 18:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-03 11:05 [Qemu-devel] [PATCH] isa-bus.c: use hw_error instead of fprintf Tristan Gingold
2010-12-11 18:35 ` Blue Swirl

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.