aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2013-11-05 09:00:02 -0500
committerTakashi Iwai <tiwai@suse.de>2013-11-06 02:34:49 -0500
commit29fa9578046ea51e9cf97c4e16207ea6ec375084 (patch)
tree6ce93d0fbc2653b560dc6423d2f0131f6dc0f29a
parent791b3f596e2331f80244cc8532a25b48d45f126d (diff)
ALSA: ctxfi: Use WARN_ON() instead of BUG_ON()
BUG_ON() is rather useless for debugging as it leads to panic(). Use WARN_ON() and handle the error cases accordingly. Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/pci/ctxfi/cthardware.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sound/pci/ctxfi/cthardware.c b/sound/pci/ctxfi/cthardware.c
index 110b8ace6d8a..a689f2552706 100644
--- a/sound/pci/ctxfi/cthardware.c
+++ b/sound/pci/ctxfi/cthardware.c
@@ -69,7 +69,8 @@ unsigned int get_field(unsigned int data, unsigned int field)
69{ 69{
70 int i; 70 int i;
71 71
72 BUG_ON(!field); 72 if (WARN_ON(!field))
73 return 0;
73 /* @field should always be greater than 0 */ 74 /* @field should always be greater than 0 */
74 for (i = 0; !(field & (1 << i)); ) 75 for (i = 0; !(field & (1 << i)); )
75 i++; 76 i++;
@@ -81,7 +82,8 @@ void set_field(unsigned int *data, unsigned int field, unsigned int value)
81{ 82{
82 int i; 83 int i;
83 84
84 BUG_ON(!field); 85 if (WARN_ON(!field))
86 return;
85 /* @field should always be greater than 0 */ 87 /* @field should always be greater than 0 */
86 for (i = 0; !(field & (1 << i)); ) 88 for (i = 0; !(field & (1 << i)); )
87 i++; 89 i++;