sound/soc/fsl/fsl-asoc-card.c:684:45: sparse: sparse: incorrect type in argument 3 (different base types)
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: fb0155a09b0224a7147cb07a4ce6034c8d29667f
commit: 859e364302c510cfdd9abda13a3c4c1d1bc68c57 ASoC: fsl-asoc-card: Support new property fsl, asrc-format
date: 5 months ago
config: h8300-randconfig-s032-20200929 (attached as .config)
compiler: h8300-linux-gcc (GCC) 9.3.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.2-201-g24bdaac6-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 859e364302c510cfdd9abda13a3c4c1d1bc68c57
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=h8300
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
echo
echo "sparse warnings: (new ones prefixed by >>)"
echo
>> sound/soc/fsl/fsl-asoc-card.c:684:45: 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-asoc-card.c:684:45: sparse: expected unsigned int [usertype] *out_value
sound/soc/fsl/fsl-asoc-card.c:684:45: sparse: got restricted snd_pcm_format_t *
vim +684 sound/soc/fsl/fsl-asoc-card.c
480
481 static int fsl_asoc_card_probe(struct platform_device *pdev)
482 {
483 struct device_node *cpu_np, *codec_np, *asrc_np;
484 struct device_node *np = pdev->dev.of_node;
485 struct platform_device *asrc_pdev = NULL;
486 struct platform_device *cpu_pdev;
487 struct fsl_asoc_card_priv *priv;
488 struct i2c_client *codec_dev;
489 const char *codec_dai_name;
490 u32 width;
491 int ret;
492
493 priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
494 if (!priv)
495 return -ENOMEM;
496
497 cpu_np = of_parse_phandle(np, "audio-cpu", 0);
498 /* Give a chance to old DT binding */
499 if (!cpu_np)
500 cpu_np = of_parse_phandle(np, "ssi-controller", 0);
501 if (!cpu_np) {
502 dev_err(&pdev->dev, "CPU phandle missing or invalid\n");
503 ret = -EINVAL;
504 goto fail;
505 }
506
507 cpu_pdev = of_find_device_by_node(cpu_np);
508 if (!cpu_pdev) {
509 dev_err(&pdev->dev, "failed to find CPU DAI device\n");
510 ret = -EINVAL;
511 goto fail;
512 }
513
514 codec_np = of_parse_phandle(np, "audio-codec", 0);
515 if (codec_np)
516 codec_dev = of_find_i2c_device_by_node(codec_np);
517 else
518 codec_dev = NULL;
519
520 asrc_np = of_parse_phandle(np, "audio-asrc", 0);
521 if (asrc_np)
522 asrc_pdev = of_find_device_by_node(asrc_np);
523
524 /* Get the MCLK rate only, and leave it controlled by CODEC drivers */
525 if (codec_dev) {
526 struct clk *codec_clk = clk_get(&codec_dev->dev, NULL);
527
528 if (!IS_ERR(codec_clk)) {
529 priv->codec_priv.mclk_freq = clk_get_rate(codec_clk);
530 clk_put(codec_clk);
531 }
532 }
533
534 /* Default sample rate and format, will be updated in hw_params() */
535 priv->sample_rate = 44100;
536 priv->sample_format = SNDRV_PCM_FORMAT_S16_LE;
537
538 /* Assign a default DAI format, and allow each card to overwrite it */
539 priv->dai_fmt = DAI_FMT_BASE;
540
541 /* Diversify the card configurations */
542 if (of_device_is_compatible(np, "fsl,imx-audio-cs42888")) {
543 codec_dai_name = "cs42888";
544 priv->card.set_bias_level = NULL;
545 priv->cpu_priv.sysclk_freq[TX] = priv->codec_priv.mclk_freq;
546 priv->cpu_priv.sysclk_freq[RX] = priv->codec_priv.mclk_freq;
547 priv->cpu_priv.sysclk_dir[TX] = SND_SOC_CLOCK_OUT;
548 priv->cpu_priv.sysclk_dir[RX] = SND_SOC_CLOCK_OUT;
549 priv->cpu_priv.slot_width = 32;
550 priv->dai_fmt |= SND_SOC_DAIFMT_CBS_CFS;
551 } else if (of_device_is_compatible(np, "fsl,imx-audio-cs427x")) {
552 codec_dai_name = "cs4271-hifi";
553 priv->codec_priv.mclk_id = CS427x_SYSCLK_MCLK;
554 priv->dai_fmt |= SND_SOC_DAIFMT_CBM_CFM;
555 } else if (of_device_is_compatible(np, "fsl,imx-audio-sgtl5000")) {
556 codec_dai_name = "sgtl5000";
557 priv->codec_priv.mclk_id = SGTL5000_SYSCLK;
558 priv->dai_fmt |= SND_SOC_DAIFMT_CBM_CFM;
559 } else if (of_device_is_compatible(np, "fsl,imx-audio-wm8962")) {
560 codec_dai_name = "wm8962";
561 priv->card.set_bias_level = fsl_asoc_card_set_bias_level;
562 priv->codec_priv.mclk_id = WM8962_SYSCLK_MCLK;
563 priv->codec_priv.fll_id = WM8962_SYSCLK_FLL;
564 priv->codec_priv.pll_id = WM8962_FLL;
565 priv->dai_fmt |= SND_SOC_DAIFMT_CBM_CFM;
566 } else if (of_device_is_compatible(np, "fsl,imx-audio-wm8960")) {
567 codec_dai_name = "wm8960-hifi";
568 priv->card.set_bias_level = fsl_asoc_card_set_bias_level;
569 priv->codec_priv.fll_id = WM8960_SYSCLK_AUTO;
570 priv->codec_priv.pll_id = WM8960_SYSCLK_AUTO;
571 priv->dai_fmt |= SND_SOC_DAIFMT_CBM_CFM;
572 } else if (of_device_is_compatible(np, "fsl,imx-audio-ac97")) {
573 codec_dai_name = "ac97-hifi";
574 priv->card.set_bias_level = NULL;
575 priv->dai_fmt = SND_SOC_DAIFMT_AC97;
576 } else {
577 dev_err(&pdev->dev, "unknown Device Tree compatible\n");
578 ret = -EINVAL;
579 goto asrc_fail;
580 }
581
582 if (!fsl_asoc_card_is_ac97(priv) && !codec_dev) {
583 dev_err(&pdev->dev, "failed to find codec device\n");
584 ret = -EINVAL;
585 goto asrc_fail;
586 }
587
588 /* Common settings for corresponding Freescale CPU DAI driver */
589 if (of_node_name_eq(cpu_np, "ssi")) {
590 /* Only SSI needs to configure AUDMUX */
591 ret = fsl_asoc_card_audmux_init(np, priv);
592 if (ret) {
593 dev_err(&pdev->dev, "failed to init audmux\n");
594 goto asrc_fail;
595 }
596 } else if (of_node_name_eq(cpu_np, "esai")) {
597 priv->cpu_priv.sysclk_id[1] = ESAI_HCKT_EXTAL;
598 priv->cpu_priv.sysclk_id[0] = ESAI_HCKR_EXTAL;
599 } else if (of_node_name_eq(cpu_np, "sai")) {
600 priv->cpu_priv.sysclk_id[1] = FSL_SAI_CLK_MAST1;
601 priv->cpu_priv.sysclk_id[0] = FSL_SAI_CLK_MAST1;
602 }
603
604 snprintf(priv->name, sizeof(priv->name), "%s-audio",
605 fsl_asoc_card_is_ac97(priv) ? "ac97" :
606 codec_dev->name);
607
608 /* Initialize sound card */
609 priv->pdev = pdev;
610 priv->card.dev = &pdev->dev;
611 priv->card.name = priv->name;
612 priv->card.dai_link = priv->dai_link;
613 priv->card.dapm_routes = fsl_asoc_card_is_ac97(priv) ?
614 audio_map_ac97 : audio_map;
615 priv->card.late_probe = fsl_asoc_card_late_probe;
616 priv->card.num_dapm_routes = ARRAY_SIZE(audio_map);
617 priv->card.dapm_widgets = fsl_asoc_card_dapm_widgets;
618 priv->card.num_dapm_widgets = ARRAY_SIZE(fsl_asoc_card_dapm_widgets);
619
620 /* Drop the second half of DAPM routes -- ASRC */
621 if (!asrc_pdev)
622 priv->card.num_dapm_routes /= 2;
623
624 memcpy(priv->dai_link, fsl_asoc_card_dai,
625 sizeof(struct snd_soc_dai_link) * ARRAY_SIZE(priv->dai_link));
626
627 ret = snd_soc_of_parse_audio_routing(&priv->card, "audio-routing");
628 if (ret) {
629 dev_err(&pdev->dev, "failed to parse audio-routing: %d\n", ret);
630 goto asrc_fail;
631 }
632
633 /* Normal DAI Link */
634 priv->dai_link[0].cpus->of_node = cpu_np;
635 priv->dai_link[0].codecs->dai_name = codec_dai_name;
636
637 if (!fsl_asoc_card_is_ac97(priv))
638 priv->dai_link[0].codecs->of_node = codec_np;
639 else {
640 u32 idx;
641
642 ret = of_property_read_u32(cpu_np, "cell-index", &idx);
643 if (ret) {
644 dev_err(&pdev->dev,
645 "cannot get CPU index property\n");
646 goto asrc_fail;
647 }
648
649 priv->dai_link[0].codecs->name =
650 devm_kasprintf(&pdev->dev, GFP_KERNEL,
651 "ac97-codec.%u",
652 (unsigned int)idx);
653 if (!priv->dai_link[0].codecs->name) {
654 ret = -ENOMEM;
655 goto asrc_fail;
656 }
657 }
658
659 priv->dai_link[0].platforms->of_node = cpu_np;
660 priv->dai_link[0].dai_fmt = priv->dai_fmt;
661 priv->card.num_links = 1;
662
663 if (asrc_pdev) {
664 /* DPCM DAI Links only if ASRC exsits */
665 priv->dai_link[1].cpus->of_node = asrc_np;
666 priv->dai_link[1].platforms->of_node = asrc_np;
667 priv->dai_link[2].codecs->dai_name = codec_dai_name;
668 priv->dai_link[2].codecs->of_node = codec_np;
669 priv->dai_link[2].codecs->name =
670 priv->dai_link[0].codecs->name;
671 priv->dai_link[2].cpus->of_node = cpu_np;
672 priv->dai_link[2].dai_fmt = priv->dai_fmt;
673 priv->card.num_links = 3;
674
675 ret = of_property_read_u32(asrc_np, "fsl,asrc-rate",
676 &priv->asrc_rate);
677 if (ret) {
678 dev_err(&pdev->dev, "failed to get output rate\n");
679 ret = -EINVAL;
680 goto asrc_fail;
681 }
682
683 ret = of_property_read_u32(asrc_np, "fsl,asrc-format",
> 684 &priv->asrc_format);
685 if (ret) {
686 /* Fallback to old binding; translate to asrc_format */
687 ret = of_property_read_u32(asrc_np, "fsl,asrc-width",
688 &width);
689 if (ret) {
690 dev_err(&pdev->dev,
691 "failed to decide output format\n");
692 goto asrc_fail;
693 }
694
695 if (width == 24)
696 priv->asrc_format = SNDRV_PCM_FORMAT_S24_LE;
697 else
698 priv->asrc_format = SNDRV_PCM_FORMAT_S16_LE;
699 }
700 }
701
702 /* Finish card registering */
703 platform_set_drvdata(pdev, priv);
704 snd_soc_card_set_drvdata(&priv->card, priv);
705
706 ret = devm_snd_soc_register_card(&pdev->dev, &priv->card);
707 if (ret && ret != -EPROBE_DEFER)
708 dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n", ret);
709
710 asrc_fail:
711 of_node_put(asrc_np);
712 of_node_put(codec_np);
713 put_device(&cpu_pdev->dev);
714 fail:
715 of_node_put(cpu_np);
716
717 return ret;
718 }
719
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 7 months
drivers/spi/spi-rspi.c:1128:29: warning: unused variable 'rspi_rz_ops'
by kernel test robot
Hi Geert,
FYI, the error/warning still remains.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: fb0155a09b0224a7147cb07a4ce6034c8d29667f
commit: 851c902fd2d09b2ed85181e74b43477b7a3882be spi: rspi: Remove obsolete platform_device_id entries
date: 10 months ago
config: x86_64-randconfig-r036-20200929 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 6d374cf78c8a80a0bbfc7ce9bc80b3f183f44c80)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 851c902fd2d09b2ed85181e74b43477b7a3882be
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> drivers/spi/spi-rspi.c:1128:29: warning: unused variable 'rspi_rz_ops' [-Wunused-const-variable]
static const struct spi_ops rspi_rz_ops = {
^
>> drivers/spi/spi-rspi.c:1136:29: warning: unused variable 'qspi_ops' [-Wunused-const-variable]
static const struct spi_ops qspi_ops = {
^
2 warnings generated.
vim +/rspi_rz_ops +1128 drivers/spi/spi-rspi.c
426ef76dd8a394 Geert Uytterhoeven 2014-01-28 1127
426ef76dd8a394 Geert Uytterhoeven 2014-01-28 @1128 static const struct spi_ops rspi_rz_ops = {
426ef76dd8a394 Geert Uytterhoeven 2014-01-28 1129 .set_config_register = rspi_rz_set_config_register,
426ef76dd8a394 Geert Uytterhoeven 2014-01-28 1130 .transfer_one = rspi_rz_transfer_one,
880c6d114fd79a Geert Uytterhoeven 2014-01-30 1131 .mode_bits = SPI_CPHA | SPI_CPOL | SPI_LOOP,
9428a073eb703d Geert Uytterhoeven 2019-02-08 1132 .flags = SPI_CONTROLLER_MUST_RX | SPI_CONTROLLER_MUST_TX,
2f777ec91aa062 Geert Uytterhoeven 2014-06-02 1133 .fifo_size = 8, /* 8 for TX, 32 for RX */
426ef76dd8a394 Geert Uytterhoeven 2014-01-28 1134 };
426ef76dd8a394 Geert Uytterhoeven 2014-01-28 1135
426ef76dd8a394 Geert Uytterhoeven 2014-01-28 @1136 static const struct spi_ops qspi_ops = {
426ef76dd8a394 Geert Uytterhoeven 2014-01-28 1137 .set_config_register = qspi_set_config_register,
426ef76dd8a394 Geert Uytterhoeven 2014-01-28 1138 .transfer_one = qspi_transfer_one,
880c6d114fd79a Geert Uytterhoeven 2014-01-30 1139 .mode_bits = SPI_CPHA | SPI_CPOL | SPI_LOOP |
880c6d114fd79a Geert Uytterhoeven 2014-01-30 1140 SPI_TX_DUAL | SPI_TX_QUAD |
880c6d114fd79a Geert Uytterhoeven 2014-01-30 1141 SPI_RX_DUAL | SPI_RX_QUAD,
9428a073eb703d Geert Uytterhoeven 2019-02-08 1142 .flags = SPI_CONTROLLER_MUST_RX | SPI_CONTROLLER_MUST_TX,
2f777ec91aa062 Geert Uytterhoeven 2014-06-02 1143 .fifo_size = 32,
426ef76dd8a394 Geert Uytterhoeven 2014-01-28 1144 };
426ef76dd8a394 Geert Uytterhoeven 2014-01-28 1145
:::::: The code at line 1128 was first introduced by commit
:::::: 426ef76dd8a394a0e04d096941cd9acb49539a3e spi: rspi: Add DT support
:::::: TO: Geert Uytterhoeven <geert+renesas(a)linux-m68k.org>
:::::: CC: Mark Brown <broonie(a)linaro.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 7 months
[renesas-drivers:master 83/110] drivers/gpu/drm/msm/msm_iommu.c:46:2: error: implicit declaration of function 'iommu_flush_tlb_all'; did you mean
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers.git master
head: 636a9f7dbb24610805c1466de5be6411cc25fcf1
commit: 140e4a03ab203be8183a202601cd6d0ecd6f08bc [83/110] Merge remote-tracking branch 'iommu/next' into renesas-drivers
config: arm-defconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers.git...
git remote add renesas-drivers https://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers.git
git fetch --no-tags renesas-drivers master
git checkout 140e4a03ab203be8183a202601cd6d0ecd6f08bc
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
drivers/gpu/drm/msm/msm_iommu.c: In function 'msm_iommu_pagetable_unmap':
>> drivers/gpu/drm/msm/msm_iommu.c:46:2: error: implicit declaration of function 'iommu_flush_tlb_all'; did you mean 'iommu_flush_iotlb_all'? [-Werror=implicit-function-declaration]
46 | iommu_flush_tlb_all(to_msm_iommu(pagetable->parent)->domain);
| ^~~~~~~~~~~~~~~~~~~
| iommu_flush_iotlb_all
cc1: some warnings being treated as errors
vim +46 drivers/gpu/drm/msm/msm_iommu.c
b145c6e65eb05e Jordan Crouse 2020-08-17 31
b145c6e65eb05e Jordan Crouse 2020-08-17 32 static int msm_iommu_pagetable_unmap(struct msm_mmu *mmu, u64 iova,
b145c6e65eb05e Jordan Crouse 2020-08-17 33 size_t size)
b145c6e65eb05e Jordan Crouse 2020-08-17 34 {
b145c6e65eb05e Jordan Crouse 2020-08-17 35 struct msm_iommu_pagetable *pagetable = to_pagetable(mmu);
b145c6e65eb05e Jordan Crouse 2020-08-17 36 struct io_pgtable_ops *ops = pagetable->pgtbl_ops;
b145c6e65eb05e Jordan Crouse 2020-08-17 37 size_t unmapped = 0;
b145c6e65eb05e Jordan Crouse 2020-08-17 38
b145c6e65eb05e Jordan Crouse 2020-08-17 39 /* Unmap the block one page at a time */
b145c6e65eb05e Jordan Crouse 2020-08-17 40 while (size) {
b145c6e65eb05e Jordan Crouse 2020-08-17 41 unmapped += ops->unmap(ops, iova, 4096, NULL);
b145c6e65eb05e Jordan Crouse 2020-08-17 42 iova += 4096;
b145c6e65eb05e Jordan Crouse 2020-08-17 43 size -= 4096;
b145c6e65eb05e Jordan Crouse 2020-08-17 44 }
b145c6e65eb05e Jordan Crouse 2020-08-17 45
b145c6e65eb05e Jordan Crouse 2020-08-17 @46 iommu_flush_tlb_all(to_msm_iommu(pagetable->parent)->domain);
b145c6e65eb05e Jordan Crouse 2020-08-17 47
b145c6e65eb05e Jordan Crouse 2020-08-17 48 return (unmapped == size) ? 0 : -EINVAL;
b145c6e65eb05e Jordan Crouse 2020-08-17 49 }
b145c6e65eb05e Jordan Crouse 2020-08-17 50
:::::: The code at line 46 was first introduced by commit
:::::: b145c6e65eb05e123097d726aa9d4f5b8f11c401 drm/msm: Add support to create a local pagetable
:::::: TO: Jordan Crouse <jcrouse(a)codeaurora.org>
:::::: CC: Rob Clark <robdclark(a)chromium.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 7 months
Re: [PATCH v9 2/8] mtd: rawnand: rockchip: NFC drivers for RK3308, RK2928 and others
by kernel test robot
Hi Yifeng,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on rockchip/for-next]
[also build test WARNING on robh/for-next linus/master v5.9-rc7 next-20200929]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Yifeng-Zhao/Add-Rockchip-NFC-dri...
base: https://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip.git for-next
config: arm-allmodconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/1c9d56b98766d73850def484b00e25b62...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Yifeng-Zhao/Add-Rockchip-NFC-drivers-for-RK3308-and-others/20200929-171735
git checkout 1c9d56b98766d73850def484b00e25b6270429c0
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
drivers/mtd/nand/raw/rockchip-nand-controller.c:378:25: warning: 'struct nand_data_interface' declared inside parameter list will not be visible outside of this definition or declaration
378 | const struct nand_data_interface *conf)
| ^~~~~~~~~~~~~~~~~~~
drivers/mtd/nand/raw/rockchip-nand-controller.c: In function 'rk_nfc_setup_data_interface':
drivers/mtd/nand/raw/rockchip-nand-controller.c:388:33: error: passing argument 1 of 'nand_get_sdr_timings' from incompatible pointer type [-Werror=incompatible-pointer-types]
388 | timings = nand_get_sdr_timings(conf);
| ^~~~
| |
| const struct nand_data_interface *
In file included from drivers/mtd/nand/raw/rockchip-nand-controller.c:16:
include/linux/mtd/rawnand.h:524:58: note: expected 'const struct nand_interface_config *' but argument is of type 'const struct nand_data_interface *'
524 | nand_get_sdr_timings(const struct nand_interface_config *conf)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
drivers/mtd/nand/raw/rockchip-nand-controller.c: In function 'rk_nfc_attach_chip':
drivers/mtd/nand/raw/rockchip-nand-controller.c:1008:15: error: implicit declaration of function 'kzalloc'; did you mean 'vzalloc'? [-Werror=implicit-function-declaration]
1008 | temp_buf = kzalloc(len, GFP_KERNEL | GFP_DMA);
| ^~~~~~~
| vzalloc
drivers/mtd/nand/raw/rockchip-nand-controller.c:1008:13: warning: assignment to 'u8 *' {aka 'unsigned char *'} from 'int' makes pointer from integer without a cast [-Wint-conversion]
1008 | temp_buf = kzalloc(len, GFP_KERNEL | GFP_DMA);
| ^
drivers/mtd/nand/raw/rockchip-nand-controller.c:1011:4: error: implicit declaration of function 'kfree'; did you mean 'vfree'? [-Werror=implicit-function-declaration]
1011 | kfree(nfc->buffer);
| ^~~~~
| vfree
drivers/mtd/nand/raw/rockchip-nand-controller.c:1016:13: warning: assignment to 'u8 *' {aka 'unsigned char *'} from 'int' makes pointer from integer without a cast [-Wint-conversion]
1016 | temp_buf = kzalloc(oob_len, GFP_KERNEL | GFP_DMA);
| ^
drivers/mtd/nand/raw/rockchip-nand-controller.c:1025:14: warning: assignment to 'u8 *' {aka 'unsigned char *'} from 'int' makes pointer from integer without a cast [-Wint-conversion]
1025 | nfc->buffer = kzalloc(len, GFP_KERNEL | GFP_DMA);
| ^
drivers/mtd/nand/raw/rockchip-nand-controller.c:1030:15: warning: assignment to 'u32 *' {aka 'unsigned int *'} from 'int' makes pointer from integer without a cast [-Wint-conversion]
1030 | nfc->oob_buf = kzalloc(oob_len, GFP_KERNEL | GFP_DMA);
| ^
drivers/mtd/nand/raw/rockchip-nand-controller.c: At top level:
drivers/mtd/nand/raw/rockchip-nand-controller.c:1057:3: error: 'const struct nand_controller_ops' has no member named 'setup_data_interface'; did you mean 'setup_interface'?
1057 | .setup_data_interface = rk_nfc_setup_data_interface,
| ^~~~~~~~~~~~~~~~~~~~
| setup_interface
drivers/mtd/nand/raw/rockchip-nand-controller.c:1057:26: error: positional initialization of field in 'struct' declared with 'designated_init' attribute [-Werror=designated-init]
1057 | .setup_data_interface = rk_nfc_setup_data_interface,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/mtd/nand/raw/rockchip-nand-controller.c:1057:26: note: (near initialization for 'rk_nfc_controller_ops')
>> drivers/mtd/nand/raw/rockchip-nand-controller.c:1057:26: warning: excess elements in struct initializer
drivers/mtd/nand/raw/rockchip-nand-controller.c:1057:26: note: (near initialization for 'rk_nfc_controller_ops')
cc1: some warnings being treated as errors
vim +1057 drivers/mtd/nand/raw/rockchip-nand-controller.c
1053
1054 static const struct nand_controller_ops rk_nfc_controller_ops = {
1055 .attach_chip = rk_nfc_attach_chip,
1056 .exec_op = rk_nfc_exec_op,
> 1057 .setup_data_interface = rk_nfc_setup_data_interface,
1058 };
1059
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 7 months
Re: [PATCH v9 2/8] mtd: rawnand: rockchip: NFC drivers for RK3308, RK2928 and others
by kernel test robot
Hi Yifeng,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on rockchip/for-next]
[also build test ERROR on robh/for-next linus/master v5.9-rc7 next-20200929]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Yifeng-Zhao/Add-Rockchip-NFC-dri...
base: https://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip.git for-next
config: arm64-allyesconfig (attached as .config)
compiler: aarch64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/1c9d56b98766d73850def484b00e25b62...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Yifeng-Zhao/Add-Rockchip-NFC-drivers-for-RK3308-and-others/20200929-171735
git checkout 1c9d56b98766d73850def484b00e25b6270429c0
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All error/warnings (new ones prefixed by >>):
>> drivers/mtd/nand/raw/rockchip-nand-controller.c:378:25: warning: 'struct nand_data_interface' declared inside parameter list will not be visible outside of this definition or declaration
378 | const struct nand_data_interface *conf)
| ^~~~~~~~~~~~~~~~~~~
drivers/mtd/nand/raw/rockchip-nand-controller.c: In function 'rk_nfc_setup_data_interface':
>> drivers/mtd/nand/raw/rockchip-nand-controller.c:388:33: error: passing argument 1 of 'nand_get_sdr_timings' from incompatible pointer type [-Werror=incompatible-pointer-types]
388 | timings = nand_get_sdr_timings(conf);
| ^~~~
| |
| const struct nand_data_interface *
In file included from drivers/mtd/nand/raw/rockchip-nand-controller.c:16:
include/linux/mtd/rawnand.h:524:58: note: expected 'const struct nand_interface_config *' but argument is of type 'const struct nand_data_interface *'
524 | nand_get_sdr_timings(const struct nand_interface_config *conf)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
drivers/mtd/nand/raw/rockchip-nand-controller.c: In function 'rk_nfc_attach_chip':
>> drivers/mtd/nand/raw/rockchip-nand-controller.c:1008:15: error: implicit declaration of function 'kzalloc'; did you mean 'vzalloc'? [-Werror=implicit-function-declaration]
1008 | temp_buf = kzalloc(len, GFP_KERNEL | GFP_DMA);
| ^~~~~~~
| vzalloc
>> drivers/mtd/nand/raw/rockchip-nand-controller.c:1008:13: warning: assignment to 'u8 *' {aka 'unsigned char *'} from 'int' makes pointer from integer without a cast [-Wint-conversion]
1008 | temp_buf = kzalloc(len, GFP_KERNEL | GFP_DMA);
| ^
>> drivers/mtd/nand/raw/rockchip-nand-controller.c:1011:4: error: implicit declaration of function 'kfree'; did you mean 'vfree'? [-Werror=implicit-function-declaration]
1011 | kfree(nfc->buffer);
| ^~~~~
| vfree
drivers/mtd/nand/raw/rockchip-nand-controller.c:1016:13: warning: assignment to 'u8 *' {aka 'unsigned char *'} from 'int' makes pointer from integer without a cast [-Wint-conversion]
1016 | temp_buf = kzalloc(oob_len, GFP_KERNEL | GFP_DMA);
| ^
drivers/mtd/nand/raw/rockchip-nand-controller.c:1025:14: warning: assignment to 'u8 *' {aka 'unsigned char *'} from 'int' makes pointer from integer without a cast [-Wint-conversion]
1025 | nfc->buffer = kzalloc(len, GFP_KERNEL | GFP_DMA);
| ^
>> drivers/mtd/nand/raw/rockchip-nand-controller.c:1030:15: warning: assignment to 'u32 *' {aka 'unsigned int *'} from 'int' makes pointer from integer without a cast [-Wint-conversion]
1030 | nfc->oob_buf = kzalloc(oob_len, GFP_KERNEL | GFP_DMA);
| ^
drivers/mtd/nand/raw/rockchip-nand-controller.c: At top level:
>> drivers/mtd/nand/raw/rockchip-nand-controller.c:1057:3: error: 'const struct nand_controller_ops' has no member named 'setup_data_interface'; did you mean 'setup_interface'?
1057 | .setup_data_interface = rk_nfc_setup_data_interface,
| ^~~~~~~~~~~~~~~~~~~~
| setup_interface
>> drivers/mtd/nand/raw/rockchip-nand-controller.c:1057:26: error: positional initialization of field in 'struct' declared with 'designated_init' attribute [-Werror=designated-init]
1057 | .setup_data_interface = rk_nfc_setup_data_interface,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/mtd/nand/raw/rockchip-nand-controller.c:1057:26: note: (near initialization for 'rk_nfc_controller_ops')
drivers/mtd/nand/raw/rockchip-nand-controller.c:1057:26: error: initialization of 'void (*)(struct nand_chip *)' from incompatible pointer type 'int (*)(struct nand_chip *, int, const struct nand_data_interface *)' [-Werror=incompatible-pointer-types]
drivers/mtd/nand/raw/rockchip-nand-controller.c:1057:26: note: (near initialization for 'rk_nfc_controller_ops.detach_chip')
cc1: some warnings being treated as errors
vim +/nand_get_sdr_timings +388 drivers/mtd/nand/raw/rockchip-nand-controller.c
376
377 static int rk_nfc_setup_data_interface(struct nand_chip *chip, int csline,
> 378 const struct nand_data_interface *conf)
379 {
380 struct rk_nfc *nfc = nand_get_controller_data(chip);
381 const struct nand_sdr_timings *timings;
382 u32 rate, tc2rw, trwpw, trw2c;
383 u32 temp;
384
385 if (csline == NAND_DATA_IFACE_CHECK_ONLY)
386 return 0;
387
> 388 timings = nand_get_sdr_timings(conf);
389 if (IS_ERR(timings))
390 return -EOPNOTSUPP;
391
392 if (IS_ERR(nfc->nfc_clk))
393 rate = clk_get_rate(nfc->ahb_clk);
394 else
395 rate = clk_get_rate(nfc->nfc_clk);
396
397 /* Turn clock rate into kHz. */
398 rate /= 1000;
399
400 tc2rw = 1;
401 trw2c = 1;
402
403 trwpw = max(timings->tWC_min, timings->tRC_min) / 1000;
404 trwpw = DIV_ROUND_UP(trwpw * rate, 1000000);
405
406 temp = timings->tREA_max / 1000;
407 temp = DIV_ROUND_UP(temp * rate, 1000000);
408
409 if (trwpw < temp)
410 trwpw = temp;
411
412 /*
413 * ACCON: access timing control register
414 * -------------------------------------
415 * 31:18: reserved
416 * 17:12: csrw, clock cycles from the falling edge of CSn to the
417 * falling edge of RDn or WRn
418 * 11:11: reserved
419 * 10:05: rwpw, the width of RDn or WRn in processor clock cycles
420 * 04:00: rwcs, clock cycles from the rising edge of RDn or WRn to the
421 * rising edge of CSn
422 */
423 temp = ACCTIMING(tc2rw, trwpw, trw2c);
424 writel(temp, nfc->regs + NFC_FMWAIT);
425
426 return 0;
427 }
428
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 7 months