Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5e246b85 authored by Takashi Iwai's avatar Takashi Iwai Committed by Jaroslav Kysela
Browse files

ALSA: Kill snd_assert() in other places



Kill snd_assert() in other places, either removed or replaced with
if () with snd_BUG_ON().

Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarJaroslav Kysela <perex@perex.cz>
parent da3cec35
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -488,10 +488,12 @@ static int snd_card_saa7134_hw_params(struct snd_pcm_substream * substream,
	period_size = params_period_bytes(hw_params);
	periods = params_periods(hw_params);

	snd_assert(period_size >= 0x100 && period_size <= 0x10000,
		   return -EINVAL);
	snd_assert(periods >= 4, return -EINVAL);
	snd_assert(period_size * periods <= 1024 * 1024, return -EINVAL);
	if (period_size < 0x100 || period_size > 0x10000)
		return -EINVAL;
	if (periods < 4)
		return -EINVAL;
	if (period_size * periods > 1024 * 1024)
		return -EINVAL;

	dev = saa7134->dev;

@@ -942,7 +944,8 @@ static int snd_card_saa7134_new_mixer(snd_card_saa7134_t * chip)
	unsigned int idx;
	int err;

	snd_assert(chip != NULL, return -EINVAL);
	if (snd_BUG_ON(!chip))
		return -EINVAL;
	strcpy(card->mixername, "SAA7134 Mixer");

	for (idx = 0; idx < ARRAY_SIZE(snd_saa7134_controls); idx++) {
+0 −9
Original line number Diff line number Diff line
@@ -235,37 +235,31 @@ irqreturn_t snd_vx_irq_handler(int irq, void *dev);
 */
static inline int vx_test_and_ack(struct vx_core *chip)
{
	snd_assert(chip->ops->test_and_ack, return -ENXIO);
	return chip->ops->test_and_ack(chip);
}

static inline void vx_validate_irq(struct vx_core *chip, int enable)
{
	snd_assert(chip->ops->validate_irq, return);
	chip->ops->validate_irq(chip, enable);
}

static inline unsigned char snd_vx_inb(struct vx_core *chip, int reg)
{
	snd_assert(chip->ops->in8, return 0);
	return chip->ops->in8(chip, reg);
}

static inline unsigned int snd_vx_inl(struct vx_core *chip, int reg)
{
	snd_assert(chip->ops->in32, return 0);
	return chip->ops->in32(chip, reg);
}

static inline void snd_vx_outb(struct vx_core *chip, int reg, unsigned char val)
{
	snd_assert(chip->ops->out8, return);
	chip->ops->out8(chip, reg, val);
}

static inline void snd_vx_outl(struct vx_core *chip, int reg, unsigned int val)
{
	snd_assert(chip->ops->out32, return);
	chip->ops->out32(chip, reg, val);
}

@@ -276,7 +270,6 @@ static inline void snd_vx_outl(struct vx_core *chip, int reg, unsigned int val)

static inline void vx_reset_dsp(struct vx_core *chip)
{
	snd_assert(chip->ops->reset_dsp, return);
	chip->ops->reset_dsp(chip);
}

@@ -304,14 +297,12 @@ int snd_vx_check_reg_bit(struct vx_core *chip, int reg, int mask, int bit, int t
static inline void vx_pseudo_dma_write(struct vx_core *chip, struct snd_pcm_runtime *runtime,
				       struct vx_pipe *pipe, int count)
{
	snd_assert(chip->ops->dma_write, return);
	chip->ops->dma_write(chip, runtime, pipe, count);
}

static inline void vx_pseudo_dma_read(struct vx_core *chip, struct snd_pcm_runtime *runtime,
				      struct vx_pipe *pipe, int count)
{
	snd_assert(chip->ops->dma_read, return);
	chip->ops->dma_read(chip, runtime, pipe, count);
}

+3 −2
Original line number Diff line number Diff line
@@ -442,7 +442,8 @@ static void audio_process_dma(struct audio_stream *s)
                
	/* we are requested to process synchronization DMA transfer */
	if (s->tx_spin) {
		snd_assert(s->stream_id == SNDRV_PCM_STREAM_PLAYBACK, return);
		if (snd_BUG_ON(s->stream_id != SNDRV_PCM_STREAM_PLAYBACK))
			return;
		/* fill the xmit dma buffers and return */
#ifdef HH_VERSION
		sa1100_dma_set_spin(s->dmach, FORCE_CLOCK_ADDR, FORCE_CLOCK_SIZE);
@@ -472,7 +473,7 @@ static void audio_process_dma(struct audio_stream *s)
				continue;		/* special case */
		} else {
			offset = dma_size * s->period;
			snd_assert(dma_size <= DMA_BUF_SIZE, );
			snd_BUG_ON(dma_size > DMA_BUF_SIZE);
		}
#ifdef HH_VERSION
		ret = sa1100_dma_queue_buffer(s->dmach, s, runtime->dma_addr + offset, dma_size);
+2 −1
Original line number Diff line number Diff line
@@ -565,7 +565,8 @@ static int __devinit snd_card_dummy_new_mixer(struct snd_dummy *dummy)
	unsigned int idx;
	int err;

	snd_assert(dummy != NULL, return -EINVAL);
	if (snd_BUG_ON(!dummy))
		return -EINVAL;
	spin_lock_init(&dummy->mixer_lock);
	strcpy(card->mixername, "Dummy Mixer");

+4 −2
Original line number Diff line number Diff line
@@ -139,7 +139,8 @@ static int snd_opl3_detect(struct snd_opl3 * opl3)
		 * If we had an OPL4 chip, opl3->hardware would have been set
		 * by the OPL4 driver; so we can assume OPL3 here.
		 */
		snd_assert(opl3->r_port != 0, return -ENODEV);
		if (snd_BUG_ON(!opl3->r_port))
			return -ENODEV;
		opl3->hardware = OPL3_HW_OPL3;
	}
	return 0;
@@ -324,7 +325,8 @@ EXPORT_SYMBOL(snd_opl3_interrupt);

static int snd_opl3_free(struct snd_opl3 *opl3)
{
	snd_assert(opl3 != NULL, return -ENXIO);
	if (snd_BUG_ON(!opl3))
		return -ENXIO;
	if (opl3->private_free)
		opl3->private_free(opl3);
	snd_opl3_clear_patches(opl3);
Loading