Skip to content

Commit f67d71a

Browse files
geliangtangtiwai
authored andcommitted
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: Geliang Tang <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
1 parent cb41f27 commit f67d71a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

sound/usb/stream.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,9 @@ static int usb_chmap_ctl_info(struct snd_kcontrol *kcontrol,
125125
static bool have_dup_chmap(struct snd_usb_substream *subs,
126126
struct audioformat *fp)
127127
{
128-
struct list_head *p;
128+
struct audioformat *prev = fp;
129129

130-
for (p = fp->list.prev; p != &subs->fmt_list; p = p->prev) {
131-
struct audioformat *prev;
132-
prev = list_entry(p, struct audioformat, list);
130+
list_for_each_entry_continue_reverse(prev, &subs->fmt_list, list) {
133131
if (prev->chmap &&
134132
!memcmp(prev->chmap, fp->chmap, sizeof(*fp->chmap)))
135133
return true;

0 commit comments

Comments
 (0)