From mboxrd@z Thu Jan 1 00:00:00 1970 From: Johannes Stezenbach Subject: Re: [PATCH] ASoC: sta32x: Optimize the array work to find rate_min and rate_max Date: Tue, 3 Jan 2012 11:42:50 +0100 Message-ID: <20120103104250.GA6037@sig21.net> References: <1325414174.4978.2.camel@phoenix> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from bar.sig21.net (bar.sig21.net [80.81.252.164]) by alsa0.perex.cz (Postfix) with ESMTP id B501724780 for ; Tue, 3 Jan 2012 11:42:54 +0100 (CET) Content-Disposition: inline In-Reply-To: <1325414174.4978.2.camel@phoenix> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: Axel Lin Cc: alsa-devel@alsa-project.org, Mark Brown , Sven Neumann , Liam Girdwood , Lars-Peter Clausen List-Id: alsa-devel@alsa-project.org On Sun, Jan 01, 2012 at 06:36:14PM +0800, Axel Lin wrote: > For a given ir and fs, there is at most one possible match for the case > mclk_ratios[ir][j].ratio * fs == freq. > Thus we can break from the inner loop once a match is found. Yes, I think this is correct. Acked-by: Johannes Stezenbach Thanks Johannes > --- a/sound/soc/codecs/sta32x.c > +++ b/sound/soc/codecs/sta32x.c > @@ -522,6 +522,7 @@ static int sta32x_set_dai_sysclk(struct snd_soc_dai *codec_dai, > rate_min = fs; > if (fs > rate_max) > rate_max = fs; > + break; > } > } > }