ASoC: wm_adsp: Only use __be32 for big-endian data
authorRichard Fitzgerald <rf@opensource.cirrus.com>
Wed, 30 Dec 2020 17:24:26 +0000 (17:24 +0000)
committerMark Brown <broonie@kernel.org>
Thu, 31 Dec 2020 13:26:23 +0000 (13:26 +0000)
commita0b653e89a3afd2a833f23589a83488fac842ddb
treebc850988d406b76e816e3ac3f1333c7e6b9a83e3
parente9141c1aaa72782b9de7b224cd184a809aa4a87f
ASoC: wm_adsp: Only use __be32 for big-endian data

This fixes some minor cases where u32 or unsigned int types were used
to store big-endian data, and __be32 types used to store both big-endian
and cpu-endian data. This was producing sparse warnings.

Most cases resulted from using the same variable to hold the big-endian
value and its converted cpu-endian value. These can be simply fixed by
introducing another local variable, or avoiding storing the intermediate
value back into the original variable.

One special case is the raw_buf used in the compressed streams to transfer
data from DSP to user-side. The endian conversion happens in-place (as
there's no point introducing another buffer) so a cast to (__be32 *) is
added when passing it to wm_adsp_read_raw_data_block().

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20201230172427.13865-1-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/wm_adsp.c