]> www.infradead.org Git - linux.git/commitdiff
ALSA: sb: Drop NULL check for snd_ctl_remove()
authorTakashi Iwai <tiwai@suse.de>
Mon, 17 Jun 2024 10:05:24 +0000 (12:05 +0200)
committerTakashi Iwai <tiwai@suse.de>
Tue, 18 Jun 2024 10:51:50 +0000 (12:51 +0200)
Since snd_ctl_remove() accepts the NULL kcontrol argument now, we can
drop the check in the caller side.

Link: https://lore.kernel.org/20240617100529.6667-3-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/isa/sb/emu8000.c
sound/isa/sb/sb16_csp.c

index a6405772d5370266a916a80a76615371b65cd45a..af478c36ce5b1fbf42871cfa0eaf05c01976d176 100644 (file)
@@ -1039,10 +1039,8 @@ snd_emu8000_create_mixer(struct snd_card *card, struct snd_emu8000 *emu)
        return 0;
 
 __error:
-       for (i = 0; i < EMU8000_NUM_CONTROLS; i++) {
-               if (emu->controls[i])
-                       snd_ctl_remove(card, emu->controls[i]);
-       }
+       for (i = 0; i < EMU8000_NUM_CONTROLS; i++)
+               snd_ctl_remove(card, emu->controls[i]);
        return err;
 }
 
index 8d8357019719974e0fe47a61eb984ad5c3fc415f..fdb992733bde1051202d56736a25913b600af40f 100644 (file)
@@ -1080,14 +1080,10 @@ static void snd_sb_qsound_destroy(struct snd_sb_csp * p)
 
        card = p->chip->card;   
        
-       if (p->qsound_switch) {
-               snd_ctl_remove(card, p->qsound_switch);
-               p->qsound_switch = NULL;
-       }
-       if (p->qsound_space) {
-               snd_ctl_remove(card, p->qsound_space);
-               p->qsound_space = NULL;
-       }
+       snd_ctl_remove(card, p->qsound_switch);
+       p->qsound_switch = NULL;
+       snd_ctl_remove(card, p->qsound_space);
+       p->qsound_space = NULL;
 
        /* cancel pending transfer of QSound parameters */
        spin_lock_irqsave (&p->q_lock, flags);