From 56ae448867f2cc5cfdbf2c2b3bd0e4bcc16569ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Tue, 16 Dec 2025 10:53:03 +0100 Subject: [PATCH] hw/char/serial: Let compiler pick serial_mm_ops[] array length MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit No need to enforce the MemoryRegionOps array length. We index by device_endian enum, the compiler will easily pick the correct length. Besides, this allow further adjustments in the device_endian enum itself. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20251224134644.85582-4-philmd@linaro.org> --- hw/char/serial-mm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/char/serial-mm.c b/hw/char/serial-mm.c index 6e963e581f..0e0be26fa9 100644 --- a/hw/char/serial-mm.c +++ b/hw/char/serial-mm.c @@ -44,7 +44,7 @@ static void serial_mm_write(void *opaque, hwaddr addr, serial_io_ops.write(&s->serial, addr >> s->regshift, value, 1); } -static const MemoryRegionOps serial_mm_ops[3] = { +static const MemoryRegionOps serial_mm_ops[] = { [DEVICE_NATIVE_ENDIAN] = { .read = serial_mm_read, .write = serial_mm_write,