[Top][All Lists]

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

Re: [PATCH v2 02/22] hw/rtc/m48t59-isa: QOM'ify IRQ number

From: Philippe Mathieu-Daudé
Subject: Re: [PATCH v2 02/22] hw/rtc/m48t59-isa: QOM'ify IRQ number
Date: Sun, 27 Feb 2022 23:13:27 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.6.1

On 22/2/22 20:34, Bernhard Beschow wrote:
Exposing the IRQ number as a QOM property not only allows it to be
configurable but also to be printed by standard QOM mechanisms. This allows
isabus_dev_print() to be retired eventually.

Signed-off-by: Bernhard Beschow <shentey@gmail.com>
  hw/rtc/m48t59-isa.c | 9 ++++++++-
  1 file changed, 8 insertions(+), 1 deletion(-)

@@ -97,9 +99,14 @@ static void m48t59_isa_realize(DeviceState *dev, Error 
      M48txxISAState *d = M48TXX_ISA(dev);
      M48t59State *s = &d->state;
+ if (d->isairq >= ISA_NUM_IRQS) {
+        error_setg(errp, "Maximum value for \"irq\" is: %d", ISA_NUM_IRQS - 1);

Format is "%u".

+        return;
+    }

Similarly to patch #1, ISA_NUM_IRQS fits in uint8_t. Otherwise:

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

reply via email to

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