On Mon, Dec 20, 2010 at 05:47:13PM +0100, Takashi Iwai wrote:
Yes, this would be safer. I didn't put it since I wasn't sure whether BUG() content is also expanded at each caller. If yes, it would bloat. (Alternatively we may use snd_BUG_ON() -- it's built in only when CONFIG_SND_DEBUG is set.)
That's entirely up to the compiler - inline is purely advice and may well be completely ignored by the compile (and of course functions that aren't marked inline may be inlined if it decides that's useful).
I'd be inclined to just not mark the functions inline.
Anyway, such a check should have been done rather at initialization.
One reason for making it a BUG() is that if we get far enough for the check to go off when doing actual register lookups we've hit a definite bug in the code.