ALSA: asihpi: Kill BUG_ON() usages
authorTakashi Iwai <tiwai@suse.de>
Thu, 7 Sep 2017 08:51:54 +0000 (10:51 +0200)
committerTakashi Iwai <tiwai@suse.de>
Thu, 7 Sep 2017 08:52:37 +0000 (10:52 +0200)
BUG_ON() is the worst choice for a trivial sanity check.
Either it should be removed or replaced with a softer one like
WARN_ON() if still really needed.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/asihpi/asihpi.c

index 976a3d23557e4792ea5c6bfad4b63cc5a7e113f0..70d023a85bf5e7b4c2415f642766cedc16ef6d95 100644 (file)
@@ -558,12 +558,10 @@ static void snd_card_asihpi_pcm_int_start(struct snd_pcm_substream *substream)
        struct snd_card_asihpi_pcm *dpcm;
        struct snd_card_asihpi *card;
 
-       BUG_ON(!substream);
-
        dpcm = (struct snd_card_asihpi_pcm *)substream->runtime->private_data;
        card = snd_pcm_substream_chip(substream);
 
-       BUG_ON(in_interrupt());
+       WARN_ON(in_interrupt());
        tasklet_disable(&card->t);
        card->llmode_streampriv = dpcm;
        tasklet_enable(&card->t);
@@ -578,8 +576,6 @@ static void snd_card_asihpi_pcm_int_stop(struct snd_pcm_substream *substream)
        struct snd_card_asihpi_pcm *dpcm;
        struct snd_card_asihpi *card;
 
-       BUG_ON(!substream);
-
        dpcm = (struct snd_card_asihpi_pcm *)substream->runtime->private_data;
        card = snd_pcm_substream_chip(substream);