Skip to content

Commit

Permalink
ASoC: Bodge around GCC 4.4.0 flow analysis bug in GCC 4.4.0
Browse files Browse the repository at this point in the history
GCC 4.4.0 doesn't appear to be able to spot that we don't apply any FLL
configuration if the output frequency is zero.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Mark Brown committed Jul 17, 2009
1 parent c5910a7 commit 8aa2df5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions sound/soc/codecs/wm8400.c
Original file line number Diff line number Diff line change
Expand Up @@ -1022,10 +1022,15 @@ static int wm8400_set_dai_pll(struct snd_soc_dai *codec_dai, int pll_id,
if (freq_in == wm8400->fll_in && freq_out == wm8400->fll_out)
return 0;

if (freq_out != 0) {
if (freq_out) {
ret = fll_factors(wm8400, &factors, freq_in, freq_out);
if (ret != 0)
return ret;
} else {
/* Bodge GCC 4.4.0 uninitialised variable warning - it
* doesn't seem capable of working out that we exit if
* freq_out is 0 before any of the uses. */
memset(&factors, 0, sizeof(factors));
}

wm8400->fll_out = freq_out;
Expand All @@ -1040,7 +1045,7 @@ static int wm8400_set_dai_pll(struct snd_soc_dai *codec_dai, int pll_id,
reg &= ~WM8400_FLL_OSC_ENA;
wm8400_write(codec, WM8400_FLL_CONTROL_1, reg);

if (freq_out == 0)
if (!freq_out)
return 0;

reg &= ~(WM8400_FLL_REF_FREQ | WM8400_FLL_FRATIO_MASK);
Expand Down

0 comments on commit 8aa2df5

Please sign in to comment.