[alsa-devel] [PATCH v9 1/6] ASoC: Intel: mrfld: add the gain controls

Mark Brown broonie at kernel.org
Wed Oct 15 15:08:17 CEST 2014


On Wed, Oct 15, 2014 at 03:53:03PM +0530, Vinod Koul wrote:
> On Wed, Oct 15, 2014 at 12:49:47PM +0200, Mark Brown wrote:
> > On Wed, Oct 15, 2014 at 12:34:56PM +0530, Vinod Koul wrote:

> > > +/* the SST_GAIN macro above will create three alsa controls for each
> > > + * instance invoked, gain, mute and ramp duration, which use the same gain
> > > + * cell sst_gain to keep track of data
> > > + *
> > > + * To calculate number of gain cell instances we need to device by 3 in
> > > + * below caulcation for gain cell memory.
> > > + * This gets rid of static number and issues while adding new controls
> > > + */
> > > +static struct sst_gain_value sst_gains[ARRAY_SIZE(sst_gain_controls)/3];

> > The use of ARRAY_SIZE() is nice here but I'm a bit confused about the
> > divide by 3 - there's an entry in sst_gains referenced for each element
> > in sst_gain_controls.

> Thats is the reason added the comment above.

The comment isn't very clear (splitting it into multiple paragraphs
doesn't help since it looks like the calculation stands separately to
the controls), and everything would be a lot simpler if there were a
define for the number of controls created per SST_GAIN() rather than
just hard coding the magic number.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20141015/5610026d/attachment-0001.sig>


More information about the Alsa-devel mailing list