Skip to content

Commit

Permalink
ALSA: usb-audio: use list_for_each_entry_continue_reverse
Browse files Browse the repository at this point in the history
For better readability, use list_for_each_entry_continue_reverse()
in have_dup_chmap().

Signed-off-by: Geliang Tang <geliangtang@163.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
geliangtang authored and tiwai committed Dec 22, 2015
1 parent cb41f27 commit f67d71a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions sound/usb/stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,9 @@ static int usb_chmap_ctl_info(struct snd_kcontrol *kcontrol,
static bool have_dup_chmap(struct snd_usb_substream *subs,
struct audioformat *fp)
{
struct list_head *p;
struct audioformat *prev = fp;

for (p = fp->list.prev; p != &subs->fmt_list; p = p->prev) {
struct audioformat *prev;
prev = list_entry(p, struct audioformat, list);
list_for_each_entry_continue_reverse(prev, &subs->fmt_list, list) {
if (prev->chmap &&
!memcmp(prev->chmap, fp->chmap, sizeof(*fp->chmap)))
return true;
Expand Down

0 comments on commit f67d71a

Please sign in to comment.