From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: [alsa-devel] [PATCH] ASoC: pcm512x: Add PCM512x driver Date: Thu, 06 Feb 2014 14:19:15 +0100 Message-ID: References: <1391689575-4039-1-git-send-email-broonie@kernel.org> <20140206130735.GP32298@sirena.org.uk> <52F38B27.1040502@metafoo.de> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Return-path: In-Reply-To: <52F38B27.1040502-Qo5EllUWu/uELgA04lAiVw@public.gmane.org> Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Lars-Peter Clausen Cc: Mark Brown , devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org, linaro-kernel-cunTk1MwBs8s++Sfvej+rw@public.gmane.org, Florian Meier , Liam Girdwood List-Id: alsa-devel@alsa-project.org At Thu, 06 Feb 2014 14:16:23 +0100, Lars-Peter Clausen wrote: > > On 02/06/2014 02:12 PM, Takashi Iwai wrote: > > At Thu, 6 Feb 2014 13:07:35 +0000, > > Mark Brown wrote: > [...] > >> Hrm, it is but this points out an error in the control helpers which has > >> been there since forever - they call that parameter max but it's not a > >> maximum, it's the number of elements in the enumeration. I bet we have > >> a bunch of other enumerations which miss the last element as a result. > > > > Yeah, the argument name is really confusing. I had to double-check > > the code when I reviewed your patch, too :) > > > > Also it'd be better to have a practice to use either ARRAY_SIZE() or a > > constant there, too. > > There is also SOC_ENUM_SINGLE_DECL(...) which takes care of the common case > where you want as many items as your array contains. Ah, right, that makes life easier. Takashi -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html