From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: Using ARRAY_SIZE macro when setting up ASoC audio map? Date: Wed, 27 Feb 2008 17:15:49 +0100 Message-ID: References: <20080227134923.aa37870c.jarkko.nikula@nokia.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx1.suse.de (ns.suse.de [195.135.220.2]) by alsa0.perex.cz (Postfix) with ESMTP id CE43810380C for ; Wed, 27 Feb 2008 17:15:49 +0100 (CET) In-Reply-To: <20080227134923.aa37870c.jarkko.nikula@nokia.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: Jarkko Nikula Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org 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