]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
ASoC: soc-compress: assume SNDRV_PCM_STREAM_xxx and SND_COMPRESS_xxx are same
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Fri, 30 Oct 2020 01:01:22 +0000 (10:01 +0900)
committerMark Brown <broonie@kernel.org>
Tue, 10 Nov 2020 14:26:00 +0000 (14:26 +0000)
commit7428d8c8bd7936840b4615df674cee5fce1eb385
tree042931e2cf106871ead7e17f8233363952407b7d
parenteb84959ab8c0ca2897e69575110bdaaf2d532eb7
ASoC: soc-compress: assume SNDRV_PCM_STREAM_xxx and SND_COMPRESS_xxx are same

soc-compress.c is using both SND_COMPRESS_xxx and SND_PCM_STREAM_xxx.
These are defined as UAPI, and has same value.

enum {
SNDRV_PCM_STREAM_PLAYBACK = 0,
SNDRV_PCM_STREAM_CAPTURE,
...
};

enum snd_compr_direction {
SND_COMPRESS_PLAYBACK = 0,
SND_COMPRESS_CAPTURE
};

Essentially both COMPRESS and PCM_STREAM definitions are identical,
and can be never different because of ABI compatibility,
which means it's safe to mix both variants in the code.

This patch checks it by BUILD_BUG_ON(), and merge to use.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87361wmsyg.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/soc-compress.c