ALSA: core: Deletion of unnecessary checks before two function calls
authorMarkus Elfring <elfring@users.sourceforge.net>
Fri, 21 Nov 2014 17:34:48 +0000 (18:34 +0100)
committerTakashi Iwai <tiwai@suse.de>
Fri, 21 Nov 2014 19:06:57 +0000 (20:06 +0100)
The functions snd_seq_oss_timer_delete() and vunmap() perform also input
parameter validation. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/seq/oss/seq_oss_init.c
sound/core/sgbuf.c

index b9184d20c39ffb05057b5f74755fa49b37b088ba..b0e32e161dd187564e7d869d12651f2241eddd07 100644 (file)
@@ -403,14 +403,11 @@ free_devinfo(void *private)
 {
        struct seq_oss_devinfo *dp = (struct seq_oss_devinfo *)private;
 
-       if (dp->timer)
-               snd_seq_oss_timer_delete(dp->timer);
+       snd_seq_oss_timer_delete(dp->timer);
                
-       if (dp->writeq)
-               snd_seq_oss_writeq_delete(dp->writeq);
+       snd_seq_oss_writeq_delete(dp->writeq);
 
-       if (dp->readq)
-               snd_seq_oss_readq_delete(dp->readq);
+       snd_seq_oss_readq_delete(dp->readq);
        
        kfree(dp);
 }
index 0a418503ec412c61e22da5ac31ddac96e6e436a4..84fffabdd129ded8373f20ea06304d8ac7473028 100644 (file)
@@ -39,8 +39,7 @@ int snd_free_sgbuf_pages(struct snd_dma_buffer *dmab)
        if (! sgbuf)
                return -EINVAL;
 
-       if (dmab->area)
-               vunmap(dmab->area);
+       vunmap(dmab->area);
        dmab->area = NULL;
 
        tmpb.dev.type = SNDRV_DMA_TYPE_DEV;