From: Matthias Kaehlcke <matthias.kaehlcke@gmail.com>
To: perex@suse.cz, linux-kernel@vger.kernel.org, akpm@linux-foundation.org
Subject: [PATCH 1/4] Generic AC97 mixer/modem (OSS): Use list_for_each_entry
Date: Tue, 11 Sep 2007 23:05:32 +0200 [thread overview]
Message-ID: <20070911210532.GG8592@traven> (raw)
In-Reply-To: <20070911205632.GF8592@traven>
Generic AC97 mixer/modem (OSS): Use list_for_each_entry instead of
list_for_each
Signed-off-by: Matthias Kaehlcke <matthias.kaehlcke@gmail.com>
--
diff --git a/sound/oss/ac97_codec.c b/sound/oss/ac97_codec.c
index fef56ca..0a3033b 100644
--- a/sound/oss/ac97_codec.c
+++ b/sound/oss/ac97_codec.c
@@ -815,7 +815,6 @@ int ac97_probe_codec(struct ac97_codec *codec)
int i;
char cidbuf[CODEC_ID_BUFSZ];
u16 f;
- struct list_head *l;
struct ac97_driver *d;
/* wait for codec-ready state */
@@ -891,8 +890,7 @@ int ac97_probe_codec(struct ac97_codec *codec)
mutex_lock(&codec_mutex);
list_add(&codec->list, &codecs);
- list_for_each(l, &codec_drivers) {
- d = list_entry(l, struct ac97_driver, list);
+ list_for_each_entry(d, &codec_drivers, list) {
if ((codec->model ^ d->codec_id) & d->codec_mask)
continue;
if(d->probe(codec, d) == 0)
@@ -1400,14 +1398,12 @@ EXPORT_SYMBOL(ac97_set_adc_rate);
static int swap_headphone(int remove_master)
{
- struct list_head *l;
struct ac97_codec *c;
if (remove_master) {
mutex_lock(&codec_mutex);
- list_for_each(l, &codecs)
+ list_for_each_entry(c, &codecs, list)
{
- c = list_entry(l, struct ac97_codec, list);
if (supported_mixer(c, SOUND_MIXER_PHONEOUT))
c->supported_mixers &= ~SOUND_MASK_PHONEOUT;
}
--
Matthias Kaehlcke
Linux Application Developer
Barcelona
We build too many walls and not enough bridges
(Isaac Newton)
.''`.
using free software / Debian GNU/Linux | http://debian.org : :' :
`. `'`
gpg --keyserver pgp.mit.edu --recv-keys 47D8E5D4 `-
next prev parent reply other threads:[~2007-09-11 21:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-11 20:56 [PATCH 0/4] Several sound drivers: Use list_for_each_entry(_safe) Matthias Kaehlcke
2007-09-11 21:05 ` Matthias Kaehlcke [this message]
2007-09-11 21:08 ` [PATCH 2/4] ESS Maestro 1/2/2E Sound Card: Use list_for_each_entry Matthias Kaehlcke
2007-09-11 21:10 ` [PATCH 3/4] Intel HD Audio: Use list_for_each_entry(_safe) Matthias Kaehlcke
2007-09-11 21:12 ` [PATCH 4/4] Routines for effect processor FX8010: Use list_for_each_entry Matthias Kaehlcke
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=20070911210532.GG8592@traven \
--to=matthias.kaehlcke@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=perex@suse.cz \
/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