Commit 4b376e710e for qemu.org

commit 4b376e710e1090be6b367228d28946068ac9f37f
Author: Bernhard Beschow <shentey@gmail.com>
Date:   Thu Mar 5 23:09:02 2026 +0100

    hw/char/serial: Remove explicit cast from void pointer

    A void pointer asks for being casted, so C allows for omitting the
    explicit cast. Take advantage of that.

    Signed-off-by: Bernhard Beschow <shentey@gmail.com>
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
    Message-ID: <20260305220911.131508-6-shentey@gmail.com>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>

diff --git a/hw/char/serial.c b/hw/char/serial.c
index adbd1d1d4a..0f2e79dfba 100644
--- a/hw/char/serial.c
+++ b/hw/char/serial.c
@@ -715,7 +715,7 @@ static const VMStateDescription vmstate_serial_thr_ipending = {

 static bool serial_tsr_needed(void *opaque)
 {
-    SerialState *s = (SerialState *)opaque;
+    SerialState *s = opaque;
     return s->tsr_retry != 0;
 }

@@ -734,7 +734,7 @@ static const VMStateDescription vmstate_serial_tsr = {

 static bool serial_recv_fifo_needed(void *opaque)
 {
-    SerialState *s = (SerialState *)opaque;
+    SerialState *s = opaque;
     return !fifo8_is_empty(&s->recv_fifo);

 }
@@ -752,7 +752,7 @@ static const VMStateDescription vmstate_serial_recv_fifo = {

 static bool serial_xmit_fifo_needed(void *opaque)
 {
-    SerialState *s = (SerialState *)opaque;
+    SerialState *s = opaque;
     return !fifo8_is_empty(&s->xmit_fifo);
 }

@@ -769,7 +769,7 @@ static const VMStateDescription vmstate_serial_xmit_fifo = {

 static bool serial_fifo_timeout_timer_needed(void *opaque)
 {
-    SerialState *s = (SerialState *)opaque;
+    SerialState *s = opaque;
     return timer_pending(s->fifo_timeout_timer);
 }

@@ -786,7 +786,7 @@ static const VMStateDescription vmstate_serial_fifo_timeout_timer = {

 static bool serial_timeout_ipending_needed(void *opaque)
 {
-    SerialState *s = (SerialState *)opaque;
+    SerialState *s = opaque;
     return s->timeout_ipending != 0;
 }

@@ -803,7 +803,7 @@ static const VMStateDescription vmstate_serial_timeout_ipending = {

 static bool serial_poll_needed(void *opaque)
 {
-    SerialState *s = (SerialState *)opaque;
+    SerialState *s = opaque;
     return s->poll_msl >= 0;
 }