[alsa-devel] [PATCH] cleanup controllers in snd-usb-caiaq

Takashi Iwai tiwai at suse.de
Thu Nov 27 08:24:20 CET 2008

At Wed, 26 Nov 2008 21:31:59 +0100,
Daniel Mack wrote:
> On 26.11.2008, at 21:28, Takashi Iwai wrote:
> >> Ok, agreed and done. However, I considered it a good idea as it  
> >> avoided
> >> writing the array's name more than once.
> >
> > In that case, you can use a macro, such as,
> >
> > #define ADD_CTRLS(c, list) add_controls(c, ARRAY_SIZE(list), (list))
> >
> > But, don't make a too complex block as a macro.  A function often
> > gives a better code (in this case it'll get smaller) in addition to a
> > better readability than a big macro.
> Ok. Do you want me to do this or are you fine with the code as-is?

I have no big preference.
But, since it's not bad to have ARRAY_SIZE() explicitly in the code
(then you notice that it's no null-terminated array), I applied your
previous one now.



More information about the Alsa-devel mailing list