Skip to content

Commit

Permalink
ALSA: sb - Fix wrong assertions
Browse files Browse the repository at this point in the history
snd_assert() in save_mixer() and restore_mixer() in sb_mixer.c is
just wrong.  The debug code wasn't tested at all, obviously...

Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Takashi Iwai committed Jun 23, 2008
1 parent 44e0517 commit 3e14b50
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sound/isa/sb/sb_mixer.c
Original file line number Diff line number Diff line change
Expand Up @@ -925,15 +925,15 @@ static unsigned char als4000_saved_regs[] = {
static void save_mixer(struct snd_sb *chip, unsigned char *regs, int num_regs)
{
unsigned char *val = chip->saved_regs;
snd_assert(num_regs > ARRAY_SIZE(chip->saved_regs), return);
snd_assert(num_regs <= ARRAY_SIZE(chip->saved_regs), return);
for (; num_regs; num_regs--)
*val++ = snd_sbmixer_read(chip, *regs++);
}

static void restore_mixer(struct snd_sb *chip, unsigned char *regs, int num_regs)
{
unsigned char *val = chip->saved_regs;
snd_assert(num_regs > ARRAY_SIZE(chip->saved_regs), return);
snd_assert(num_regs <= ARRAY_SIZE(chip->saved_regs), return);
for (; num_regs; num_regs--)
snd_sbmixer_write(chip, *regs++, *val++);
}
Expand Down

0 comments on commit 3e14b50

Please sign in to comment.