alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Lars-Peter Clausen <lars@metafoo.de>
To: han.lu@intel.com, broonie@kernel.org, tiwai@suse.de,
	vinod.koul@intel.com, pierre-louis.bossart@linux.intel.com,
	liam.r.girdwood@linux.intel.com, alsa-devel@alsa-project.org
Subject: Re: [PATCH V3 1/2] ASoC: core: add API for registering DMI card names
Date: Thu, 31 Mar 2016 14:00:43 +0200	[thread overview]
Message-ID: <56FD116B.7000703@metafoo.de> (raw)
In-Reply-To: <79fd64c59dd44d44e018245ad411d48f5ba01b24.1459414492.git.han.lu@intel.com>

On 03/31/2016 10:58 AM, han.lu@intel.com wrote:
[...]
> +	name_size = strlen(card->name) + strlen(card->driver_name)
> +			+ strlen(vendor) + strlen(firmware) + 4;
> +	if (buf_size < name_size + strlen(card->snd_card->components))
> +		return -ENOMEM;
> +	name = kmalloc(buf_size, GFP_KERNEL);
> +	if (!name)
> +		return -ENOMEM;
> +	snprintf(name, buf_size, "%s:%s:%s:%s", card->name,
> +			card->driver_name, vendor, firmware);

Have a look at kasprintf(). It will allow you to simplify the code here

  reply	other threads:[~2016-03-31 12:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-31  8:58 [PATCH V3 0/2] ASoC: share more product information with user space han.lu
2016-03-31  8:58 ` [PATCH V3 1/2] ASoC: core: add API for registering DMI card names han.lu
2016-03-31 12:00   ` Lars-Peter Clausen [this message]
2016-03-31 14:48     ` Lu, Han
2016-03-31  8:58 ` [PATCH V3 2/2] ASoC: bytcr-rt5640: register DMI names to card han.lu

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=56FD116B.7000703@metafoo.de \
    --to=lars@metafoo.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=han.lu@intel.com \
    --cc=liam.r.girdwood@linux.intel.com \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=tiwai@suse.de \
    --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;
as well as URLs for NNTP newsgroup(s).