All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oleksandr Grytsov <al1img@gmail.com>
To: Wei Liu <wei.liu2@citrix.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
	Ian Jackson <ian.jackson@eu.citrix.com>,
	Oleksandr Grytsov <oleksandr_grytsov@epam.com>
Subject: Re: [PATCH 1/5] libxl: add PV sound device
Date: Tue, 31 Oct 2017 16:51:48 +0200	[thread overview]
Message-ID: <CACvf2oVQjgjo_c+VPseZMkXxpAph9-3vPpBYHh7zaM-X_J8w=Q@mail.gmail.com> (raw)
In-Reply-To: <20171030173919.xdxeqnj53kiw3ayd@citrix.com>


[-- Attachment #1.1: Type: text/plain, Size: 3398 bytes --]

On Mon, Oct 30, 2017 at 7:39 PM, Wei Liu <wei.liu2@citrix.com> wrote:

> On Mon, Oct 02, 2017 at 12:49:20PM +0300, Oleksandr Grytsov wrote:
> > From: Oleksandr Grytsov <oleksandr_grytsov@epam.com>
> >
> > Add PV sound device described in sndif.h
> >
> > Signed-off-by: Oleksandr Grytsov <oleksandr_grytsov@epam.com>
>
> [...]
> >
> >  libxl__console_backend = Enumeration("console_backend", [
> > diff --git a/tools/libxl/libxl_vsnd.c b/tools/libxl/libxl_vsnd.c
> > new file mode 100644
> > index 0000000..26885f9
> > --- /dev/null
> > +++ b/tools/libxl/libxl_vsnd.c
> > @@ -0,0 +1,307 @@
> > +/*
> > + * Copyright (C) 2016 EPAM Systems Inc.
> > + *
> > + * This program is free software; you can redistribute it and/or modify
> > + * it under the terms of the GNU Lesser General Public License as
> published
> > + * by the Free Software Foundation; version 2.1 only. with the special
> > + * exception on linking described in file LICENSE.
> > + *
> > + * This program is distributed in the hope that it will be useful,
> > + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> > + * GNU Lesser General Public License for more details.
> > + */
> > +
> > +#include "libxl_internal.h"
> > +#include "xen/io/sndif.h"
> > +
>
> Use <xen/io/sndif.h> -- this is not a local header.
>
> > +
> > +static unsigned int libxl__rates_to_str_vsnd(char *str, uint32_t
> *sample_rates,
> > +                                             int num_sample_rates)
> > +{
> > +    unsigned int len;
> > +    int i;
> > +
> > +    len = 0;
> > +
> > +    if (num_sample_rates == 0) {
> > +        return len;
> > +    }
>
> Coding style.
>
> > +
> > +    for (i = 0; i < num_sample_rates - 1; i++) {
> > +        if (str) {
> > +            len += sprintf(&str[len], "%u,", sample_rates[i]);
>
> libxl__sprintf(NOGC, ...)
>
> > +        } else {
> > +            len += snprintf(NULL, 0, "%u,", sample_rates[i]);
> > +        }
> > +    }
> > +
> > +    if (str) {
> > +        len += sprintf(&str[len], "%u", sample_rates[i]);
> > +    } else {
> > +        len += snprintf(NULL, 0, "%u", sample_rates[i]);
> > +    }
> > +
> > +    return len;
> > +}
> > +
> [...]
> > +
> > +static int libxl__set_params_vsnd(libxl__gc *gc, char *path,
> > +                                  libxl_vsnd_params *params,
> flexarray_t *front)
> > +{
> > +    char *buffer;
> > +    int len;
> > +    int rc;
> > +
> > +    if (params->sample_rates) {
> > +        // calculate required string size;
>
> Coding style.


Sorry, could you specify more precisely what has to be changed in this
place?


>
> > +        len = libxl__rates_to_str_vsnd(NULL, params->sample_rates,
> > +                                       params->num_sample_rates);
> > +
> > +        if (len) {
> > +            buffer = libxl__malloc(gc, len + 1);
> > +
> > +            libxl__rates_to_str_vsnd(buffer, params->sample_rates,
> > +                                     params->num_sample_rates);
> > +            rc = flexarray_append_pair(front,
> > +                                       GCSPRINTF("%s"XENSND_FIELD_
> SAMPLE_RATES,
> > +                                                 path), buffer);
> > +            if (rc) return rc;
>
> goto out please.
>
> Please fix these coding style issues throughout this series.j
>



-- 
Best Regards,
Oleksandr Grytsov.

[-- Attachment #1.2: Type: text/html, Size: 5100 bytes --]

[-- Attachment #2: Type: text/plain, Size: 127 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2017-10-31 14:51 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-02  9:49 [PATCH 0/5] libxl: add PV sound device Oleksandr Grytsov
2017-10-02  9:49 ` [PATCH 1/5] " Oleksandr Grytsov
2017-10-30 17:39   ` Wei Liu
2017-10-31 14:51     ` Oleksandr Grytsov [this message]
2017-10-31 14:54       ` Wei Liu
2017-10-31 15:00     ` Oleksandr Grytsov
2017-10-02  9:49 ` [PATCH 2/5] libxl: add vsnd list and info Oleksandr Grytsov
2017-10-30 17:51   ` Wei Liu
2017-10-02  9:49 ` [PATCH 3/5] xl: add PV sound condif parser Oleksandr Grytsov
2017-10-30 17:58   ` Wei Liu
2017-10-02  9:49 ` [PATCH 4/5] xl: add vsnd CLI commands Oleksandr Grytsov
2017-10-30 17:59   ` Wei Liu
2017-10-02  9:49 ` [PATCH 5/5] docs: add PV sound device config Oleksandr Grytsov
2017-10-30 18:00   ` Marek Marczykowski-Górecki
2017-10-31 15:54     ` Oleksandr Grytsov
2017-10-24  7:27 ` [PATCH 0/5] libxl: add PV sound device Oleksandr Grytsov
2017-10-30 12:36   ` Oleksandr Grytsov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CACvf2oVQjgjo_c+VPseZMkXxpAph9-3vPpBYHh7zaM-X_J8w=Q@mail.gmail.com' \
    --to=al1img@gmail.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=oleksandr_grytsov@epam.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.