From: Takashi Iwai Subject: Re: [RFC][PATCH] ELD routines and proc interface Date: Fri, 14 Nov 2008 08:25:51 +0100 Message-ID: References: <1226542918.126598.6912@de> <1226626476.943818.9357@de> 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 5CC1A243CD for ; Fri, 14 Nov 2008 08:25:52 +0100 (CET) In-Reply-To: <1226626476.943818.9357@de> 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: Wu Fengguang Cc: alsa-devel List-Id: alsa-devel@alsa-project.org At Fri, 14 Nov 2008 09:34:32 +0800, Wu Fengguang wrote: > > > > - How do we name the proc file? > > > If there are going to be two HDMI pins per codec, then the current naming > > > scheme (eld#) will fail. > > > > In theory, yes, but I don't think this would happen. > > If this is needed, the currently existing codec#* proc must be fixed, > > too. So, we can use eld#codec as the simplest way. > > I mean one HDMI codec equipped with two output converters and two HDMI pins. > In this case there could be two HDMI sinks mapped to one single codec. > > Or it would be trivial to do the rename in the future anyway? Ah, OK, understood. One easy solution is to name the proc file with either pin of audio-out widget NID. But I'm not sure whether it's worth. The proc file naming isn't strict, so I'd leave it as is. > > > --- /dev/null > > > +++ sound-2.6/sound/pci/hda/hda_eld.c > > > +static inline unsigned char grab_bits(const unsigned char *buf, > > > + int byte, int lowbit, int bits) > > > +{ > > > + BUG_ON(lowbit > 7); > > > + BUG_ON(bits > 8); > > > + BUG_ON(bits <= 0); > > > > Can it be rather BUILD_BUG_ON(), BTW? > > Or, hmm, doesn't work if it's an inline function? > > Yes, converted to BUILD_BUG_ON() and it compiles OK. The question is whether this really triggers the build error properly. Could you check it, simply by changing the caller of grab_bits() with some invalid values? Then you should get a compile error. thanks, Takashi