[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <AM6PR04MB647093DB49BB13E09B0F181DE3260@AM6PR04MB6470.eurprd04.prod.outlook.com>
Date: Thu, 18 Apr 2019 02:37:03 +0000
From: "S.j. Wang" <shengjiu.wang@....com>
To: Nicolin Chen <nicoleotsuka@...il.com>
CC: "timur@...nel.org" <timur@...nel.org>,
"Xiubo.Lee@...il.com" <Xiubo.Lee@...il.com>,
"festevam@...il.com" <festevam@...il.com>,
"broonie@...nel.org" <broonie@...nel.org>,
"alsa-devel@...a-project.org" <alsa-devel@...a-project.org>,
"linuxppc-dev@...ts.ozlabs.org" <linuxppc-dev@...ts.ozlabs.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH V3 1/2] ASoC: fsl_asrc: replace the process_option table
with function
Hi
>
> Hi Shengjiu,
>
> This looks better. Just a couple of more small comments inline.
>
> On Wed, Apr 17, 2019 at 09:06:18AM +0000, S.j. Wang wrote:
>
> > +static int fsl_asrc_sel_proc(int inrate, int outrate, int *pre_proc,
> > + int *post_proc)
>
> Just a nit: it looks better by grouping them two-two.
>
> static int fsl_asrc_sel_proc(int inrate, int outrate,
> int *pre_proc, int *post_proc)
>
> > + /* Condition for selection of post-processing */
> > + post_proc_cond2 = (inrate * 15 > outrate * 16 && outrate < 56000) ||
> > + (inrate > 56000 && outrate < 56000);
>
> Could align the indentation:
> post_proc_cond2 = (inrate * 15 > outrate * 16 && outrate < 56000) ||
> (inrate > 56000 && outrate < 56000);
>
> Here:
> > + /* Does not support cases: Tsout > 8.125 * Tsin */
> > + if (inrate * 8 > 65 * outrate)
> > + return -EINVAL;
> And here:
> > + ret = fsl_asrc_sel_proc(inrate, outrate, &pre_proc, &post_proc);
> > + if (ret) {
> > + pair_err("No supported pre-processing options\n");
> > + return ret;
> > + }
>
> Instead of a general message, I was thinking of a more specific one by
> telling users that the ratio between the two rates isn't supported --
> something similar to what I suggested previously:
>
> pair_err("Does not support %d (input) > 8.125 * %d (output)\n",
> outrate, inrate);
>
In fsl_asrc_sel_proc, we can't call the pair_err for there is no
struct fsl_asrc_pair *pair in the argument. Do you think we need to
add this argument?
> Thanks
> Nicolin
Powered by blists - more mailing lists