From: Ashish Chavan <ashish.chavan@kpitcummins.com>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: alsa-devel <alsa-devel@alsa-project.org>,
"kuninori.morimoto.gx" <kuninori.morimoto.gx@renesas.com>,
linux-kernel <linux-kernel@vger.kernel.org>,
David@alsa-project.org, Chen <david.chen@diasemi.com>,
lrg <lrg@ti.com>
Subject: Re: [PATCH] ASoC: da7210: Add support for PLL and SRM
Date: Mon, 16 Apr 2012 19:12:30 +0530 [thread overview]
Message-ID: <1334583750.26734.15.camel@matrix> (raw)
In-Reply-To: <20120416125930.GB3219@opensource.wolfsonmicro.com>
On Mon, 2012-04-16 at 13:59 +0100, Mark Brown wrote:
> On Mon, Apr 16, 2012 at 05:53:13PM +0530, Ashish Chavan wrote:
> > On Fri, 2012-04-13 at 10:30 +0100, Mark Brown wrote:
> > > On Wed, Apr 11, 2012 at 10:58:40AM +0530, Ashish Chavan wrote:
>
> > > > + /* for MASTER mode, fs = 48Khz */
> > > > + { 12000000, 0xF3, 0x12, 0x7, }, /* MCLK=12Mhz */
>
> > > This *still* has magic number problems.
>
> > OK, will replace frequency values with defines. That is what you are
> > pointing, right?
>
> No! As with *all* the other times you've submitted this you're relying
> on magic array indexes to find stuff in the table which I've *repeatedly*
> pointed out is terrible for readability and maintainability. It's very
> disappointing to see the same problem coming back repeatedly.
>
Thanks for bearing with me Mark. But the only other way I can think is
to make the *extra* info like master/slave and fs a part of array itself
and then search through the array to get required divisors. In this
case, every time I need to search through entire array to pick up
correct divisors. Wouldn't that be inefficient, especially when the
array indexes are fixed? Or the readability/maintainability of that
would outweigh slight performance overhead?
> > > These defines now need to be kept in sync with the table and are going
> > > to be *very* painful to review.
>
> > Yes, these defines need to be kept in sync with the table. Can you
> > suggest any other, preferred way to do this?
>
> Yes. For example, you could use the same technique you're using for the
> frequencies.
next prev parent reply other threads:[~2012-04-16 13:31 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-11 5:28 [PATCH] ASoC: da7210: Add support for PLL and SRM Ashish Chavan
2012-04-13 9:30 ` Mark Brown
2012-04-16 12:23 ` Ashish Chavan
2012-04-16 12:59 ` Mark Brown
2012-04-16 13:42 ` Ashish Chavan [this message]
2012-04-16 14:07 ` Mark Brown
-- strict thread matches above, loose matches on Subject: below --
2012-01-12 12:24 Ashish Chavan
2012-01-12 18:52 ` Mark Brown
2012-01-18 13:26 ` Ashish Chavan
2012-01-18 13:17 ` Mark Brown
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=1334583750.26734.15.camel@matrix \
--to=ashish.chavan@kpitcummins.com \
--cc=David@alsa-project.org \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=david.chen@diasemi.com \
--cc=kuninori.morimoto.gx@renesas.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lrg@ti.com \
/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;
as well as URLs for NNTP newsgroup(s).