All of lore.kernel.org
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: [linux-next:master 2996/14131] sound/soc/fsl/fsl_asrc.c:1050:60: sparse: got restricted snd_pcm_format_t *
Date: Tue, 09 Jun 2020 23:09:47 +0800	[thread overview]
Message-ID: <20200609150947.GK23011@xsang-OptiPlex-9020> (raw)

[-- Attachment #1: Type: text/plain, Size: 13618 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   e7b08814b16b80a0bf76eeca16317f8c2ed23b8c
commit: 4520af41fd21863d026d53c7e1eb987509cb3c24 [2996/14131] ASoC: fsl_asrc: Support new property fsl,asrc-format
:::::: branch date: 3 days ago
:::::: commit date: 6 weeks ago
config: openrisc-randconfig-s031-20200601 (attached as .config)
compiler: or1k-linux-gcc (GCC) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.1-243-gc100a7ab-dirty
        git checkout 4520af41fd21863d026d53c7e1eb987509cb3c24
        # save the attached .config to linux build tree
        make W=1 C=1 ARCH=openrisc CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'

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


sparse warnings: (new ones prefixed by >>)

   sound/soc/fsl/fsl_asrc.c:1050:60: sparse: sparse: incorrect type in argument 3 (different base types) @@     expected unsigned int [usertype] *out_value @@     got restricted snd_pcm_format_t * @@
   sound/soc/fsl/fsl_asrc.c:1050:60: sparse:     expected unsigned int [usertype] *out_value
>> sound/soc/fsl/fsl_asrc.c:1050:60: sparse:     got restricted snd_pcm_format_t *
   sound/soc/fsl/fsl_asrc.c:1073:47: sparse: sparse: restricted snd_pcm_format_t degrades to integer

# https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=4520af41fd21863d026d53c7e1eb987509cb3c24
git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git remote update linux-next
git checkout 4520af41fd21863d026d53c7e1eb987509cb3c24
vim +1050 sound/soc/fsl/fsl_asrc.c

3117bb3109dc22 Nicolin Chen  2014-07-29   933  
3117bb3109dc22 Nicolin Chen  2014-07-29   934  static int fsl_asrc_probe(struct platform_device *pdev)
3117bb3109dc22 Nicolin Chen  2014-07-29   935  {
3117bb3109dc22 Nicolin Chen  2014-07-29   936  	struct device_node *np = pdev->dev.of_node;
7470704d8b425c Shengjiu Wang 2020-04-16   937  	struct fsl_asrc *asrc;
3117bb3109dc22 Nicolin Chen  2014-07-29   938  	struct resource *res;
3117bb3109dc22 Nicolin Chen  2014-07-29   939  	void __iomem *regs;
3117bb3109dc22 Nicolin Chen  2014-07-29   940  	int irq, ret, i;
c05f10f28ef697 Shengjiu Wang 2019-12-04   941  	u32 map_idx;
3117bb3109dc22 Nicolin Chen  2014-07-29   942  	char tmp[16];
4520af41fd2186 Shengjiu Wang 2020-04-16   943  	u32 width;
3117bb3109dc22 Nicolin Chen  2014-07-29   944  
7470704d8b425c Shengjiu Wang 2020-04-16   945  	asrc = devm_kzalloc(&pdev->dev, sizeof(*asrc), GFP_KERNEL);
7470704d8b425c Shengjiu Wang 2020-04-16   946  	if (!asrc)
3117bb3109dc22 Nicolin Chen  2014-07-29   947  		return -ENOMEM;
3117bb3109dc22 Nicolin Chen  2014-07-29   948  
7470704d8b425c Shengjiu Wang 2020-04-16   949  	asrc->pdev = pdev;
3117bb3109dc22 Nicolin Chen  2014-07-29   950  
3117bb3109dc22 Nicolin Chen  2014-07-29   951  	/* Get the addresses and IRQ */
3117bb3109dc22 Nicolin Chen  2014-07-29   952  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
3117bb3109dc22 Nicolin Chen  2014-07-29   953  	regs = devm_ioremap_resource(&pdev->dev, res);
3117bb3109dc22 Nicolin Chen  2014-07-29   954  	if (IS_ERR(regs))
3117bb3109dc22 Nicolin Chen  2014-07-29   955  		return PTR_ERR(regs);
3117bb3109dc22 Nicolin Chen  2014-07-29   956  
7470704d8b425c Shengjiu Wang 2020-04-16   957  	asrc->paddr = res->start;
3117bb3109dc22 Nicolin Chen  2014-07-29   958  
7470704d8b425c Shengjiu Wang 2020-04-16   959  	asrc->regmap = devm_regmap_init_mmio_clk(&pdev->dev, "mem", regs,
3117bb3109dc22 Nicolin Chen  2014-07-29   960  						 &fsl_asrc_regmap_config);
7470704d8b425c Shengjiu Wang 2020-04-16   961  	if (IS_ERR(asrc->regmap)) {
3117bb3109dc22 Nicolin Chen  2014-07-29   962  		dev_err(&pdev->dev, "failed to init regmap\n");
7470704d8b425c Shengjiu Wang 2020-04-16   963  		return PTR_ERR(asrc->regmap);
3117bb3109dc22 Nicolin Chen  2014-07-29   964  	}
3117bb3109dc22 Nicolin Chen  2014-07-29   965  
3117bb3109dc22 Nicolin Chen  2014-07-29   966  	irq = platform_get_irq(pdev, 0);
cf9441adb1a355 Stephen Boyd  2019-07-30   967  	if (irq < 0)
3117bb3109dc22 Nicolin Chen  2014-07-29   968  		return irq;
3117bb3109dc22 Nicolin Chen  2014-07-29   969  
3117bb3109dc22 Nicolin Chen  2014-07-29   970  	ret = devm_request_irq(&pdev->dev, irq, fsl_asrc_isr, 0,
7470704d8b425c Shengjiu Wang 2020-04-16   971  			       dev_name(&pdev->dev), asrc);
3117bb3109dc22 Nicolin Chen  2014-07-29   972  	if (ret) {
3117bb3109dc22 Nicolin Chen  2014-07-29   973  		dev_err(&pdev->dev, "failed to claim irq %u: %d\n", irq, ret);
3117bb3109dc22 Nicolin Chen  2014-07-29   974  		return ret;
3117bb3109dc22 Nicolin Chen  2014-07-29   975  	}
3117bb3109dc22 Nicolin Chen  2014-07-29   976  
7470704d8b425c Shengjiu Wang 2020-04-16   977  	asrc->mem_clk = devm_clk_get(&pdev->dev, "mem");
7470704d8b425c Shengjiu Wang 2020-04-16   978  	if (IS_ERR(asrc->mem_clk)) {
3117bb3109dc22 Nicolin Chen  2014-07-29   979  		dev_err(&pdev->dev, "failed to get mem clock\n");
7470704d8b425c Shengjiu Wang 2020-04-16   980  		return PTR_ERR(asrc->mem_clk);
3117bb3109dc22 Nicolin Chen  2014-07-29   981  	}
3117bb3109dc22 Nicolin Chen  2014-07-29   982  
7470704d8b425c Shengjiu Wang 2020-04-16   983  	asrc->ipg_clk = devm_clk_get(&pdev->dev, "ipg");
7470704d8b425c Shengjiu Wang 2020-04-16   984  	if (IS_ERR(asrc->ipg_clk)) {
3117bb3109dc22 Nicolin Chen  2014-07-29   985  		dev_err(&pdev->dev, "failed to get ipg clock\n");
7470704d8b425c Shengjiu Wang 2020-04-16   986  		return PTR_ERR(asrc->ipg_clk);
3117bb3109dc22 Nicolin Chen  2014-07-29   987  	}
3117bb3109dc22 Nicolin Chen  2014-07-29   988  
7470704d8b425c Shengjiu Wang 2020-04-16   989  	asrc->spba_clk = devm_clk_get(&pdev->dev, "spba");
7470704d8b425c Shengjiu Wang 2020-04-16   990  	if (IS_ERR(asrc->spba_clk))
13b8a97a760eee Shengjiu Wang 2015-11-24   991  		dev_warn(&pdev->dev, "failed to get spba clock\n");
13b8a97a760eee Shengjiu Wang 2015-11-24   992  
3117bb3109dc22 Nicolin Chen  2014-07-29   993  	for (i = 0; i < ASRC_CLK_MAX_NUM; i++) {
3117bb3109dc22 Nicolin Chen  2014-07-29   994  		sprintf(tmp, "asrck_%x", i);
7470704d8b425c Shengjiu Wang 2020-04-16   995  		asrc->asrck_clk[i] = devm_clk_get(&pdev->dev, tmp);
7470704d8b425c Shengjiu Wang 2020-04-16   996  		if (IS_ERR(asrc->asrck_clk[i])) {
3117bb3109dc22 Nicolin Chen  2014-07-29   997  			dev_err(&pdev->dev, "failed to get %s clock\n", tmp);
7470704d8b425c Shengjiu Wang 2020-04-16   998  			return PTR_ERR(asrc->asrck_clk[i]);
3117bb3109dc22 Nicolin Chen  2014-07-29   999  		}
3117bb3109dc22 Nicolin Chen  2014-07-29  1000  	}
3117bb3109dc22 Nicolin Chen  2014-07-29  1001  
7470704d8b425c Shengjiu Wang 2020-04-16  1002  	asrc->soc = of_device_get_match_data(&pdev->dev);
7470704d8b425c Shengjiu Wang 2020-04-16  1003  	if (!asrc->soc) {
c05f10f28ef697 Shengjiu Wang 2019-12-04  1004  		dev_err(&pdev->dev, "failed to get soc data\n");
c05f10f28ef697 Shengjiu Wang 2019-12-04  1005  		return -ENODEV;
c05f10f28ef697 Shengjiu Wang 2019-12-04  1006  	}
c05f10f28ef697 Shengjiu Wang 2019-12-04  1007  
f3d8ac8c4afea2 Fabio Estevam 2016-08-19  1008  	if (of_device_is_compatible(np, "fsl,imx35-asrc")) {
7470704d8b425c Shengjiu Wang 2020-04-16  1009  		asrc->clk_map[IN] = input_clk_map_imx35;
7470704d8b425c Shengjiu Wang 2020-04-16  1010  		asrc->clk_map[OUT] = output_clk_map_imx35;
c05f10f28ef697 Shengjiu Wang 2019-12-04  1011  	} else if (of_device_is_compatible(np, "fsl,imx53-asrc")) {
7470704d8b425c Shengjiu Wang 2020-04-16  1012  		asrc->clk_map[IN] = input_clk_map_imx53;
7470704d8b425c Shengjiu Wang 2020-04-16  1013  		asrc->clk_map[OUT] = output_clk_map_imx53;
c05f10f28ef697 Shengjiu Wang 2019-12-04  1014  	} else if (of_device_is_compatible(np, "fsl,imx8qm-asrc") ||
c05f10f28ef697 Shengjiu Wang 2019-12-04  1015  		   of_device_is_compatible(np, "fsl,imx8qxp-asrc")) {
c05f10f28ef697 Shengjiu Wang 2019-12-04  1016  		ret = of_property_read_u32(np, "fsl,asrc-clk-map", &map_idx);
c05f10f28ef697 Shengjiu Wang 2019-12-04  1017  		if (ret) {
c05f10f28ef697 Shengjiu Wang 2019-12-04  1018  			dev_err(&pdev->dev, "failed to get clk map index\n");
c05f10f28ef697 Shengjiu Wang 2019-12-04  1019  			return ret;
c05f10f28ef697 Shengjiu Wang 2019-12-04  1020  		}
c05f10f28ef697 Shengjiu Wang 2019-12-04  1021  
c05f10f28ef697 Shengjiu Wang 2019-12-04  1022  		if (map_idx > 1) {
c05f10f28ef697 Shengjiu Wang 2019-12-04  1023  			dev_err(&pdev->dev, "unsupported clk map index\n");
c05f10f28ef697 Shengjiu Wang 2019-12-04  1024  			return -EINVAL;
c05f10f28ef697 Shengjiu Wang 2019-12-04  1025  		}
c05f10f28ef697 Shengjiu Wang 2019-12-04  1026  		if (of_device_is_compatible(np, "fsl,imx8qm-asrc")) {
7470704d8b425c Shengjiu Wang 2020-04-16  1027  			asrc->clk_map[IN] = clk_map_imx8qm[map_idx];
7470704d8b425c Shengjiu Wang 2020-04-16  1028  			asrc->clk_map[OUT] = clk_map_imx8qm[map_idx];
3117bb3109dc22 Nicolin Chen  2014-07-29  1029  		} else {
7470704d8b425c Shengjiu Wang 2020-04-16  1030  			asrc->clk_map[IN] = clk_map_imx8qxp[map_idx];
7470704d8b425c Shengjiu Wang 2020-04-16  1031  			asrc->clk_map[OUT] = clk_map_imx8qxp[map_idx];
c05f10f28ef697 Shengjiu Wang 2019-12-04  1032  		}
3117bb3109dc22 Nicolin Chen  2014-07-29  1033  	}
3117bb3109dc22 Nicolin Chen  2014-07-29  1034  
7470704d8b425c Shengjiu Wang 2020-04-16  1035  	ret = fsl_asrc_init(asrc);
3117bb3109dc22 Nicolin Chen  2014-07-29  1036  	if (ret) {
3117bb3109dc22 Nicolin Chen  2014-07-29  1037  		dev_err(&pdev->dev, "failed to init asrc %d\n", ret);
c0296950851455 Fabio Estevam 2016-08-19  1038  		return ret;
3117bb3109dc22 Nicolin Chen  2014-07-29  1039  	}
3117bb3109dc22 Nicolin Chen  2014-07-29  1040  
7470704d8b425c Shengjiu Wang 2020-04-16  1041  	asrc->channel_avail = 10;
3117bb3109dc22 Nicolin Chen  2014-07-29  1042  
3117bb3109dc22 Nicolin Chen  2014-07-29  1043  	ret = of_property_read_u32(np, "fsl,asrc-rate",
7470704d8b425c Shengjiu Wang 2020-04-16  1044  				   &asrc->asrc_rate);
3117bb3109dc22 Nicolin Chen  2014-07-29  1045  	if (ret) {
3117bb3109dc22 Nicolin Chen  2014-07-29  1046  		dev_err(&pdev->dev, "failed to get output rate\n");
c0296950851455 Fabio Estevam 2016-08-19  1047  		return ret;
3117bb3109dc22 Nicolin Chen  2014-07-29  1048  	}
3117bb3109dc22 Nicolin Chen  2014-07-29  1049  
4520af41fd2186 Shengjiu Wang 2020-04-16 @1050  	ret = of_property_read_u32(np, "fsl,asrc-format", &asrc->asrc_format);
4520af41fd2186 Shengjiu Wang 2020-04-16  1051  	if (ret) {
4520af41fd2186 Shengjiu Wang 2020-04-16  1052  		ret = of_property_read_u32(np, "fsl,asrc-width", &width);
3117bb3109dc22 Nicolin Chen  2014-07-29  1053  		if (ret) {
4520af41fd2186 Shengjiu Wang 2020-04-16  1054  			dev_err(&pdev->dev, "failed to decide output format\n");
c0296950851455 Fabio Estevam 2016-08-19  1055  			return ret;
3117bb3109dc22 Nicolin Chen  2014-07-29  1056  		}
3117bb3109dc22 Nicolin Chen  2014-07-29  1057  
4520af41fd2186 Shengjiu Wang 2020-04-16  1058  		switch (width) {
4520af41fd2186 Shengjiu Wang 2020-04-16  1059  		case 16:
4520af41fd2186 Shengjiu Wang 2020-04-16  1060  			asrc->asrc_format = SNDRV_PCM_FORMAT_S16_LE;
4520af41fd2186 Shengjiu Wang 2020-04-16  1061  			break;
4520af41fd2186 Shengjiu Wang 2020-04-16  1062  		case 24:
4520af41fd2186 Shengjiu Wang 2020-04-16  1063  			asrc->asrc_format = SNDRV_PCM_FORMAT_S24_LE;
4520af41fd2186 Shengjiu Wang 2020-04-16  1064  			break;
4520af41fd2186 Shengjiu Wang 2020-04-16  1065  		default:
4520af41fd2186 Shengjiu Wang 2020-04-16  1066  			dev_warn(&pdev->dev,
4520af41fd2186 Shengjiu Wang 2020-04-16  1067  				 "unsupported width, use default S24_LE\n");
4520af41fd2186 Shengjiu Wang 2020-04-16  1068  			asrc->asrc_format = SNDRV_PCM_FORMAT_S24_LE;
4520af41fd2186 Shengjiu Wang 2020-04-16  1069  			break;
4520af41fd2186 Shengjiu Wang 2020-04-16  1070  		}
4520af41fd2186 Shengjiu Wang 2020-04-16  1071  	}
4520af41fd2186 Shengjiu Wang 2020-04-16  1072  
4520af41fd2186 Shengjiu Wang 2020-04-16  1073  	if (!(FSL_ASRC_FORMATS & (1ULL << asrc->asrc_format))) {
4520af41fd2186 Shengjiu Wang 2020-04-16  1074  		dev_warn(&pdev->dev, "unsupported width, use default S24_LE\n");
4520af41fd2186 Shengjiu Wang 2020-04-16  1075  		asrc->asrc_format = SNDRV_PCM_FORMAT_S24_LE;
3117bb3109dc22 Nicolin Chen  2014-07-29  1076  	}
3117bb3109dc22 Nicolin Chen  2014-07-29  1077  
7470704d8b425c Shengjiu Wang 2020-04-16  1078  	platform_set_drvdata(pdev, asrc);
3117bb3109dc22 Nicolin Chen  2014-07-29  1079  	pm_runtime_enable(&pdev->dev);
7470704d8b425c Shengjiu Wang 2020-04-16  1080  	spin_lock_init(&asrc->lock);
3117bb3109dc22 Nicolin Chen  2014-07-29  1081  
3117bb3109dc22 Nicolin Chen  2014-07-29  1082  	ret = devm_snd_soc_register_component(&pdev->dev, &fsl_asrc_component,
3117bb3109dc22 Nicolin Chen  2014-07-29  1083  					      &fsl_asrc_dai, 1);
3117bb3109dc22 Nicolin Chen  2014-07-29  1084  	if (ret) {
3117bb3109dc22 Nicolin Chen  2014-07-29  1085  		dev_err(&pdev->dev, "failed to register ASoC DAI\n");
3117bb3109dc22 Nicolin Chen  2014-07-29  1086  		return ret;
3117bb3109dc22 Nicolin Chen  2014-07-29  1087  	}
3117bb3109dc22 Nicolin Chen  2014-07-29  1088  
3117bb3109dc22 Nicolin Chen  2014-07-29  1089  	return 0;
3117bb3109dc22 Nicolin Chen  2014-07-29  1090  }
3117bb3109dc22 Nicolin Chen  2014-07-29  1091  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 28092 bytes --]

             reply	other threads:[~2020-06-09 15:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-09 15:09 kbuild test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-06-01 14:18 [linux-next:master 2996/14131] sound/soc/fsl/fsl_asrc.c:1050:60: sparse: got restricted snd_pcm_format_t * kbuild test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200609150947.GK23011@xsang-OptiPlex-9020 \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.