[alsa-devel] [PATCH] ASoC: rt286: Fix the runtime error in the booting
Oder Chiou
oder_chiou at realtek.com
Mon Oct 5 06:09:58 CEST 2015
> -----Original Message-----
> From: Mark Brown [mailto:broonie at kernel.org]
> Sent: Friday, October 02, 2015 6:12 PM
> To: Oder Chiou
> Cc: lgirdwood at gmail.com; alsa-devel at alsa-project.org; Flove; Bard Liao; John Lin;
> flubba86 at gmail.com
> Subject: Re: [PATCH] ASoC: rt286: Fix the runtime error in the booting
>
> On Fri, Oct 02, 2015 at 01:30:29PM +0800, Oder Chiou wrote:
> > The struct rt286_index_def was used by the cache function, so it cannot be
> > declared as const.
>
> > -static const struct reg_default rt286_index_def[] = {
> > +static struct reg_default rt286_index_def[] = {
> > { 0x01, 0xaaaa },
> > { 0x02, 0x8aaa },
> > { 0x03, 0x0002 },
>
> This isn't obvious and seems likely to break - why is this ever being
> modified and how is that safe?
The table was used for the cache function of the index table, so it would be
changed the value in the index register writing. The breaking is in that the
variable of type "const" is changing. And the wrong modification was
committed by "c418a84a8c8f98b1a0f30cd68d0cdf40d77aed01". The modifications of
the commit are correct in the conventional case, but it will be breaking in
case of rt286 and rt298.
More information about the Alsa-devel
mailing list