@samitouri / QOSamiQemu / commits / 4b376e710e

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>

Bernhard Beschow committed Mar 5, 2026 at 23:09 UTC 4b376e710e1090be6b367228d28946068ac9f37f
1 file changed +6 -6
hw/char/serial.c
+6 -6
@@ -715,7 +715,7 @@ static const VMStateDescription vmstate_serial_thr_ipending = {
715
716 static bool serial_tsr_needed(void *opaque)
717 {
718 - SerialState *s = (SerialState *)opaque;
718 + SerialState *s = opaque;
719 return s->tsr_retry != 0;
720 }
721
@@ -734,7 +734,7 @@ static const VMStateDescription vmstate_serial_tsr = {
734
735 static bool serial_recv_fifo_needed(void *opaque)
736 {
737 - SerialState *s = (SerialState *)opaque;
737 + SerialState *s = opaque;
738 return !fifo8_is_empty(&s->recv_fifo);
739
740 }
@@ -752,7 +752,7 @@ static const VMStateDescription vmstate_serial_recv_fifo = {
752
753 static bool serial_xmit_fifo_needed(void *opaque)
754 {
755 - SerialState *s = (SerialState *)opaque;
755 + SerialState *s = opaque;
756 return !fifo8_is_empty(&s->xmit_fifo);
757 }
758
@@ -769,7 +769,7 @@ static const VMStateDescription vmstate_serial_xmit_fifo = {
769
770 static bool serial_fifo_timeout_timer_needed(void *opaque)
771 {
772 - SerialState *s = (SerialState *)opaque;
772 + SerialState *s = opaque;
773 return timer_pending(s->fifo_timeout_timer);
774 }
775
@@ -786,7 +786,7 @@ static const VMStateDescription vmstate_serial_fifo_timeout_timer = {
786
787 static bool serial_timeout_ipending_needed(void *opaque)
788 {
789 - SerialState *s = (SerialState *)opaque;
789 + SerialState *s = opaque;
790 return s->timeout_ipending != 0;
791 }
792
@@ -803,7 +803,7 @@ static const VMStateDescription vmstate_serial_timeout_ipending = {
803
804 static bool serial_poll_needed(void *opaque)
805 {
806 - SerialState *s = (SerialState *)opaque;
806 + SerialState *s = opaque;
807 return s->poll_msl >= 0;
808 }
809