Browse Source

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>
isee-imx_3.14.28.y
Takashi Iwai 7 years ago
parent
commit
29fa957804
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      sound/pci/ctxfi/cthardware.c

+ 4
- 2
sound/pci/ctxfi/cthardware.c View File

@ -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++;
@ -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++;


Loading…
Cancel
Save