Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: fsl_asrc_m2m: force cast for snd_pcm_format_t type

Fix sparse warnings:

fsl_asrc_m2m.c:360:45: sparse: warning: incorrect type in argument 1 (different base types)
fsl_asrc_m2m.c:360:45: sparse: expected restricted snd_pcm_format_t [usertype] pcm_forma
fsl_asrc_m2m.c:360:45: sparse: got unsigned int [usertype] format
fsl_asrc_m2m.c:361:41: sparse: warning: incorrect type in assignment (different base types)
fsl_asrc_m2m.c:361:41: sparse: expected restricted snd_pcm_format_t
fsl_asrc_m2m.c:361:41: sparse: got unsigned int [usertype] format
fsl_asrc_m2m.c:365:45: sparse: warning: incorrect type in argument 1 (different base types)
fsl_asrc_m2m.c:365:45: sparse: expected restricted snd_pcm_format_t [usertype] pcm_forma
fsl_asrc_m2m.c:365:45: sparse: got unsigned int [usertype] pcm_format
fsl_asrc_m2m.c:366:42: sparse: warning: incorrect type in assignment (different base types)
fsl_asrc_m2m.c:366:42: sparse: expected restricted snd_pcm_format_t
fsl_asrc_m2m.c:366:42: sparse: got unsigned int [usertype] pcm_format
fsl_asrc_m2m.c:595:54: sparse: warning: incorrect type in assignment (different base types)
fsl_asrc_m2m.c:595:54: sparse: expected unsigned int [usertype] formats
fsl_asrc_m2m.c:595:54: sparse: got restricted snd_pcm_format_t [assigned] [usertype] k

Fixes: 24a01710f627 ("ASoC: fsl_asrc_m2m: Add memory to memory function")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202412180043.PAA4t4sQ-lkp@intel.com/
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://patch.msgid.link/20241218024358.3022635-1-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Shengjiu Wang and committed by
Mark Brown
cf126261 d349fd15

+5 -5
+5 -5
sound/soc/fsl/fsl_asrc_m2m.c
··· 357 357 if (ret) 358 358 return -EINVAL; 359 359 360 - if (pcm_format_to_bits(params->codec.format) & cap.fmt_in) 361 - pair->sample_format[IN] = params->codec.format; 360 + if (pcm_format_to_bits((__force snd_pcm_format_t)params->codec.format) & cap.fmt_in) 361 + pair->sample_format[IN] = (__force snd_pcm_format_t)params->codec.format; 362 362 else 363 363 return -EINVAL; 364 364 365 - if (pcm_format_to_bits(params->codec.pcm_format) & cap.fmt_out) 366 - pair->sample_format[OUT] = params->codec.pcm_format; 365 + if (pcm_format_to_bits((__force snd_pcm_format_t)params->codec.pcm_format) & cap.fmt_out) 366 + pair->sample_format[OUT] = (__force snd_pcm_format_t)params->codec.pcm_format; 367 367 else 368 368 return -EINVAL; 369 369 ··· 592 592 cap.rate_in, 593 593 cap.rate_in_count * sizeof(__u32)); 594 594 codec->descriptor[j].num_sample_rates = cap.rate_in_count; 595 - codec->descriptor[j].formats = k; 595 + codec->descriptor[j].formats = (__force __u32)k; 596 596 codec->descriptor[j].pcm_formats = cap.fmt_out; 597 597 codec->descriptor[j].src.out_sample_rate_min = cap.rate_out[0]; 598 598 codec->descriptor[j].src.out_sample_rate_max =