[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <s5hprrqeagh.wl%tiwai@suse.de>
Date: Tue, 13 May 2008 12:59:26 +0200
From: Takashi Iwai <tiwai@...e.de>
To: Bryan Wu <cooloney@...nel.org>
Cc: liam.girdwood@...fsonmicro.com, Cliff Cai <cliff.cai@...log.com>,
Mark Brown <broonie@...nsource.wolfsonmicro.com>,
linux-kernel@...r.kernel.org, alsa-devel@...a-project.org
Subject: Re: [PATCH 1/1] [ASOC]: AD1980 audio codec ASOC driver
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists