提交 bc258006 编写于 作者: J Julia Lawall 提交者: Mark Brown

ASoC: Correct code taking the size of a pointer

sizeof(codec->reg_cache) is just the size of the pointer.  Elsewhere in the
file, codec->reg_cache is used with sizeof(wm8900_reg_defaults), so the
code is changed to do the same here.

A simplified version of the semantic patch that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression *x;
expression f;
type T;
@@

*f(...,(T)x,...)
// </smpl>
Signed-off-by: NJulia Lawall <julia@diku.dk>
Acked-by: NLiam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
上级 761c9d45
......@@ -199,7 +199,7 @@ static void wm8900_reset(struct snd_soc_codec *codec)
snd_soc_write(codec, WM8900_REG_RESET, 0);
memcpy(codec->reg_cache, wm8900_reg_defaults,
sizeof(codec->reg_cache));
sizeof(wm8900_reg_defaults));
}
static int wm8900_hp_event(struct snd_soc_dapm_widget *w,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册