mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-25 05:04:09 +08:00
ALSA: sb - Fix wrong assertions
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>
This commit is contained in:
parent
44e051773d
commit
3e14b50dd4
@ -925,7 +925,7 @@ 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++);
|
||||
}
|
||||
@ -933,7 +933,7 @@ static void save_mixer(struct snd_sb *chip, unsigned char *regs, int num_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++);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user