From: Takashi Iwai <tiwai@suse.de>
To: Bryan Wu <cooloney@kernel.org>
Cc: liam.girdwood@wolfsonmicro.com, Cliff Cai <cliff.cai@analog.com>,
Mark Brown <broonie@opensource.wolfsonmicro.com>,
linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org
Subject: Re: [PATCH 1/1] [ASOC]: AD1980 audio codec ASOC driver
Date: Tue, 13 May 2008 12:59:26 +0200 [thread overview]
Message-ID: <s5hprrqeagh.wl%tiwai@suse.de> (raw)
In-Reply-To: <1210589112-12208-1-git-send-email-cooloney@kernel.org>
At Mon, 12 May 2008 18:45:12 +0800,
Bryan Wu wrote:
> diff --git a/sound/soc/codecs/ad1980.c b/sound/soc/codecs/ad1980.c
(snip)
> +static int ad1980_add_controls(struct snd_soc_codec *codec)
> +{
> + int err, i;
> +
> + for (i = 0; i < ARRAY_SIZE(ad1980_snd_ac97_controls); i++) {
> + err = snd_ctl_add(codec->card, snd_soc_cnew( \
The backslash isn't needed.
> +static unsigned int ac97_read(struct snd_soc_codec *codec,
> + unsigned int reg)
> +{
> + u16 *cache = codec->reg_cache;
> +
> + if (reg == AC97_RESET || reg == AC97_INT_PAGING || \
> + reg == AC97_POWERDOWN || reg == AC97_EXTENDED_STATUS \
> + || reg == AC97_VENDOR_ID1 || reg == AC97_VENDOR_ID2)
Ditto. Maybe a switch is a better choice here.
> + return soc_ac97_ops.read(codec->ac97, reg);
> + else {
> + reg = reg >> 1;
> +
> + if (reg > (ARRAY_SIZE(ad1980_reg)))
Isn't it reg >= ARRAY_SIZE(ad1980_reg) ??
> +static int ac97_write(struct snd_soc_codec *codec, unsigned int reg,
> + unsigned int val)
> +{
> + u16 *cache = codec->reg_cache;
> +
> + soc_ac97_ops.write(codec->ac97, reg, val);
> + reg = reg >> 1;
> + if (reg <= (ARRAY_SIZE(ad1980_reg)))
And reg < ARRAY_SIZE(ad1980_reg)
thanks,
Takashi
prev parent reply other threads:[~2008-05-13 10:59 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-12 10:45 [PATCH 1/1] [ASOC]: AD1980 audio codec ASOC driver Bryan Wu
2008-05-12 11:54 ` Mark Brown
2008-05-12 11:56 ` Mark Brown
2008-05-13 3:00 ` Cai, Cliff
2008-05-13 14:01 ` Mark Brown
2008-05-13 15:07 ` Bryan Wu
2008-05-13 15:24 ` Mark Brown
2008-05-13 10:59 ` 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=s5hprrqeagh.wl%tiwai@suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=cliff.cai@analog.com \
--cc=cooloney@kernel.org \
--cc=liam.girdwood@wolfsonmicro.com \
--cc=linux-kernel@vger.kernel.org \
/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