Skip to content

Commit

Permalink
ALSA: ctxfi: Use WARN_ON() instead of BUG_ON()
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
tiwai committed Nov 6, 2013
1 parent 791b3f5 commit 29fa957
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sound/pci/ctxfi/cthardware.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ unsigned int get_field(unsigned int data, unsigned int field)
{
int i;

BUG_ON(!field);
if (WARN_ON(!field))
return 0;
/* @field should always be greater than 0 */
for (i = 0; !(field & (1 << i)); )
i++;
Expand All @@ -81,7 +82,8 @@ void set_field(unsigned int *data, unsigned int field, unsigned int value)
{
int i;

BUG_ON(!field);
if (WARN_ON(!field))
return;
/* @field should always be greater than 0 */
for (i = 0; !(field & (1 << i)); )
i++;
Expand Down

0 comments on commit 29fa957

Please sign in to comment.