aboutsummaryrefslogtreecommitdiff
path: root/hw/char/cadence_uart.c
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <philmd@linaro.org>2023-07-05 13:22:10 +0200
committerPhilippe Mathieu-Daudé <philmd@linaro.org>2023-08-31 19:47:43 +0200
commit53c7c924228a9227bfdbb4d2f92e657cb805a37d (patch)
treeaefea1f72addbc0c212bfc834414e2f98f211c0e /hw/char/cadence_uart.c
parentb3a1090fe55669e4ce19649525745ce551232a43 (diff)
hw/char: Have FEWatchFunc handlers return G_SOURCE_CONTINUE/REMOVE
GLib recommend to use G_SOURCE_REMOVE / G_SOURCE_CONTINUE for GSourceFunc callbacks. Our FEWatchFunc is a GSourceFunc returning such value. Use such definitions which are "more memorable" [*]. [*] https://docs.gtk.org/glib/callback.SourceFunc.html#return-value Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20230705133139.54419-5-philmd@linaro.org>
Diffstat (limited to 'hw/char/cadence_uart.c')
-rw-r--r--hw/char/cadence_uart.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/hw/char/cadence_uart.c b/hw/char/cadence_uart.c
index 807e398541..eff0304a18 100644
--- a/hw/char/cadence_uart.c
+++ b/hw/char/cadence_uart.c
@@ -307,11 +307,11 @@ static gboolean cadence_uart_xmit(void *do_not_use, GIOCondition cond,
/* instant drain the fifo when there's no back-end */
if (!qemu_chr_fe_backend_connected(&s->chr)) {
s->tx_count = 0;
- return FALSE;
+ return G_SOURCE_REMOVE;
}
if (!s->tx_count) {
- return FALSE;
+ return G_SOURCE_REMOVE;
}
ret = qemu_chr_fe_write(&s->chr, s->tx_fifo, s->tx_count);
@@ -326,12 +326,12 @@ static gboolean cadence_uart_xmit(void *do_not_use, GIOCondition cond,
cadence_uart_xmit, s);
if (!r) {
s->tx_count = 0;
- return FALSE;
+ return G_SOURCE_REMOVE;
}
}
uart_update_status(s);
- return FALSE;
+ return G_SOURCE_REMOVE;
}
static void uart_write_tx_fifo(CadenceUARTState *s, const uint8_t *buf,