lkml.org 
[lkml]   [2021]   [Nov]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectsound/soc/fsl/imx-card.c:631:59: sparse: sparse: incorrect type in assignment (different base types)
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: a90af8f15bdc9449ee2d24e1d73fa3f7e8633f81
commit: aa736700f42fa0813e286ca2f9274ffaa25163b9 ASoC: imx-card: Add imx-card machine driver
date: 6 months ago
config: sparc64-randconfig-s031-20211116 (attached as .config)
compiler: sparc64-linux-gcc (GCC) 11.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.4-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=aa736700f42fa0813e286ca2f9274ffaa25163b9
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout aa736700f42fa0813e286ca2f9274ffaa25163b9
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=sparc64

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


sparse warnings: (new ones prefixed by >>)
sound/soc/fsl/imx-card.c:121:27: sparse: sparse: symbol 'ak4458_fs_mul' was not declared. Should it be static?
sound/soc/fsl/imx-card.c:138:31: sparse: sparse: symbol 'ak4458_tdm_fs_mul' was not declared. Should it be static?
sound/soc/fsl/imx-card.c:149:27: sparse: sparse: symbol 'ak4497_fs_mul' was not declared. Should it be static?
sound/soc/fsl/imx-card.c:166:27: sparse: sparse: symbol 'ak5558_fs_mul' was not declared. Should it be static?
sound/soc/fsl/imx-card.c:180:31: sparse: sparse: symbol 'ak5558_tdm_fs_mul' was not declared. Should it be static?
>> sound/soc/fsl/imx-card.c:631:59: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] asrc_format @@ got restricted snd_pcm_format_t [usertype] @@
sound/soc/fsl/imx-card.c:631:59: sparse: expected unsigned int [usertype] asrc_format
sound/soc/fsl/imx-card.c:631:59: sparse: got restricted snd_pcm_format_t [usertype]
sound/soc/fsl/imx-card.c:633:59: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] asrc_format @@ got restricted snd_pcm_format_t [usertype] @@
sound/soc/fsl/imx-card.c:633:59: sparse: expected unsigned int [usertype] asrc_format
sound/soc/fsl/imx-card.c:633:59: sparse: got restricted snd_pcm_format_t [usertype]

vim +631 sound/soc/fsl/imx-card.c

