ALSA: Kill snd_assert() in sound/pci/*
Kill snd_assert() in sound/pci/*, either removed or replaced with if () with snd_BUG_ON(). Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:

committed by
Jaroslav Kysela

vanhempi
622207dc31
commit
da3cec35dd
@@ -562,7 +562,8 @@ snd_nm256_playback_trigger(struct snd_pcm_substream *substream, int cmd)
|
||||
struct nm256_stream *s = substream->runtime->private_data;
|
||||
int err = 0;
|
||||
|
||||
snd_assert(s != NULL, return -ENXIO);
|
||||
if (snd_BUG_ON(!s))
|
||||
return -ENXIO;
|
||||
|
||||
spin_lock(&chip->reg_lock);
|
||||
switch (cmd) {
|
||||
@@ -599,7 +600,8 @@ snd_nm256_capture_trigger(struct snd_pcm_substream *substream, int cmd)
|
||||
struct nm256_stream *s = substream->runtime->private_data;
|
||||
int err = 0;
|
||||
|
||||
snd_assert(s != NULL, return -ENXIO);
|
||||
if (snd_BUG_ON(!s))
|
||||
return -ENXIO;
|
||||
|
||||
spin_lock(&chip->reg_lock);
|
||||
switch (cmd) {
|
||||
@@ -635,7 +637,8 @@ static int snd_nm256_pcm_prepare(struct snd_pcm_substream *substream)
|
||||
struct snd_pcm_runtime *runtime = substream->runtime;
|
||||
struct nm256_stream *s = runtime->private_data;
|
||||
|
||||
snd_assert(s, return -ENXIO);
|
||||
if (snd_BUG_ON(!s))
|
||||
return -ENXIO;
|
||||
s->dma_size = frames_to_bytes(runtime, substream->runtime->buffer_size);
|
||||
s->period_size = frames_to_bytes(runtime, substream->runtime->period_size);
|
||||
s->periods = substream->runtime->periods;
|
||||
@@ -660,7 +663,8 @@ snd_nm256_playback_pointer(struct snd_pcm_substream *substream)
|
||||
struct nm256_stream *s = substream->runtime->private_data;
|
||||
unsigned long curp;
|
||||
|
||||
snd_assert(s, return 0);
|
||||
if (snd_BUG_ON(!s))
|
||||
return 0;
|
||||
curp = snd_nm256_readl(chip, NM_PBUFFER_CURRP) - (unsigned long)s->buf;
|
||||
curp %= s->dma_size;
|
||||
return bytes_to_frames(substream->runtime, curp);
|
||||
@@ -673,7 +677,8 @@ snd_nm256_capture_pointer(struct snd_pcm_substream *substream)
|
||||
struct nm256_stream *s = substream->runtime->private_data;
|
||||
unsigned long curp;
|
||||
|
||||
snd_assert(s != NULL, return 0);
|
||||
if (snd_BUG_ON(!s))
|
||||
return 0;
|
||||
curp = snd_nm256_readl(chip, NM_RBUFFER_CURRP) - (unsigned long)s->buf;
|
||||
curp %= s->dma_size;
|
||||
return bytes_to_frames(substream->runtime, curp);
|
||||
|
Viittaa uudesa ongelmassa
Block a user