[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [qemu-s390x] [PATCH v3 20/25] s390x/sclp: Use a const variable to im
From: |
Cornelia Huck |
Subject: |
Re: [qemu-s390x] [PATCH v3 20/25] s390x/sclp: Use a const variable to improve readability |
Date: |
Wed, 20 Feb 2019 11:53:16 +0100 |
On Wed, 20 Feb 2019 02:02:27 +0100
Philippe Mathieu-Daudé <address@hidden> wrote:
> We will reuse this variable in the next patch.
>
> Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
> ---
> hw/char/sclpconsole-lm.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/hw/char/sclpconsole-lm.c b/hw/char/sclpconsole-lm.c
> index dbc91a1e5b..49543e2c83 100644
> --- a/hw/char/sclpconsole-lm.c
> +++ b/hw/char/sclpconsole-lm.c
> @@ -210,13 +210,14 @@ static int process_mdb(SCLPEvent *event, MDBO *mdbo)
> int rc;
> int len;
> uint8_t buffer[SIZE_BUFFER];
> -
> - len = be16_to_cpu(mdbo->length);
> - len -= sizeof(mdbo->length) + sizeof(mdbo->type)
> + const size_t hlen = sizeof(mdbo->length)
> + + sizeof(mdbo->type)
> + sizeof(mdbo->mto.line_type_flags)
> + sizeof(mdbo->mto.alarm_control)
> + sizeof(mdbo->mto._reserved);
>
> + len = be16_to_cpu(mdbo->length);
> + len -= hlen;
> assert(len <= SIZE_BUFFER);
>
> /* convert EBCDIC SCLP contents to ASCII console message */
I'd probably merge this with the next patch, though.
Reviewed-by: Cornelia Huck <address@hidden>
- [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
- Re: [qemu-s390x] [PATCH v3 20/25] s390x/sclp: Use a const variable to improve readability,
Cornelia Huck <=
- [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
- [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