snd_BUG_ON()

snd_BUG_ON() macro is similar with WARN_ON() macro. For example,


  snd_BUG_ON(!pointer);

          

or it can be used as the condition,


  if (snd_BUG_ON(non_zero_is_bug))
          return -EINVAL;

          

The macro takes an conditional expression to evaluate. When CONFIG_SND_DEBUG, is set, the expression is actually evaluated. If it's non-zero, it shows the warning message such as BUG? (xxx) normally followed by stack trace. It returns the evaluated value. When no CONFIG_SND_DEBUG is set, this macro always returns zero.