ASoC: fsl: fsl_qmc_audio: Fix snd_pcm_format_t values handling
authorHerve Codina <herve.codina@bootlin.com>
Wed, 26 Jul 2023 16:16:20 +0000 (18:16 +0200)
committerMark Brown <broonie@kernel.org>
Wed, 26 Jul 2023 18:08:15 +0000 (19:08 +0100)
commit5befe22b3eebd07b334b2917f6d14ce7ee4c8404
treeb55f66768b752211ffe8358e0789e230a80155a5
parentc17bd30d0ba5ca59266771cdfc387f26271a7042
ASoC: fsl: fsl_qmc_audio: Fix snd_pcm_format_t values handling

Running sparse on fsl_qmc_audio (make C=1) raises the following warnings:
 fsl_qmc_audio.c:387:26: warning: restricted snd_pcm_format_t degrades to integer
 fsl_qmc_audio.c:389:59: warning: incorrect type in argument 1 (different base types)
 fsl_qmc_audio.c:389:59:    expected restricted snd_pcm_format_t [usertype] format
 fsl_qmc_audio.c:389:59:    got unsigned int [assigned] i
 fsl_qmc_audio.c:564:26: warning: restricted snd_pcm_format_t degrades to integer
 fsl_qmc_audio.c:569:50: warning: incorrect type in argument 1 (different base types)
 fsl_qmc_audio.c:569:50:    expected restricted snd_pcm_format_t [usertype] format
 fsl_qmc_audio.c:569:50:    got int [assigned] i
 fsl_qmc_audio.c:573:62: warning: incorrect type in argument 1 (different base types)
 fsl_qmc_audio.c:573:62:    expected restricted snd_pcm_format_t [usertype] format
 fsl_qmc_audio.c:573:62:    got int [assigned] i

These warnings are due to snd_pcm_format_t values handling done in the
driver. Some macros and functions exist to handle safely these values.

Use dedicated macros and functions to remove these warnings.

Fixes: 075c7125b11c ("ASoC: fsl: Add support for QMC audio")
Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Link: https://lore.kernel.org/r/20230726161620.495298-1-herve.codina@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/fsl/fsl_qmc_audio.c