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 <shen...@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 
**errp)
      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é <f4...@amsat.org>

Reply via email to