Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Jarkko Nikula <jarkko.nikula@nokia.com>
Cc: alsa-devel@alsa-project.org
Subject: Re: Using ARRAY_SIZE macro when setting up ASoC audio map?
Date: Wed, 27 Feb 2008 17:15:49 +0100	[thread overview]
Message-ID: <s5hy796s7d6.wl%tiwai@suse.de> (raw)
In-Reply-To: <20080227134923.aa37870c.jarkko.nikula@nokia.com>

At Wed, 27 Feb 2008 13:49:23 +0200,
Jarkko Nikula wrote:
> 
> Does an example patch to spitz below make any sense? Yep, noticed when forgot to add array terminator to own code :-)
> 
> diff --git a/sound/soc/pxa/spitz.c b/sound/soc/pxa/spitz.c
> index d56709e..1cffcd3 100644
> --- a/sound/soc/pxa/spitz.c
> +++ b/sound/soc/pxa/spitz.c
> @@ -268,8 +268,6 @@ static const char *audio_map[][3] = {
>  
>  	/* line is connected to input 1 - no bias */
>  	{"LINPUT1", NULL, "Line Jack"},
> -
> -	{NULL, NULL, NULL},
>  };
>  
>  static const char *jack_function[] = {"Headphone", "Mic", "Line", "Headset",
> @@ -317,7 +315,7 @@ static int spitz_wm8750_init(struct snd_soc_codec *codec)
>  	}
>  
>  	/* Set up spitz specific audio path audio_map */
> -	for (i = 0; audio_map[i][0] != NULL; i++) {
> +	for (i = 0; i < ARRAY_SIZE(audio_map); i++) {

Does ARRAY_SIZE() work with two-dimensional arrays?  Just wondering...


Takashi

  parent reply	other threads:[~2008-02-27 16:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-27 11:49 Using ARRAY_SIZE macro when setting up ASoC audio map? Jarkko Nikula
2008-02-27 12:34 ` Mark Brown
2008-02-27 13:11   ` Jarkko Nikula
2008-02-27 22:01     ` Mark Brown
2008-02-27 16:15 ` Takashi Iwai [this message]
2008-02-28  7:15   ` Jarkko Nikula

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=s5hy796s7d6.wl%tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=jarkko.nikula@nokia.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