ALSA: seq: Deletion of unnecessary checks before the function call "snd_midi_event_free"
The snd_midi_event_free() function tests whether its argument is NULL and then returns immediately. 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>
This commit is contained in:
parent
adc2ae0bb6
commit
57dca36ee2
2 changed files with 3 additions and 6 deletions
|
@ -237,8 +237,7 @@ snd_seq_oss_midi_check_exit_port(int client, int port)
|
||||||
spin_unlock_irqrestore(®ister_lock, flags);
|
spin_unlock_irqrestore(®ister_lock, flags);
|
||||||
snd_use_lock_free(&mdev->use_lock);
|
snd_use_lock_free(&mdev->use_lock);
|
||||||
snd_use_lock_sync(&mdev->use_lock);
|
snd_use_lock_sync(&mdev->use_lock);
|
||||||
if (mdev->coder)
|
snd_midi_event_free(mdev->coder);
|
||||||
snd_midi_event_free(mdev->coder);
|
|
||||||
kfree(mdev);
|
kfree(mdev);
|
||||||
}
|
}
|
||||||
spin_lock_irqsave(®ister_lock, flags);
|
spin_lock_irqsave(®ister_lock, flags);
|
||||||
|
@ -265,8 +264,7 @@ snd_seq_oss_midi_clear_all(void)
|
||||||
spin_lock_irqsave(®ister_lock, flags);
|
spin_lock_irqsave(®ister_lock, flags);
|
||||||
for (i = 0; i < max_midi_devs; i++) {
|
for (i = 0; i < max_midi_devs; i++) {
|
||||||
if ((mdev = midi_devs[i]) != NULL) {
|
if ((mdev = midi_devs[i]) != NULL) {
|
||||||
if (mdev->coder)
|
snd_midi_event_free(mdev->coder);
|
||||||
snd_midi_event_free(mdev->coder);
|
|
||||||
kfree(mdev);
|
kfree(mdev);
|
||||||
midi_devs[i] = NULL;
|
midi_devs[i] = NULL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -268,8 +268,7 @@ static void snd_seq_midisynth_delete(struct seq_midisynth *msynth)
|
||||||
snd_seq_event_port_detach(msynth->seq_client, msynth->seq_port);
|
snd_seq_event_port_detach(msynth->seq_client, msynth->seq_port);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (msynth->parser)
|
snd_midi_event_free(msynth->parser);
|
||||||
snd_midi_event_free(msynth->parser);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* register new midi synth port */
|
/* register new midi synth port */
|
||||||
|
|
Loading…
Reference in a new issue