Commit f67d71ae authored by Geliang Tang's avatar Geliang Tang Committed by Takashi Iwai

ALSA: usb-audio: use list_for_each_entry_continue_reverse

For better readability, use list_for_each_entry_continue_reverse()
in have_dup_chmap().
Signed-off-by: default avatarGeliang Tang <geliangtang@163.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent cb41f271
...@@ -125,11 +125,9 @@ static int usb_chmap_ctl_info(struct snd_kcontrol *kcontrol, ...@@ -125,11 +125,9 @@ static int usb_chmap_ctl_info(struct snd_kcontrol *kcontrol,
static bool have_dup_chmap(struct snd_usb_substream *subs, static bool have_dup_chmap(struct snd_usb_substream *subs,
struct audioformat *fp) struct audioformat *fp)
{ {
struct list_head *p; struct audioformat *prev = fp;
for (p = fp->list.prev; p != &subs->fmt_list; p = p->prev) { list_for_each_entry_continue_reverse(prev, &subs->fmt_list, list) {
struct audioformat *prev;
prev = list_entry(p, struct audioformat, list);
if (prev->chmap && if (prev->chmap &&
!memcmp(prev->chmap, fp->chmap, sizeof(*fp->chmap))) !memcmp(prev->chmap, fp->chmap, sizeof(*fp->chmap)))
return true; return true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment