From: Takashi Iwai <tiwai@suse.de>
To: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Cc: Vinod Koul <vinod.koul@intel.com>,
alsa-devel@alsa-project.org, Mark Brown <broonie@kernel.org>
Subject: Re: [PATCH v2 03/13] topology: Add topology core parser.
Date: Wed, 01 Jul 2015 18:00:16 +0200 [thread overview]
Message-ID: <s5hegkrlvfz.wl-tiwai@suse.de> (raw)
In-Reply-To: <1435758275-4047-3-git-send-email-liam.r.girdwood@linux.intel.com>
At Wed, 1 Jul 2015 14:44:25 +0100,
Liam Girdwood wrote:
>
> +int tplg_parse_compound(snd_tplg_t *tplg, snd_config_t *cfg,
> + int (*fcn)(snd_tplg_t *, snd_config_t *, void *),
> + void *private)
> +{
> + const char *id;
> + snd_config_iterator_t i, next;
> + snd_config_t *n;
> + int err = -EINVAL;
> +
> + if (snd_config_get_id(cfg, &id) < 0)
> + return -EINVAL;
> +
> + if (snd_config_get_type(cfg) != SND_CONFIG_TYPE_COMPOUND) {
> + fprintf(stderr, "error: compound type expected for %s", id);
It's not good to print an error unconditionally from a system
library. Better to use SNDERR() macro.
> +int snd_tplg_build(snd_tplg_t *tplg, const char *infile, const char *outfile)
> +{
> + snd_config_t *cfg = NULL;
> + int err = 0;
> +
> + /* delete any old output files */
> + unlink(outfile);
> +
> + tplg->out_fd =
> + open(outfile, O_RDWR | O_CREAT, S_IRWXU | S_IRWXG | S_IRWXO);
> + if (tplg->out_fd < 0) {
> + fprintf(stderr, "error: failed to open %s err %d\n",
> + outfile, -errno);
> + return -errno;
> + }
> +
> + err = tplg_load_config(infile, &cfg);
> + if (err < 0) {
> + fprintf(stderr, "error: failed to load topology file %s\n",
> + infile);
> + return err;
The outfile is left opened.
Takashi
next prev parent reply other threads:[~2015-07-01 16:00 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-01 13:44 [PATCH v2 01/13] topology: uapi: Add UAPI headers for topology ABI Liam Girdwood
2015-07-01 13:44 ` [PATCH v2 02/13] conf: topology: Add topology file for broadwell audio DSP Liam Girdwood
2015-07-01 15:47 ` Takashi Iwai
2015-07-01 16:16 ` Liam Girdwood
2015-07-01 13:44 ` [PATCH v2 03/13] topology: Add topology core parser Liam Girdwood
2015-07-01 16:00 ` Takashi Iwai [this message]
2015-07-01 13:44 ` [PATCH v2 04/13] topology: Add text section parser Liam Girdwood
2015-07-01 16:03 ` Takashi Iwai
2015-07-01 13:44 ` [PATCH v2 05/13] topology: Add PCM parser Liam Girdwood
2015-07-01 16:14 ` Takashi Iwai
2015-07-01 16:20 ` Liam Girdwood
2015-07-01 13:44 ` [PATCH v2 06/13] topology: Add operations parser Liam Girdwood
2015-07-01 13:44 ` [PATCH v2 07/13] topology: Add private data parser Liam Girdwood
2015-07-01 16:20 ` Takashi Iwai
2015-07-07 15:54 ` Liam Girdwood
2015-07-07 16:19 ` Takashi Iwai
2015-07-08 8:57 ` Liam Girdwood
2015-07-08 13:31 ` Jin, Yao
2015-07-08 14:14 ` Takashi Iwai
2015-07-08 14:21 ` Liam Girdwood
2015-07-01 13:44 ` [PATCH v2 08/13] topology: Add DAPM object parser Liam Girdwood
2015-07-01 13:44 ` [PATCH v2 09/13] topology: Add CTL parser Liam Girdwood
2015-07-01 13:44 ` [PATCH v2 10/13] topology: Add Channel map parser Liam Girdwood
2015-07-01 13:44 ` [PATCH v2 11/13] topology: Add binary file builder Liam Girdwood
2015-07-01 13:44 ` [PATCH v2 12/13] topology: autotools: Add build support for topology core Liam Girdwood
2015-07-01 13:44 ` [PATCH v2 13/13] topology: doxygen: Add doxygen " Liam Girdwood
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=s5hegkrlvfz.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=liam.r.girdwood@linux.intel.com \
--cc=vinod.koul@intel.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox