[alsa-devel] [PATCH 21/31] ASoC: dapm: Use WARN_ON() instead of BUG_ON()

Mark Brown broonie at kernel.org
Wed Nov 6 12:15:29 CET 2013


On Wed, Nov 06, 2013 at 12:05:00PM +0100, Takashi Iwai wrote:

> BUG_ON() is rather useless for debugging as it leads to panic().
> Use WARN_ON() and handle the error cases accordingly.

Please fix the comment about BUG_ON() being useless; it does exactly
what it's supposed to do.

> Also another WARN_ON() check is added in dapm_seq_run_coalesced()
> since now the show goes on after the first WARN_ON().

Why?

>  	list_for_each_entry(w, pending, power_list) {
> +		if (WARN_ON(reg != w->reg))
> +			continue;
>  		dapm_seq_check_event(card, w, SND_SOC_DAPM_POST_PMU);
>  		dapm_seq_check_event(card, w, SND_SOC_DAPM_POST_PMD);
>  	}

We're not using reg here...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20131106/1a52f071/attachment.sig>


More information about the Alsa-devel mailing list