[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: |
Marc-André Lureau |
Subject: |
Re: [Qemu-devel] [PATCH 05/54] char: fold single-user functions in caller |
Date: |
Mon, 2 Jan 2017 10:33:44 -0500 (EST) |
----- Original Message -----
> 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.
>
thanks, done
> Reviewed-by: Eric Blake <address@hidden>
>
> --
> Eric Blake eblake redhat com +1-919-301-3266
> Libvirt virtualization library http://libvirt.org
>
>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [Qemu-devel] [PATCH 05/54] char: fold single-user functions in caller,
Marc-André Lureau <=