Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1665084
| From | Mark Brown <broonie@kernel.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v3] ASoC: sgtl5000: add avc support |
| Date | 2017-06-13 20:10 +0200 |
| Message-ID | <tRYql-2Pr-3@gated-at.bofh.it> (permalink) |
| References | <tRO7D-4US-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
[Multipart message — attachments visible in raw view] - view raw
On Tue, Jun 13, 2017 at 08:57:34AM +0200, Richard Leitner wrote:
> +static int avc_put_threshold(struct snd_kcontrol *kcontrol,
> + struct snd_ctl_elem_value *ucontrol)
> +{
> + struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
> + int db;
> + u16 reg;
> +
> + db = clamp((int)ucontrol->value.integer.value[0], 0, 96);
> + reg = avc_thr_db2reg[db];
> + snd_soc_write(codec, SGTL5000_DAP_AVC_THRESHOLD, reg);
This should reject rather than silently accept out of bounds values,
otherwise this looks good.
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH v3] ASoC: sgtl5000: add avc support Richard Leitner <richard.leitner@skidata.com> - 2017-06-13 09:10 +0200 Re: [PATCH v3] ASoC: sgtl5000: add avc support Mark Brown <broonie@kernel.org> - 2017-06-13 20:10 +0200
csiph-web