qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 05/54] char: fold single-user functions in calle


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH 05/54] char: fold single-user functions in caller
Date: Wed, 14 Dec 2016 10:05:11 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1

On 12/12/2016 04:42 PM, Marc-André Lureau wrote:
> This shorten a bit the code.

Grammar:
This shortens the code a bit.

> 
> Signed-off-by: Marc-André Lureau <address@hidden>
> ---
>  qemu-char.c | 97 
> ++++++++++++++++++++-----------------------------------------
>  1 file changed, 31 insertions(+), 66 deletions(-)
> 

>      name = g_strdup_printf("chardev-udp-%s", chr->label);
>      qio_channel_set_name(QIO_CHANNEL(sioc), name);
>      g_free(name);
>  
> +    s = g_new0(NetCharDriver, 1);
> +    s->ioc = QIO_CHANNEL(sioc);
> +    s->bufcnt = 0;
> +    s->bufptr = 0;
> +    chr->opaque = s;
> +    /* be isn't opened until we get a connection */
> +    *be_opened = false;

The assignments to 0 and false are redundant with the g_new0(), if you
want to drop them for even more code reduction.

Reviewed-by: Eric Blake <address@hidden>

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]