From: Julia Lawall From: Julia Lawall if (...) BUG(); should be replaced with BUG_ON(...) when the test has no side-effects to allow a definition of BUG_ON that drops the code completely. The semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // @ disable unlikely @ expression E,f; @@ ( if (<... f(...) ...>) { BUG(); } | - if (unlikely(E)) { BUG(); } + BUG_ON(E); ) @@ expression E,f; @@ ( if (<... f(...) ...>) { BUG(); } | - if (E) { BUG(); } + BUG_ON(E); ) // Signed-off-by: Julia Lawall Signed-off-by: Andrew Morton --- sound/oss/trident.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff -puN sound/core/seq/oss/seq_oss_synth.c~sound-use-bug_on sound/core/seq/oss/seq_oss_synth.c diff -puN sound/oss/trident.c~sound-use-bug_on sound/oss/trident.c --- a/sound/oss/trident.c~sound-use-bug_on +++ a/sound/oss/trident.c @@ -3076,8 +3076,7 @@ ali_ac97_get(struct trident_card *card, u16 wcontrol; unsigned long flags; - if (!card) - BUG(); + BUG_ON(!card); address = ALI_AC97_READ; if (card->revision == ALI_5451_V02) { @@ -3148,8 +3147,7 @@ ali_ac97_set(struct trident_card *card, data = ((u32) val) << 16; - if (!card) - BUG(); + BUG_ON(!card); address = ALI_AC97_WRITE; mask = ALI_AC97_WRITE_ACTION | ALI_AC97_AUDIO_BUSY; @@ -3213,8 +3211,7 @@ ali_ac97_read(struct ac97_codec *codec, struct trident_card *card = NULL; /* Added by Matt Wu */ - if (!codec) - BUG(); + BUG_ON(!codec); card = (struct trident_card *) codec->private_data; @@ -3240,8 +3237,7 @@ ali_ac97_write(struct ac97_codec *codec, struct trident_card *card; /* Added by Matt Wu */ - if (!codec) - BUG(); + BUG_ON(!codec); card = (struct trident_card *) codec->private_data; _