alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Vinod Koul <vinod.koul@intel.com>
To: alsa-devel@alsa-project.org
Cc: tiwai@suse.de, patches.audio@intel.com,
	liam.r.girdwood@linux.intel.com,
	Vinod Koul <vinod.koul@intel.com>,
	broonie@kernel.org, Jeeja KP <jeeja.kp@intel.com>
Subject: [PATCH v2 1/6] ALSA: hda: use list macro for parsing on cleanup
Date: Tue, 15 Mar 2016 16:39:23 +0530	[thread overview]
Message-ID: <1458040168-3769-2-git-send-email-vinod.koul@intel.com> (raw)
In-Reply-To: <1458040168-3769-1-git-send-email-vinod.koul@intel.com>

It is always better to use list_for_each_entry_safe() while doing
cleanup. So use this instead of open coding this in list in
snd_hdac_stream_free_all()

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Acked-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
 sound/hda/ext/hdac_ext_stream.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/sound/hda/ext/hdac_ext_stream.c b/sound/hda/ext/hdac_ext_stream.c
index 023cc4cad5c1..626f3bb24c55 100644
--- a/sound/hda/ext/hdac_ext_stream.c
+++ b/sound/hda/ext/hdac_ext_stream.c
@@ -104,12 +104,11 @@ EXPORT_SYMBOL_GPL(snd_hdac_ext_stream_init_all);
  */
 void snd_hdac_stream_free_all(struct hdac_ext_bus *ebus)
 {
-	struct hdac_stream *s;
+	struct hdac_stream *s, *_s;
 	struct hdac_ext_stream *stream;
 	struct hdac_bus *bus = ebus_to_hbus(ebus);
 
-	while (!list_empty(&bus->stream_list)) {
-		s = list_first_entry(&bus->stream_list, struct hdac_stream, list);
+	list_for_each_entry_safe(s, _s, &bus->stream_list, list) {
 		stream = stream_to_hdac_ext_stream(s);
 		snd_hdac_ext_stream_decouple(ebus, stream, false);
 		list_del(&s->list);
-- 
1.9.1

  reply	other threads:[~2016-03-15 11:05 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-15 11:09 [PATCH v2 0/6] ASoC: Intel: Skylake: Fix module removal Vinod Koul
2016-03-15 11:09 ` Vinod Koul [this message]
2016-03-15 11:09 ` [PATCH v2 2/6] ASoC: Intel: Skylake: free codec objects on removal Vinod Koul
2016-03-16 10:09   ` Applied "ASoC: Intel: Skylake: free codec objects on removal" to the asoc tree Mark Brown
2016-03-15 11:09 ` [PATCH v2 3/6] ASoC: Intel: Skylake: Freeup properly on skl_dsp_free Vinod Koul
2016-03-15 11:09 ` [PATCH v2 4/6] ASoC: Intel: Skylake: Unmap the address last Vinod Koul
2016-03-15 11:09 ` [PATCH v2 5/6] ASoC: Intel: Skylake: Call i915 exit last Vinod Koul
2016-03-15 11:09 ` [PATCH v2 6/6] ASoC: Intel: Skylake: remove call to pci_dev_put Vinod Koul
2016-03-16 10:08   ` Mark Brown
2016-03-16 10:52     ` Vinod Koul
2016-03-16 11:03       ` Mark Brown
2016-03-16 11:35         ` Takashi Iwai
2016-03-16 14:44           ` Vinod Koul
2016-03-16 14:57             ` Mark Brown
2016-03-16 15:54               ` Vinod Koul
2016-03-16 16:24   ` Applied "ASoC: Intel: Skylake: remove call to pci_dev_put" to the asoc tree Mark Brown

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=1458040168-3769-2-git-send-email-vinod.koul@intel.com \
    --to=vinod.koul@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=jeeja.kp@intel.com \
    --cc=liam.r.girdwood@linux.intel.com \
    --cc=patches.audio@intel.com \
    --cc=tiwai@suse.de \
    /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;
as well as URLs for NNTP newsgroup(s).