From: Takashi Iwai <tiwai@suse.de>
To: Geliang Tang <geliangtang@163.com>
Cc: "Jaroslav Kysela" <perex@perex.cz>,
"Takashi Iwai" <tiwai@suse.com>,
"Ricard Wanderlof" <ricard.wanderlof@axis.com>,
"Johan Rastén" <johan@oljud.se>,
alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org
Subject: Re: [alsa-devel] [PATCH] ALSA: usb-audio: use list_for_each_entry_continue_reverse
Date: Tue, 22 Dec 2015 10:58:45 +0100 [thread overview]
Message-ID: <s5hegeeg5yi.wl-tiwai@suse.de> (raw)
In-Reply-To: <fea57694a17b8001b53896f657ffccf5128ee4c3.1450713219.git.geliangtang@163.com>
On Mon, 21 Dec 2015 16:55:39 +0100,
Geliang Tang wrote:
>
> For better readability, use list_for_each_entry_continue_reverse()
> in have_dup_chmap().
>
> Signed-off-by: Geliang Tang <geliangtang@163.com>
Applied, thanks.
Takashi
> ---
> sound/usb/stream.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/sound/usb/stream.c b/sound/usb/stream.c
> index 8ee14f2..c4dc577 100644
> --- a/sound/usb/stream.c
> +++ b/sound/usb/stream.c
> @@ -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;
> --
> 2.5.0
>
>
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>
prev parent reply other threads:[~2015-12-22 9:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-21 15:55 Geliang Tang
2015-12-22 9:58 ` Takashi Iwai [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=s5hegeeg5yi.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=geliangtang@163.com \
--cc=johan@oljud.se \
--cc=linux-kernel@vger.kernel.org \
--cc=perex@perex.cz \
--cc=ricard.wanderlof@axis.com \
--cc=tiwai@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®