alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: Jaroslav Kysela <perex@perex.cz>,
	ALSA development <alsa-devel@alsa-project.org>
Cc: Takashi Iwai <tiwai@suse.de>, Mark Brown <broonie@kernel.org>
Subject: Re: [alsa-devel] [PATCH 1/2] ASoC: improve the DMI long card code in asoc-core
Date: Wed, 20 Nov 2019 08:55:54 -0600	[thread overview]
Message-ID: <dfe78a0b-1cb6-ce19-61bd-86cfded0e3d5@linux.intel.com> (raw)
In-Reply-To: <20191120093712.11370-1-perex@perex.cz>



On 11/20/19 3:37 AM, Jaroslav Kysela wrote:
> Add append_dmi_string() function and make the code more readable.
> 
> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
> Cc: Mark Brown <broonie@kernel.org>
> ---
>   sound/soc/soc-core.c | 66 +++++++++++++++++---------------------------
>   1 file changed, 25 insertions(+), 41 deletions(-)
> 
> diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
> index b4683d4588ee..1d1baf78818c 100644
> --- a/sound/soc/soc-core.c
> +++ b/sound/soc/soc-core.c
> @@ -1755,6 +1755,23 @@ static int is_dmi_valid(const char *field)
>   	return 1;
>   }
>   
> +/*
> + *
> + */

unneeded comments or missing text?

> +static void append_dmi_string(struct snd_soc_card *card, const char *str)
> +{
> +	char *dst = card->dmi_longname;
> +	size_t dst_len = sizeof(card->dmi_longname);
> +	size_t len;
> +
> +	len = strlen(dst);
> +	snprintf(dst + len, dst_len - len, "-%s", str);
> +
> +	len++;	/* skip the separator "-" */
> +	if (len < dst_len)
> +		cleanup_dmi_name(dst + len);
> +}
> +
>   /**
>    * snd_soc_set_dmi_name() - Register DMI names to card
>    * @card: The card to register DMI names
> @@ -1789,61 +1806,36 @@ static int is_dmi_valid(const char *field)
>   int snd_soc_set_dmi_name(struct snd_soc_card *card, const char *flavour)
>   {
>   	const char *vendor, *product, *product_version, *board;
> -	size_t longname_buf_size = sizeof(card->snd_card->longname);
> -	size_t len;
>   
>   	if (card->long_name)
>   		return 0; /* long name already set by driver or from DMI */
>   
> -	/* make up dmi long name as: vendor.product.version.board */
> +	/* make up dmi long name as: vendor-product-version-board */

here you are just fixing a misleading comment, yes?
I don't see any dots to dashes substitution but better ask.
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

  parent reply	other threads:[~2019-11-20 16:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-20  9:37 [alsa-devel] [PATCH 1/2] ASoC: improve the DMI long card code in asoc-core Jaroslav Kysela
2019-11-20  9:37 ` [alsa-devel] [PATCH 2/2] ASoC: DMI long name - avoid to add board name if matches with product name Jaroslav Kysela
2019-11-20 14:55 ` Pierre-Louis Bossart [this message]
2019-11-20 17:28   ` [alsa-devel] [PATCH 1/2] ASoC: improve the DMI long card code in asoc-core Jaroslav Kysela

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=dfe78a0b-1cb6-ce19-61bd-86cfded0e3d5@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.de \
    /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).