[alsa-devel] [PATCH] ASoC: wm8958: use <asm/unaligned.h> to simplify code

Charles Keepax ckeepax at opensource.cirrus.com
Wed Oct 16 14:49:57 CEST 2019


On Wed, Oct 16, 2019 at 01:01:49PM +0100, Ben Dooks (Codethink) wrote:
> Simplify the memcpy/be32_to_cpu() code by simply using
> get_unaligned_be32() throughout and makes the code nicer
> to look at.
> 
> This fixes the following warnings from sparse:
> 
> sound/soc/codecs/wm8958-dsp2.c:62:26: warning: cast to restricted __be32
> sound/soc/codecs/wm8958-dsp2.c:62:26: warning: cast to restricted __be32
> sound/soc/codecs/wm8958-dsp2.c:62:26: warning: cast to restricted __be32
> sound/soc/codecs/wm8958-dsp2.c:62:26: warning: cast to restricted __be32
> sound/soc/codecs/wm8958-dsp2.c:62:26: warning: cast to restricted __be32
> sound/soc/codecs/wm8958-dsp2.c:62:26: warning: cast to restricted __be32
> sound/soc/codecs/wm8958-dsp2.c:69:15: warning: cast to restricted __be32
> sound/soc/codecs/wm8958-dsp2.c:69:15: warning: cast to restricted __be32
> sound/soc/codecs/wm8958-dsp2.c:69:15: warning: cast to restricted __be32
> sound/soc/codecs/wm8958-dsp2.c:69:15: warning: cast to restricted __be32
> sound/soc/codecs/wm8958-dsp2.c:69:15: warning: cast to restricted __be32
> sound/soc/codecs/wm8958-dsp2.c:69:15: warning: cast to restricted __be32
> sound/soc/codecs/wm8958-dsp2.c:72:18: warning: cast to restricted __be32
> sound/soc/codecs/wm8958-dsp2.c:72:18: warning: cast to restricted __be32
> sound/soc/codecs/wm8958-dsp2.c:72:18: warning: cast to restricted __be32
> sound/soc/codecs/wm8958-dsp2.c:72:18: warning: cast to restricted __be32
> sound/soc/codecs/wm8958-dsp2.c:72:18: warning: cast to restricted __be32
> sound/soc/codecs/wm8958-dsp2.c:72:18: warning: cast to restricted __be32
> sound/soc/codecs/wm8958-dsp2.c:91:17: warning: cast to restricted __be64
> sound/soc/codecs/wm8958-dsp2.c:91:17: warning: cast to restricted __be64
> sound/soc/codecs/wm8958-dsp2.c:91:17: warning: cast to restricted __be64
> sound/soc/codecs/wm8958-dsp2.c:91:17: warning: cast to restricted __be64
> sound/soc/codecs/wm8958-dsp2.c:91:17: warning: cast to restricted __be64
> sound/soc/codecs/wm8958-dsp2.c:91:17: warning: cast to restricted __be64
> sound/soc/codecs/wm8958-dsp2.c:91:17: warning: cast to restricted __be64
> sound/soc/codecs/wm8958-dsp2.c:91:17: warning: cast to restricted __be64
> sound/soc/codecs/wm8958-dsp2.c:91:17: warning: cast to restricted __be64
> sound/soc/codecs/wm8958-dsp2.c:91:17: warning: cast to restricted __be64
> sound/soc/codecs/wm8958-dsp2.c:108:29: warning: cast to restricted __be32
> sound/soc/codecs/wm8958-dsp2.c:108:29: warning: cast to restricted __be32
> sound/soc/codecs/wm8958-dsp2.c:108:29: warning: cast to restricted __be32
> sound/soc/codecs/wm8958-dsp2.c:108:29: warning: cast to restricted __be32
> sound/soc/codecs/wm8958-dsp2.c:108:29: warning: cast to restricted __be32
> sound/soc/codecs/wm8958-dsp2.c:108:29: warning: cast to restricted __be32
> sound/soc/codecs/wm8958-dsp2.c:120:26: warning: cast to restricted __be32
> sound/soc/codecs/wm8958-dsp2.c:120:26: warning: cast to restricted __be32
> sound/soc/codecs/wm8958-dsp2.c:120:26: warning: cast to restricted __be32
> sound/soc/codecs/wm8958-dsp2.c:120:26: warning: cast to restricted __be32
> sound/soc/codecs/wm8958-dsp2.c:120:26: warning: cast to restricted __be32
> sound/soc/codecs/wm8958-dsp2.c:120:26: warning: cast to restricted __be32
> 
> Signed-off-by: Ben Dooks <ben.dooks at codethink.co.uk>
> ---

Acked-by: Charles Keepax <ckeepax at opensource.cirrus.com>

Thanks,
Charles


More information about the Alsa-devel mailing list