diff options
author | Markus Elfring <elfring@users.sourceforge.net> | 2014-11-21 12:34:48 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-11-21 14:06:57 -0500 |
commit | d712eaf29d3fe5928d891a4a90ac58644ad595ed (patch) | |
tree | 3de3dce17716da6132740fa87449231d0fa21a04 | |
parent | eaa8e5ef18fa9e09286482a4ded3a3cad36e44b2 (diff) |
ALSA: core: Deletion of unnecessary checks before two function calls
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>
-rw-r--r-- | sound/core/seq/oss/seq_oss_init.c | 9 | ||||
-rw-r--r-- | sound/core/sgbuf.c | 3 |
2 files changed, 4 insertions, 8 deletions
diff --git a/sound/core/seq/oss/seq_oss_init.c b/sound/core/seq/oss/seq_oss_init.c index b9184d20c39f..b0e32e161dd1 100644 --- a/sound/core/seq/oss/seq_oss_init.c +++ b/sound/core/seq/oss/seq_oss_init.c | |||
@@ -403,14 +403,11 @@ free_devinfo(void *private) | |||
403 | { | 403 | { |
404 | struct seq_oss_devinfo *dp = (struct seq_oss_devinfo *)private; | 404 | struct seq_oss_devinfo *dp = (struct seq_oss_devinfo *)private; |
405 | 405 | ||
406 | if (dp->timer) | 406 | snd_seq_oss_timer_delete(dp->timer); |
407 | snd_seq_oss_timer_delete(dp->timer); | ||
408 | 407 | ||
409 | if (dp->writeq) | 408 | snd_seq_oss_writeq_delete(dp->writeq); |
410 | snd_seq_oss_writeq_delete(dp->writeq); | ||
411 | 409 | ||
412 | if (dp->readq) | 410 | snd_seq_oss_readq_delete(dp->readq); |
413 | snd_seq_oss_readq_delete(dp->readq); | ||
414 | 411 | ||
415 | kfree(dp); | 412 | kfree(dp); |
416 | } | 413 | } |
diff --git a/sound/core/sgbuf.c b/sound/core/sgbuf.c index 0a418503ec41..84fffabdd129 100644 --- a/sound/core/sgbuf.c +++ b/sound/core/sgbuf.c | |||
@@ -39,8 +39,7 @@ int snd_free_sgbuf_pages(struct snd_dma_buffer *dmab) | |||
39 | if (! sgbuf) | 39 | if (! sgbuf) |
40 | return -EINVAL; | 40 | return -EINVAL; |
41 | 41 | ||
42 | if (dmab->area) | 42 | vunmap(dmab->area); |
43 | vunmap(dmab->area); | ||
44 | dmab->area = NULL; | 43 | dmab->area = NULL; |
45 | 44 | ||
46 | tmpb.dev.type = SNDRV_DMA_TYPE_DEV; | 45 | tmpb.dev.type = SNDRV_DMA_TYPE_DEV; |