At Fri, 14 Nov 2008 15:38:56 +0800, Wu Fengguang wrote: > > > > > > --- /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. > > BUILD_BUG_ON() won't emit errors! So use BUG_ON()? Try to make grab_bits() a macro and check whether BUILD_BUG_ON() works. I think it won't be too bad to use a macro for such a pretty simple case. If the resultant code looks too ugly, we should switch back to BUG_ON(). The difference is that BUILD_BUG_ON() would add no real code while BUG_ON() is a pure run-time check. thanks, Takashi _______________________________________________ Alsa-devel mailing list Alsa-devel@xxxxxxxxxxxxxxxx http://mailman.alsa-project.org/mailman/listinfo/alsa-devel