diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2014-02-11 17:15:51 -0800 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-02-12 11:59:35 +0000 |
commit | 00463c113b6ba6506b4f1ebb9b3c5dd249f8750f (patch) | |
tree | 194039a26733d752b630cea531bc7fc1563cb545 /sound/soc/sh/rcar/adg.c | |
parent | 8691d0748e566f8708f7a9139e760134f5dc3130 (diff) | |
download | op-kernel-dev-00463c113b6ba6506b4f1ebb9b3c5dd249f8750f.zip op-kernel-dev-00463c113b6ba6506b4f1ebb9b3c5dd249f8750f.tar.gz |
ASoC: rsnd: tidyup original for_each_rsnd_xxx macro
Current for_each_rsnd_xxx macro will read out-of-array's
memory after last loop operation.
It was not good C language operation, and the binary which was
compiled by (at least) gcc 4.8.1 is broken
This patch tidyup these issues
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc/sh/rcar/adg.c')
-rw-r--r-- | sound/soc/sh/rcar/adg.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sound/soc/sh/rcar/adg.c b/sound/soc/sh/rcar/adg.c index 8d3a82e..bc8961c5 100644 --- a/sound/soc/sh/rcar/adg.c +++ b/sound/soc/sh/rcar/adg.c @@ -25,9 +25,10 @@ struct rsnd_adg { }; #define for_each_rsnd_clk(pos, adg, i) \ - for (i = 0, (pos) = adg->clk[i]; \ - i < CLKMAX; \ - i++, (pos) = adg->clk[i]) + for (i = 0; \ + (i < CLKMAX) && \ + ((pos) = adg->clk[i]); \ + i++) #define rsnd_priv_to_adg(priv) ((struct rsnd_adg *)(priv)->adg) |