From: Takashi Iwai Subject: Re: [PATCH] cleanup controllers in snd-usb-caiaq Date: Thu, 27 Nov 2008 08:24:20 +0100 Message-ID: References: <20081126151901.GB20061@buzzloop.caiaq.de> <20081126185720.GA22925@buzzloop.caiaq.de> <4F8A1F19-C8D2-4DEF-BD2B-D00E39631A8E@caiaq.org> 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 mx2.suse.de (mx2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id E7941244FC for ; Thu, 27 Nov 2008 08:24:20 +0100 (CET) In-Reply-To: <4F8A1F19-C8D2-4DEF-BD2B-D00E39631A8E@caiaq.org> 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: Daniel Mack Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org 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. thanks, Takashi