Skip to content

Commit

Permalink
ASoC: Correct code taking the size of a pointer
Browse files Browse the repository at this point in the history
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: Julia Lawall <julia@diku.dk>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Julia Lawall authored and Mark Brown committed Dec 14, 2009
1 parent 761c9d4 commit bc25800
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sound/soc/codecs/wm8900.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit bc25800

Please sign in to comment.