]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
hw/char/serial: Let compiler pick serial_mm_ops[] array length
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Tue, 16 Dec 2025 09:53:03 +0000 (10:53 +0100)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Tue, 30 Dec 2025 19:38:40 +0000 (20:38 +0100)
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é <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20251224134644.85582-4-philmd@linaro.org>

hw/char/serial-mm.c

index 6e963e581f952e3685dd5220e88513aed1a9f82d..0e0be26fa9fa654e2b90205c83d4cb1c3a49e30e 100644 (file)
@@ -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,