* [alsa-devel] [asoc:for-5.5 122/122] sound/soc/codecs/tas2562.c:195:14: sparse: sparse: restricted snd_pcm_format_t degrades to integer
@ 2019-10-10 16:41 kbuild test robot
2019-10-11 12:13 ` Dan Murphy
0 siblings, 1 reply; 5+ messages in thread
From: kbuild test robot @ 2019-10-10 16:41 UTC (permalink / raw)
To: Dan Murphy; +Cc: alsa-devel, Mark Brown, kbuild-all
tree: https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.5
head: c173dba44c2d2ec2adaa4e607e9729b74236bd57
commit: c173dba44c2d2ec2adaa4e607e9729b74236bd57 [122/122] ASoC: tas2562: Introduce the TAS2562 amplifier
reproduce:
# apt-get install sparse
# sparse version: v0.6.1-rc1-42-g38eda53-dirty
git checkout c173dba44c2d2ec2adaa4e607e9729b74236bd57
make ARCH=x86_64 allmodconfig
make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>
sparse warnings: (new ones prefixed by >>)
>> sound/soc/codecs/tas2562.c:195:14: sparse: sparse: restricted snd_pcm_format_t degrades to integer
sound/soc/codecs/tas2562.c:202:14: sparse: sparse: restricted snd_pcm_format_t degrades to integer
sound/soc/codecs/tas2562.c:209:14: sparse: sparse: restricted snd_pcm_format_t degrades to integer
>> sound/soc/codecs/tas2562.c:246:58: sparse: sparse: incorrect type in argument 2 (different base types) @@ expected int bitwidth @@ got restricted snd_pcm_formint bitwidth @@
>> sound/soc/codecs/tas2562.c:246:58: sparse: expected int bitwidth
>> sound/soc/codecs/tas2562.c:246:58: sparse: got restricted snd_pcm_format_t
sound/soc/codecs/tas2562.c:472:39: sparse: sparse: restricted snd_pcm_format_t degrades to integer
vim +195 sound/soc/codecs/tas2562.c
189
190 static int tas2562_set_bitwidth(struct tas2562_data *tas2562, int bitwidth)
191 {
192 int ret;
193
194 switch (bitwidth) {
> 195 case SNDRV_PCM_FORMAT_S16_LE:
196 snd_soc_component_update_bits(tas2562->component,
197 TAS2562_TDM_CFG2,
198 TAS2562_TDM_CFG2_RXWLEN_MASK,
199 TAS2562_TDM_CFG2_RXWLEN_16B);
200 tas2562->v_sense_slot = tas2562->i_sense_slot + 2;
201 break;
202 case SNDRV_PCM_FORMAT_S24_LE:
203 snd_soc_component_update_bits(tas2562->component,
204 TAS2562_TDM_CFG2,
205 TAS2562_TDM_CFG2_RXWLEN_MASK,
206 TAS2562_TDM_CFG2_RXWLEN_24B);
207 tas2562->v_sense_slot = tas2562->i_sense_slot + 4;
208 break;
209 case SNDRV_PCM_FORMAT_S32_LE:
210 snd_soc_component_update_bits(tas2562->component,
211 TAS2562_TDM_CFG2,
212 TAS2562_TDM_CFG2_RXWLEN_MASK,
213 TAS2562_TDM_CFG2_RXWLEN_32B);
214 tas2562->v_sense_slot = tas2562->i_sense_slot + 4;
215 break;
216
217 default:
218 dev_info(tas2562->dev, "Not supported params format\n");
219 }
220
221 ret = snd_soc_component_update_bits(tas2562->component,
222 TAS2562_TDM_CFG5,
223 TAS2562_TDM_CFG5_VSNS_EN | TAS2562_TDM_CFG5_VSNS_SLOT_MASK,
224 TAS2562_TDM_CFG5_VSNS_EN | tas2562->v_sense_slot);
225 if (ret < 0)
226 return ret;
227
228 ret = snd_soc_component_update_bits(tas2562->component,
229 TAS2562_TDM_CFG6,
230 TAS2562_TDM_CFG6_ISNS_EN | TAS2562_TDM_CFG6_ISNS_SLOT_MASK,
231 TAS2562_TDM_CFG6_ISNS_EN | tas2562->i_sense_slot);
232 if (ret < 0)
233 return ret;
234
235 return 0;
236 }
237
238 static int tas2562_hw_params(struct snd_pcm_substream *substream,
239 struct snd_pcm_hw_params *params,
240 struct snd_soc_dai *dai)
241 {
242 struct snd_soc_component *component = dai->component;
243 struct tas2562_data *tas2562 = snd_soc_component_get_drvdata(component);
244 int ret;
245
> 246 ret = tas2562_set_bitwidth(tas2562, params_format(params));
247 if (ret) {
248 dev_err(tas2562->dev, "set bitwidth failed, %d\n", ret);
249 return ret;
250 }
251
252 ret = tas2562_set_samplerate(tas2562, params_rate(params));
253 if (ret)
254 dev_err(tas2562->dev, "set bitwidth failed, %d\n", ret);
255
256 return ret;
257 }
258
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [alsa-devel] [asoc:for-5.5 122/122] sound/soc/codecs/tas2562.c:195:14: sparse: sparse: restricted snd_pcm_format_t degrades to integer
2019-10-10 16:41 [alsa-devel] [asoc:for-5.5 122/122] sound/soc/codecs/tas2562.c:195:14: sparse: sparse: restricted snd_pcm_format_t degrades to integer kbuild test robot
@ 2019-10-11 12:13 ` Dan Murphy
2019-10-21 19:19 ` Mark Brown
0 siblings, 1 reply; 5+ messages in thread
From: Dan Murphy @ 2019-10-11 12:13 UTC (permalink / raw)
To: kbuild test robot; +Cc: alsa-devel, Mark Brown, kbuild-all
Mark
On 10/10/19 11:41 AM, kbuild test robot wrote:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.5
> head: c173dba44c2d2ec2adaa4e607e9729b74236bd57
> commit: c173dba44c2d2ec2adaa4e607e9729b74236bd57 [122/122] ASoC: tas2562: Introduce the TAS2562 amplifier
> reproduce:
> # apt-get install sparse
> # sparse version: v0.6.1-rc1-42-g38eda53-dirty
> git checkout c173dba44c2d2ec2adaa4e607e9729b74236bd57
> make ARCH=x86_64 allmodconfig
> make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
>
> If you fix the issue, kindly add following tag
> Reported-by: kbuild test robot <lkp@intel.com>
>
>
> sparse warnings: (new ones prefixed by >>)
>
>>> sound/soc/codecs/tas2562.c:195:14: sparse: sparse: restricted snd_pcm_format_t degrades to integer
> sound/soc/codecs/tas2562.c:202:14: sparse: sparse: restricted snd_pcm_format_t degrades to integer
> sound/soc/codecs/tas2562.c:209:14: sparse: sparse: restricted snd_pcm_format_t degrades to integer
>>> sound/soc/codecs/tas2562.c:246:58: sparse: sparse: incorrect type in argument 2 (different base types) @@ expected int bitwidth @@ got restricted snd_pcm_formint bitwidth @@
>>> sound/soc/codecs/tas2562.c:246:58: sparse: expected int bitwidth
>>> sound/soc/codecs/tas2562.c:246:58: sparse: got restricted snd_pcm_format_t
> sound/soc/codecs/tas2562.c:472:39: sparse: sparse: restricted snd_pcm_format_t degrades to integer
>
> vim +195 sound/soc/codecs/tas2562.c
>
> 189
> 190 static int tas2562_set_bitwidth(struct tas2562_data *tas2562, int bitwidth)
The only fix I can see here is to change bitwidth to snd_pcm_format_t as
opposed to an integer.
But that still gives this sparse warning. The way the code below is
written to be consistent throughout the drivers so are these warnings
false positives?
I get similar ones for the tas2770 as well
Dan
> 191 {
> 192 int ret;
> 193
> 194 switch (bitwidth) {
> > 195 case SNDRV_PCM_FORMAT_S16_LE:
> <snip>
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [alsa-devel] [asoc:for-5.5 122/122] sound/soc/codecs/tas2562.c:195:14: sparse: sparse: restricted snd_pcm_format_t degrades to integer
2019-10-11 12:13 ` Dan Murphy
@ 2019-10-21 19:19 ` Mark Brown
2019-10-22 0:17 ` [alsa-devel] [kbuild-all] " Rong Chen
2019-10-22 5:08 ` [alsa-devel] " Takashi Iwai
0 siblings, 2 replies; 5+ messages in thread
From: Mark Brown @ 2019-10-21 19:19 UTC (permalink / raw)
To: Dan Murphy; +Cc: alsa-devel, kbuild test robot, kbuild-all
[-- Attachment #1.1: Type: text/plain, Size: 532 bytes --]
On Fri, Oct 11, 2019 at 07:13:38AM -0500, Dan Murphy wrote:
> On 10/10/19 11:41 AM, kbuild test robot wrote:
> > 190 static int tas2562_set_bitwidth(struct tas2562_data *tas2562, int bitwidth)
> The only fix I can see here is to change bitwidth to snd_pcm_format_t as
> But that still gives this sparse warning. The way the code below is
> written to be consistent throughout the drivers so are these warnings false
> positives?
I think so, yes. Or at least I can't see any sensible way to stop this
anyway.
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 161 bytes --]
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [alsa-devel] [kbuild-all] Re: [asoc:for-5.5 122/122] sound/soc/codecs/tas2562.c:195:14: sparse: sparse: restricted snd_pcm_format_t degrades to integer
2019-10-21 19:19 ` Mark Brown
@ 2019-10-22 0:17 ` Rong Chen
2019-10-22 5:08 ` [alsa-devel] " Takashi Iwai
1 sibling, 0 replies; 5+ messages in thread
From: Rong Chen @ 2019-10-22 0:17 UTC (permalink / raw)
To: Mark Brown, Dan Murphy; +Cc: alsa-devel, kbuild test robot, kbuild-all
On 10/22/19 3:19 AM, Mark Brown wrote:
> On Fri, Oct 11, 2019 at 07:13:38AM -0500, Dan Murphy wrote:
>> On 10/10/19 11:41 AM, kbuild test robot wrote:
>>> 190 static int tas2562_set_bitwidth(struct tas2562_data *tas2562, int bitwidth)
>> The only fix I can see here is to change bitwidth to snd_pcm_format_t as
>> But that still gives this sparse warning. The way the code below is
>> written to be consistent throughout the drivers so are these warnings false
>> positives?
> I think so, yes. Or at least I can't see any sensible way to stop this
> anyway.
>
Hi,
Sorry for the inconvenience, we'll take a look at it asap.
Best Regards,
Rong Chen
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [alsa-devel] [asoc:for-5.5 122/122] sound/soc/codecs/tas2562.c:195:14: sparse: sparse: restricted snd_pcm_format_t degrades to integer
2019-10-21 19:19 ` Mark Brown
2019-10-22 0:17 ` [alsa-devel] [kbuild-all] " Rong Chen
@ 2019-10-22 5:08 ` Takashi Iwai
1 sibling, 0 replies; 5+ messages in thread
From: Takashi Iwai @ 2019-10-22 5:08 UTC (permalink / raw)
To: Mark Brown; +Cc: kbuild-all, alsa-devel, Dan Murphy, kbuild test robot
On Mon, 21 Oct 2019 21:19:13 +0200,
Mark Brown wrote:
>
> On Fri, Oct 11, 2019 at 07:13:38AM -0500, Dan Murphy wrote:
> > On 10/10/19 11:41 AM, kbuild test robot wrote:
>
> > > 190 static int tas2562_set_bitwidth(struct tas2562_data *tas2562, int bitwidth)
>
> > The only fix I can see here is to change bitwidth to snd_pcm_format_t as
>
> > But that still gives this sparse warning. The way the code below is
> > written to be consistent throughout the drivers so are these warnings false
> > positives?
>
> I think so, yes. Or at least I can't see any sensible way to stop this
> anyway.
You can pass the real bit width (16, 24, 32) via
snd_pcm_format_width().
BTW, the error message after tas2562_set_samplerate() seems bogus,
still indicating the bitwidth instead of the rate.
thanks,
Takashi
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2019-10-22 5:09 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-10 16:41 [alsa-devel] [asoc:for-5.5 122/122] sound/soc/codecs/tas2562.c:195:14: sparse: sparse: restricted snd_pcm_format_t degrades to integer kbuild test robot
2019-10-11 12:13 ` Dan Murphy
2019-10-21 19:19 ` Mark Brown
2019-10-22 0:17 ` [alsa-devel] [kbuild-all] " Rong Chen
2019-10-22 5:08 ` [alsa-devel] " Takashi Iwai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).