[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [qemu-s390x] [PATCH v3 14/25] virtio-serial: Let VirtIOSerialPortCla
From: |
Marc-André Lureau |
Subject: |
Re: [qemu-s390x] [PATCH v3 14/25] virtio-serial: Let VirtIOSerialPortClass::have_data() use size_t |
Date: |
Wed, 20 Feb 2019 12:21:32 +0100 |
On Wed, Feb 20, 2019 at 2:06 AM Philippe Mathieu-Daudé
<address@hidden> wrote:
>
> 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>
Reviewed-by: Marc-André Lureau <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.
have_data() return value? yes, the code may have change and the
comment doesn't seem to reflect accurately what's going on.
> ---
> 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
>
- [qemu-s390x] [PATCH v3 00/25] chardev: Convert qemu_chr_write() to take a size_t argument, Philippe Mathieu-Daudé, 2019/02/19
- [qemu-s390x] [PATCH v3 15/25] spapr-vty: Let vty_putchars() use size_t, Philippe Mathieu-Daudé, 2019/02/19
- [qemu-s390x] [PATCH v3 20/25] s390x/sclp: Use a const variable to improve readability, Philippe Mathieu-Daudé, 2019/02/19
- [qemu-s390x] [PATCH v3 12/25] xen: Let buffer_append() return the size consumed, Philippe Mathieu-Daudé, 2019/02/19
- [qemu-s390x] [PATCH v3 14/25] virtio-serial: Let VirtIOSerialPortClass::have_data() use size_t, Philippe Mathieu-Daudé, 2019/02/19
- Re: [qemu-s390x] [PATCH v3 14/25] virtio-serial: Let VirtIOSerialPortClass::have_data() use size_t,
Marc-André Lureau <=
- [qemu-s390x] [PATCH v3 09/25] vhost-user: Express sizeof with size_t, Philippe Mathieu-Daudé, 2019/02/19
- [qemu-s390x] [PATCH v3 07/25] gdbstub: Let put_buffer() use size_t, Philippe Mathieu-Daudé, 2019/02/19
- [qemu-s390x] [PATCH v3 06/25] gdbstub: Use size_t to hold GDBState::last_packet_len, Philippe Mathieu-Daudé, 2019/02/19
- [qemu-s390x] [RFC PATCH v3 13/25] xen: Let buffer_append() return a size_t, Philippe Mathieu-Daudé, 2019/02/19
- [qemu-s390x] [PATCH v3 11/25] xen: Let xencons_send() take a 'size' argument, Philippe Mathieu-Daudé, 2019/02/19