Skip to content

Commit

Permalink
ASoC: wm_adsp: round to 4-byte boundary for coeff file blocks
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Rattray <crattray@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Chris Rattray authored and Mark Brown committed Feb 11, 2013
1 parent 3a2cb1e commit bdaacea
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion sound/soc/codecs/wm_adsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,7 @@ static int wm_adsp_load_coeff(struct wm_adsp *dsp)
int ret, pos, blocks, type, offset, reg;
char *file;
struct wm_adsp_buf *buf;
int tmp;

file = kzalloc(PAGE_SIZE, GFP_KERNEL);
if (file == NULL)
Expand Down Expand Up @@ -842,7 +843,12 @@ static int wm_adsp_load_coeff(struct wm_adsp *dsp)
}
}

pos += le32_to_cpu(blk->len) + sizeof(*blk);
tmp = le32_to_cpu(blk->len) % 4;
if (tmp)
pos += le32_to_cpu(blk->len) + (4 - tmp) + sizeof(*blk);
else
pos += le32_to_cpu(blk->len) + sizeof(*blk);

blocks++;
}

Expand Down

0 comments on commit bdaacea

Please sign in to comment.