ALSA: pcm: Avoid confusing loop in snd_pcm_unlink()
The snd_pcm_group_for_each_entry() loop found in snd_pcm_unlink() is only for taking the first list entry. Use list_first_entry() to make clearer. Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
a41c4cb913
commit
7df5a5f66b
@ -2023,7 +2023,6 @@ static void relink_to_local(struct snd_pcm_substream *substream)
|
|||||||
|
|
||||||
static int snd_pcm_unlink(struct snd_pcm_substream *substream)
|
static int snd_pcm_unlink(struct snd_pcm_substream *substream)
|
||||||
{
|
{
|
||||||
struct snd_pcm_substream *s;
|
|
||||||
struct snd_pcm_group *group;
|
struct snd_pcm_group *group;
|
||||||
int res = 0;
|
int res = 0;
|
||||||
|
|
||||||
@ -2040,10 +2039,9 @@ static int snd_pcm_unlink(struct snd_pcm_substream *substream)
|
|||||||
|
|
||||||
/* detach the last stream, too */
|
/* detach the last stream, too */
|
||||||
if (list_is_singular(&group->substreams)) {
|
if (list_is_singular(&group->substreams)) {
|
||||||
snd_pcm_group_for_each_entry(s, substream) {
|
relink_to_local(list_first_entry(&group->substreams,
|
||||||
relink_to_local(s);
|
struct snd_pcm_substream,
|
||||||
break;
|
link_list));
|
||||||
}
|
|
||||||
kfree(group);
|
kfree(group);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user