* [esmil:visionfive 40/47] sound/soc/starfive/spdif.c:147:16: sparse: sparse: incorrect type in assignment (different base types)
@ 2023-11-24 21:54 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2023-11-24 21:54 UTC (permalink / raw)
To: Walker Chen
Cc: oe-kbuild-all, Emil Renner Berthing, Michael Yan, Jenny Zhang,
Geert Uytterhoeven
tree: https://github.com/esmil/linux visionfive
head: f7c19b2d41e07d930d09b40751161839e067fda2
commit: 20a6ebed8151ebd4c14fb8b7847b83efc31a3652 [40/47] ASoC: starfive: Add StarFive JH7100 audio drivers
config: csky-randconfig-r113-20231124 (https://download.01.org/0day-ci/archive/20231125/202311250200.fU0qPx4X-lkp@intel.com/config)
compiler: csky-linux-gcc (GCC) 13.2.0
reproduce: (https://download.01.org/0day-ci/archive/20231125/202311250200.fU0qPx4X-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202311250200.fU0qPx4X-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
>> sound/soc/starfive/spdif.c:147:16: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int format @@ got restricted snd_pcm_format_t @@
sound/soc/starfive/spdif.c:147:16: sparse: expected unsigned int format
sound/soc/starfive/spdif.c:147:16: sparse: got restricted snd_pcm_format_t
>> sound/soc/starfive/spdif.c:158:14: sparse: sparse: restricted snd_pcm_format_t degrades to integer
sound/soc/starfive/spdif.c:159:14: sparse: sparse: restricted snd_pcm_format_t degrades to integer
sound/soc/starfive/spdif.c:160:14: sparse: sparse: restricted snd_pcm_format_t degrades to integer
sound/soc/starfive/spdif.c: note: in included file (through include/linux/mmzone.h, include/linux/gfp.h, include/linux/umh.h, include/linux/kmod.h, ...):
include/linux/page-flags.h:242:46: sparse: sparse: self-comparison always evaluates to false
vim +147 sound/soc/starfive/spdif.c
135
136 static int sf_spdif_hw_params(struct snd_pcm_substream *substream,
137 struct snd_pcm_hw_params *params, struct snd_soc_dai *dai)
138 {
139 struct sf_spdif_dev *spdif = snd_soc_dai_get_drvdata(dai);
140 unsigned int channels;
141 unsigned int rate;
142 unsigned int format;
143 unsigned int tsamplerate;
144
145 channels = params_channels(params);
146 rate = params_rate(params);
> 147 format = params_format(params);
148
149 switch (channels) {
150 case 2:
151 break;
152 default:
153 dev_err(dai->dev, "invalid channels number\n");
154 return -EINVAL;
155 }
156
157 switch (format) {
> 158 case SNDRV_PCM_FORMAT_S16_LE:
159 case SNDRV_PCM_FORMAT_S24_LE:
160 case SNDRV_PCM_FORMAT_S32_LE:
161 break;
162 default:
163 dev_err(spdif->dev, "invalid format\n");
164 return -EINVAL;
165 }
166
167 switch (rate) {
168 case 8000:
169 case 11025:
170 case 16000:
171 case 22050:
172 break;
173 default:
174 printk(KERN_ERR "channel:%d sample rate:%d\n", channels, rate);
175 return -EINVAL;
176 }
177
178 /* 12288000/128=96000 */
179 tsamplerate = (96000 + rate/2)/rate - 1;
180
181 if (rate < 3) {
182 return -EINVAL;
183 }
184
185 /* transmission sample rate */
186 regmap_update_bits(spdif->regmap, SPDIF_CTRL, 0xFF, tsamplerate);
187
188 return 0;
189 }
190
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-11-24 21:54 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-24 21:54 [esmil:visionfive 40/47] sound/soc/starfive/spdif.c:147:16: sparse: sparse: incorrect type in assignment (different base types) kernel test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.