[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 14/25] virtio-serial: Let VirtIOSerialPortClass::
From: |
Philippe Mathieu-Daudé |
Subject: |
[Qemu-devel] [PATCH v3 14/25] virtio-serial: Let VirtIOSerialPortClass::have_data() use size_t |
Date: |
Wed, 20 Feb 2019 02:02:21 +0100 |
Both callers in hw/char/virtio-serial-bus.c provide unsigned values,
even the trace event display an unsigned value.
Convert the have_data() handler to take an unsigned value.
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
It is funny/scary that there are big comments about how to treat
errors to set the return value, then the return value is simply
ignored by the caller.
---
hw/char/virtio-console.c | 2 +-
include/hw/virtio/virtio-serial.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/char/virtio-console.c b/hw/char/virtio-console.c
index 2cbe1d4ed5..19639dca3b 100644
--- a/hw/char/virtio-console.c
+++ b/hw/char/virtio-console.c
@@ -45,7 +45,7 @@ static gboolean chr_write_unblocked(GIOChannel *chan,
GIOCondition cond,
/* Callback function that's called when the guest sends us data */
static ssize_t flush_buf(VirtIOSerialPort *port,
- const uint8_t *buf, ssize_t len)
+ const uint8_t *buf, size_t len)
{
VirtConsole *vcon = VIRTIO_CONSOLE(port);
ssize_t ret;
diff --git a/include/hw/virtio/virtio-serial.h
b/include/hw/virtio/virtio-serial.h
index 12657a9f39..f1a5ccf4f7 100644
--- a/include/hw/virtio/virtio-serial.h
+++ b/include/hw/virtio/virtio-serial.h
@@ -81,7 +81,7 @@ typedef struct VirtIOSerialPortClass {
* 'len'. In this case, throttling will be enabled for this port.
*/
ssize_t (*have_data)(VirtIOSerialPort *port, const uint8_t *buf,
- ssize_t len);
+ size_t len);
} VirtIOSerialPortClass;
/*
--
2.20.1
- Re: [Qemu-devel] [PATCH v3 10/25] usb-redir: Verify usbredirparser_write get called with positive count, (continued)
- [Qemu-devel] [PATCH v3 15/25] spapr-vty: Let vty_putchars() use size_t, Philippe Mathieu-Daudé, 2019/02/19
- [Qemu-devel] [PATCH v3 20/25] s390x/sclp: Use a const variable to improve readability, Philippe Mathieu-Daudé, 2019/02/19
- [Qemu-devel] [PATCH v3 23/25] hw/ipmi: Assert outlen > outpos, Philippe Mathieu-Daudé, 2019/02/19
- [Qemu-devel] [PATCH v3 12/25] xen: Let buffer_append() return the size consumed, Philippe Mathieu-Daudé, 2019/02/19
- [Qemu-devel] [PATCH v3 14/25] virtio-serial: Let VirtIOSerialPortClass::have_data() use size_t,
Philippe Mathieu-Daudé <=
- [Qemu-devel] [PATCH v3 09/25] vhost-user: Express sizeof with size_t, Philippe Mathieu-Daudé, 2019/02/19
- [Qemu-devel] [PATCH v3 07/25] gdbstub: Let put_buffer() use size_t, Philippe Mathieu-Daudé, 2019/02/19
- [Qemu-devel] [RFC PATCH v3 13/25] xen: Let buffer_append() return a size_t, Philippe Mathieu-Daudé, 2019/02/19
- [Qemu-devel] [PATCH v3 06/25] gdbstub: Use size_t to hold GDBState::last_packet_len, Philippe Mathieu-Daudé, 2019/02/19
- [Qemu-devel] [PATCH v3 05/25] gdbstub: Use size_t for strlen() return value, Philippe Mathieu-Daudé, 2019/02/19