From: Axel Lin Date: Sun, 1 Jan 2012 10:36:14 +0000 (+0800) Subject: ASoC: sta32x: Optimize the array work to find rate_min and rate_max X-Git-Tag: accepted/tizen/common/20141203.182822~4454^2~120 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7a748e4318909e680b3900e3b97ea42a92724c68;p=platform%2Fkernel%2Flinux-arm64.git ASoC: sta32x: Optimize the array work to find rate_min and rate_max 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. Signed-off-by: Axel Lin Acked-by: Johannes Stezenbach Signed-off-by: Mark Brown --- diff --git a/sound/soc/codecs/sta32x.c b/sound/soc/codecs/sta32x.c index fbd1450..7db6fa5 100644 --- 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; } } }