• Ben Dooks (Codethink)'s avatar
    ASoC: wm8958: use <asm/unaligned.h> to simplify code · 3ad00f6a
    Ben Dooks (Codethink) authored
    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: default avatarBen Dooks <ben.dooks@codethink.co.uk>
    Acked-by: default avatarCharles Keepax <ckeepax@opensource.cirrus.com>
    Link: https://lore.kernel.org/r/20191016120149.5860-1-ben.dooks@codethink.co.ukSigned-off-by: default avatarMark Brown <broonie@kernel.org>
    3ad00f6a
wm8958-dsp2.c 28.1 KB