472
473 static int imx_card_parse_of(struct imx_card_data *data)
474 {
475 struct imx_card_plat_data *plat_data = data->plat_data;
476 struct snd_soc_card *card = &data->card;
477 struct snd_soc_dai_link_component *dlc;
478 struct device_node *platform = NULL;
479 struct device_node *codec = NULL;
480 struct device_node *cpu = NULL;
481 struct device_node *np;
482 struct device *dev = card->dev;
483 struct snd_soc_dai_link *link;
484 struct dai_link_data *link_data;
485 struct of_phandle_args args;
486 int ret, num_links;
487 u32 width;
488
489 ret = snd_soc_of_parse_card_name(card, "model");
490 if (ret) {
491 dev_err(dev, "Error parsing card name: %d\n", ret);
492 return ret;
493 }
494
495 /* DAPM routes */
496 if (of_property_read_bool(dev->of_node, "audio-routing")) {
497 ret = snd_soc_of_parse_audio_routing(card, "audio-routing");
498 if (ret)
499 return ret;
500 }
501
502 /* Populate links */
503 num_links = of_get_child_count(dev->of_node);
504
505 /* Allocate the DAI link array */
506 card->dai_link = devm_kcalloc(dev, num_links, sizeof(*link), GFP_KERNEL);
507 if (!card->dai_link)
508 return -ENOMEM;
509
510 data->link_data = devm_kcalloc(dev, num_links, sizeof(*link), GFP_KERNEL);
511 if (!data->link_data)
512 return -ENOMEM;
513
514 card->num_links = num_links;
515 link = card->dai_link;
516 link_data = data->link_data;
517
518 for_each_child_of_node(dev->of_node, np) {
519 dlc = devm_kzalloc(dev, 2 * sizeof(*dlc), GFP_KERNEL);
520 if (!dlc) {
521 ret = -ENOMEM;
522 goto err_put_np;
523 }
524
525 link->cpus = &dlc[0];
526 link->platforms = &dlc[1];
527
528 link->num_cpus = 1;
529 link->num_platforms = 1;
530
531 ret = of_property_read_string(np, "link-name", &link->name);
532 if (ret) {
533 dev_err(card->dev, "error getting codec dai_link name\n");
534 goto err_put_np;
535 }
536
537 cpu = of_get_child_by_name(np, "cpu");
538 if (!cpu) {
539 dev_err(dev, "%s: Can't find cpu DT node\n", link->name);
540 ret = -EINVAL;
541 goto err;
542 }
543
544 ret = of_parse_phandle_with_args(cpu, "sound-dai",
545 "#sound-dai-cells", 0, &args);
546 if (ret) {
547 dev_err(card->dev, "%s: error getting cpu phandle\n", link->name);
548 goto err;
549 }
550
551 if (of_node_name_eq(args.np, "sai")) {
552 /* sai sysclk id */
553 link_data->cpu_sysclk_id = FSL_SAI_CLK_MAST1;
554
555 /* sai may support mclk/bclk = 1 */
556 if (of_find_property(np, "fsl,mclk-equal-bclk", NULL))
557 link_data->one2one_ratio = true;
558 }
559
560 link->cpus->of_node = args.np;
561 link->platforms->of_node = link->cpus->of_node;
562 link->id = args.args[0];
563
564 ret = snd_soc_of_get_dai_name(cpu, &link->cpus->dai_name);
565 if (ret) {
566 if (ret != -EPROBE_DEFER)
567 dev_err(card->dev, "%s: error getting cpu dai name: %d\n",
568 link->name, ret);
569 goto err;
570 }
571
572 codec = of_get_child_by_name(np, "codec");
573 if (codec) {
574 ret = snd_soc_of_get_dai_link_codecs(dev, codec, link);
575 if (ret < 0) {
576 if (ret != -EPROBE_DEFER)
577 dev_err(dev, "%s: codec dai not found: %d\n",
578 link->name, ret);
579 goto err;
580 }
581
582 plat_data->num_codecs = link->num_codecs;
583
584 /* Check the akcodec type */
585 if (!strcmp(link->codecs->dai_name, "ak4458-aif"))
586 plat_data->type = CODEC_AK4458;
587 else if (!strcmp(link->codecs->dai_name, "ak4497-aif"))
588 plat_data->type = CODEC_AK4497;
589 else if (!strcmp(link->codecs->dai_name, "ak5558-aif"))
590 plat_data->type = CODEC_AK5558;
591 else if (!strcmp(link->codecs->dai_name, "ak5552-aif"))
592 plat_data->type = CODEC_AK5552;
593
594 } else {
595 dlc = devm_kzalloc(dev, sizeof(*dlc), GFP_KERNEL);
596 if (!dlc) {
597 ret = -ENOMEM;
598 goto err;
599 }
600
601 link->codecs = dlc;
602 link->num_codecs = 1;
603
604 link->codecs->dai_name = "snd-soc-dummy-dai";
605 link->codecs->name = "snd-soc-dummy";
606 }
607
608 if (!strncmp(link->name, "HiFi-ASRC-FE", 12)) {
609 /* DPCM frontend */
610 link->dynamic = 1;
611 link->dpcm_merged_chan = 1;
612
613 ret = of_property_read_u32(args.np, "fsl,asrc-rate", &data->asrc_rate);
614 if (ret) {
615 dev_err(dev, "failed to get output rate\n");
616 ret = -EINVAL;
617 goto err;
618 }
619
620 ret = of_property_read_u32(args.np, "fsl,asrc-format", &data->asrc_format);
621 if (ret) {
622 /* Fallback to old binding; translate to asrc_format */
623 ret = of_property_read_u32(args.np, "fsl,asrc-width", &width);
624 if (ret) {
625 dev_err(dev,
626 "failed to decide output format\n");
627 goto err;
628 }
629
630 if (width == 24)
> 631 data->asrc_format = SNDRV_PCM_FORMAT_S24_LE;
632 else
633 data->asrc_format = SNDRV_PCM_FORMAT_S16_LE;
634 }
635 } else if (!strncmp(link->name, "HiFi-ASRC-BE", 12)) {
636 /* DPCM backend */
637 link->no_pcm = 1;
638 link->platforms->of_node = NULL;
639 link->platforms->name = "snd-soc-dummy";
640
641 link->be_hw_params_fixup = be_hw_params_fixup;
642 link->ops = &imx_aif_ops_be;
643 } else {
644 link->ops = &imx_aif_ops;
645 }
646
647 if (link->no_pcm || link->dynamic)
648 snd_soc_dai_link_set_capabilities(link);
649
650 /* Get dai fmt */
651 ret = asoc_simple_parse_daifmt(dev, np, codec,
652 NULL, &link->dai_fmt);
653 if (ret)
654 link->dai_fmt = SND_SOC_DAIFMT_NB_NF |
655 SND_SOC_DAIFMT_CBS_CFS |
656 SND_SOC_DAIFMT_I2S;
657
658 /* Get tdm slot */
659 snd_soc_of_parse_tdm_slot(np, NULL, NULL,
660 &link_data->slots,
661 &link_data->slot_width);
662 /* default value */
663 if (!link_data->slots)
664 link_data->slots = 2;
665
666 if (!link_data->slot_width)
667 link_data->slot_width = 32;
668
669 link->ignore_pmdown_time = 1;
670 link->stream_name = link->name;
671 link++;
672 link_data++;
673
674 of_node_put(cpu);
675 of_node_put(codec);
676 of_node_put(platform);
677 }
678
679 return 0;
680 err:
681 of_node_put(cpu);
682 of_node_put(codec);
683 of_node_put(platform);
684 err_put_np:
685 of_node_put(np);
686 return ret;
687 }
688

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[unhandled content-type:application/gzip]
\
 
 \ /
  Last update: 2021-11-20 17:20    [W:0.032 / U:0.360 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site