lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202107190735.IyflvmzU-lkp@intel.com>
Date:   Mon, 19 Jul 2021 07:31:38 +0800
From:   kernel test robot <lkp@...el.com>
To:     Daniel Palmer <daniel@...f.com>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org
Subject: [linux-chenxing:mstar_v5_14_rebase_i2_drm 98/349]
 drivers/iio/adc/msc313e_sar.c:473:64: warning: passing argument 3 of
 'pinctrl_generic_add_group' discards 'const' qualifier from pointer target
 type

tree:   git://github.com/linux-chenxing/linux.git mstar_v5_14_rebase_i2_drm
head:   93dfb2364436067bf34c6d4ddcd282496182cc0f
commit: fb1c5e9b61a43058147812d252a62c2451709ffe [98/349] ARM:mstar: SAR adc driver
config: s390-allyesconfig (attached as .config)
compiler: s390-linux-gcc (GCC) 10.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/linux-chenxing/linux/commit/fb1c5e9b61a43058147812d252a62c2451709ffe
        git remote add linux-chenxing git://github.com/linux-chenxing/linux.git
        git fetch --no-tags linux-chenxing mstar_v5_14_rebase_i2_drm
        git checkout fb1c5e9b61a43058147812d252a62c2451709ffe
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross ARCH=s390 

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

All warnings (new ones prefixed by >>):

   drivers/iio/adc/msc313e_sar.c: In function 'msc313e_sar_probe_pinctrl':
>> drivers/iio/adc/msc313e_sar.c:473:64: warning: passing argument 3 of 'pinctrl_generic_add_group' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     473 |   ret = pinctrl_generic_add_group(sar->pinctrl_dev, grp->name, &grp->pin,
         |                                                                ^~~~~~~~~
   In file included from drivers/iio/adc/msc313e_sar.c:25:
   drivers/iio/adc/../../pinctrl/core.h:215:15: note: expected 'int *' but argument is of type 'const int *'
     215 |          int *gpins, int ngpins, void *data);
         |          ~~~~~^~~~~
>> drivers/iio/adc/msc313e_sar.c:480:5: warning: passing argument 3 of 'pinmux_generic_add_function' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     480 |     &func->group, 1, func);
         |     ^~~~~~~~~~~~
   In file included from drivers/iio/adc/msc313e_sar.c:27:
   drivers/iio/adc/../../pinctrl/pinmux.h:153:18: note: expected 'const char **' but argument is of type 'const char * const*'
     153 |     const char **groups,
         |     ~~~~~~~~~~~~~^~~~~~
   drivers/iio/adc/msc313e_sar.c:480:22: warning: passing argument 5 of 'pinmux_generic_add_function' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     480 |     &func->group, 1, func);
         |                      ^~~~
   In file included from drivers/iio/adc/msc313e_sar.c:27:
   drivers/iio/adc/../../pinctrl/pinmux.h:155:11: note: expected 'void *' but argument is of type 'const struct sar_pinctrl_function *'
     155 |     void *data);
         |     ~~~~~~^~~~
   drivers/iio/adc/msc313e_sar.c: In function 'msc313e_sar_probe':
>> drivers/iio/adc/msc313e_sar.c:502:13: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     502 |  match_data = of_device_get_match_data(&pdev->dev);
         |             ^
   drivers/iio/adc/msc313e_sar.c:615:1: warning: label 'out' defined but not used [-Wunused-label]
     615 | out:
         | ^~~


vim +473 drivers/iio/adc/msc313e_sar.c

   444	
   445	static int msc313e_sar_probe_pinctrl(struct platform_device *pdev,
   446			struct msc313e_sar *sar) {
   447		int i, ret;
   448	
   449		sar->gpio_range.name = "sar";
   450		sar->gpio_range.id = 0;
   451		sar->gpio_range.base = sar->gpiochip.base;
   452		sar->gpio_range.pins = sar->info->rangepins;
   453		sar->gpio_range.npins = sar->info->nrangepins;
   454		sar->gpio_range.gc = &sar->gpiochip;
   455	
   456		sar->pinctrl_desc.name = DRIVER_NAME;
   457		sar->pinctrl_desc.pctlops = &sar_pinctrl_ops;
   458		sar->pinctrl_desc.pmxops = &sar_pinmux_ops;
   459		sar->pinctrl_desc.owner = THIS_MODULE;
   460		sar->pinctrl_desc.pins = sar->info->pins;
   461		sar->pinctrl_desc.npins = sar->info->npins;
   462	
   463		ret = devm_pinctrl_register_and_init(&pdev->dev, &sar->pinctrl_desc, sar,
   464				&sar->pinctrl_dev);
   465	
   466		if (ret) {
   467			dev_err(&pdev->dev, "failed to register pinctrl\n");
   468			return ret;
   469		}
   470	
   471		for (i = 0; i < sar->info->ngroups; i++) {
   472			const struct sar_pinctrl_group *grp = &sar->info->groups[i];
 > 473			ret = pinctrl_generic_add_group(sar->pinctrl_dev, grp->name, &grp->pin,
   474					1, NULL);
   475		}
   476	
   477		for (i = 0; i < ARRAY_SIZE(sar_pinctrl_functions); i++) {
   478			const struct sar_pinctrl_function *func = &sar_pinctrl_functions[i];
   479			ret = pinmux_generic_add_function(sar->pinctrl_dev, func->name,
 > 480					&func->group, 1, func);
   481	
   482		}
   483	
   484		pinctrl_add_gpio_range(sar->pinctrl_dev, &sar->gpio_range);
   485	
   486		ret = pinctrl_enable(sar->pinctrl_dev);
   487		if (ret)
   488			dev_err(&pdev->dev, "failed to enable pinctrl\n");
   489	
   490		return ret;
   491	}
   492	
   493	static int msc313e_sar_probe(struct platform_device *pdev)
   494	{
   495		int ret = 0;
   496		struct mstar_sar_info *match_data;
   497		struct iio_dev *indio_dev;
   498		struct msc313e_sar *sar;
   499		__iomem void *base;
   500		int irq;
   501	
 > 502		match_data = of_device_get_match_data(&pdev->dev);
   503		if (!match_data)
   504			return -EINVAL;
   505	
   506		indio_dev = devm_iio_device_alloc(&pdev->dev, sizeof(*sar));
   507		if(!indio_dev)
   508			return -ENOMEM;
   509	
   510		sar = iio_priv(indio_dev);
   511	
   512		sar->info = match_data;
   513	
   514		base = devm_platform_ioremap_resource(pdev, 0);
   515		if (IS_ERR(base))
   516			return PTR_ERR(base);
   517	
   518		sar->regmap = devm_regmap_init_mmio(&pdev->dev, base,
   519					&msc313_sar_regmap_config);
   520		if (IS_ERR(sar->regmap)) {
   521			dev_err(&pdev->dev, "failed to register regmap");
   522			return PTR_ERR(sar->regmap);
   523		}
   524	
   525		sar->pmsleep = syscon_regmap_lookup_by_phandle(pdev->dev.of_node, "mstar,pmsleep");
   526		if (IS_ERR(sar->pmsleep))
   527			return PTR_ERR(sar->pmsleep);
   528	
   529		sar->field_load = devm_regmap_field_alloc(&pdev->dev, sar->regmap, ctrl_load_field);
   530		sar->field_freerun = devm_regmap_field_alloc(&pdev->dev, sar->regmap, ctrl_freerun_field);
   531		sar->field_analogpd = devm_regmap_field_alloc(&pdev->dev, sar->regmap, ctrl_analogpd_field);
   532		sar->field_start = devm_regmap_field_alloc(&pdev->dev, sar->regmap, ctrl_start_field);
   533		sar->field_digitalpd = devm_regmap_field_alloc(&pdev->dev, sar->regmap, ctrl_digitalpd_field);
   534		sar->field_mode = devm_regmap_field_alloc(&pdev->dev, sar->regmap, ctrl_mode_field);
   535		sar->field_singlech = devm_regmap_field_alloc(&pdev->dev, sar->regmap, ctrl_singlech_field);
   536		sar->field_channel = devm_regmap_field_alloc(&pdev->dev, sar->regmap, ctrl_channel_field);
   537	
   538		sar->field_gpio_en = devm_regmap_field_alloc(&pdev->dev, sar->regmap, gpio_ctrl_en_field);
   539		sar->field_gpio_oen = devm_regmap_field_alloc(&pdev->dev, sar->regmap, gpio_ctrl_oen_field);
   540		sar->field_gpio_value = devm_regmap_field_alloc(&pdev->dev, sar->regmap, gpio_data_value_field);
   541		sar->field_gpio_in = devm_regmap_field_alloc(&pdev->dev, sar->regmap, gpio_data_in_field);
   542		sar->field_vref_ts = devm_regmap_field_alloc(&pdev->dev, sar->regmap, vref_ts_field);
   543	
   544		sar->clk = devm_clk_get(&pdev->dev, "sar_clk");
   545		if (IS_ERR(sar->clk)) {
   546			dev_err(&pdev->dev, "failed to get clk\n");
   547			return PTR_ERR(sar->clk);
   548		}
   549	
   550		irq = of_irq_get_byname(pdev->dev.of_node, "sar");
   551		if (!irq)
   552			return -EINVAL;
   553	
   554		ret = devm_request_irq(&pdev->dev, irq, msc313e_sar_irq, IRQF_SHARED,
   555				dev_name(&pdev->dev), indio_dev);
   556		if (ret)
   557			return ret;
   558	
   559		irq = of_irq_get_byname(pdev->dev.of_node, "wakeup");
   560		if (!irq)
   561			return -EINVAL;
   562	
   563		ret = devm_request_irq(&pdev->dev, irq, msc313e_sar_irq, IRQF_SHARED,
   564				dev_name(&pdev->dev), indio_dev);
   565		if (ret)
   566			return ret;
   567	
   568		sar->wakeirq_gpio = of_irq_get_byname(pdev->dev.of_node, "wakeup_gpio");
   569		if (!sar->wakeirq_gpio)
   570			return -EINVAL;
   571	
   572		ret = devm_request_irq(&pdev->dev, sar->wakeirq_gpio, msc313e_sar_irq, IRQF_SHARED,
   573				dev_name(&pdev->dev), indio_dev);
   574		if (ret)
   575			return ret;
   576	
   577		indio_dev->name = platform_get_device_id(pdev)->name;
   578		indio_dev->dev.parent = &pdev->dev;
   579		indio_dev->dev.of_node = pdev->dev.of_node;
   580		indio_dev->modes = INDIO_DIRECT_MODE;
   581		indio_dev->info = &msc313e_sar_iio_info;
   582		indio_dev->num_channels = ARRAY_SIZE(msc313e_sar_channels);
   583		indio_dev->channels = msc313e_sar_channels;
   584	
   585		platform_set_drvdata(pdev, indio_dev);
   586	
   587		ret = devm_iio_device_register(&pdev->dev, indio_dev);
   588		if (ret)
   589			return ret;
   590	
   591		ret = msc313e_sar_probe_gpio(pdev, sar);
   592		if (ret)
   593			return ret;
   594	
   595		ret = msc313e_sar_probe_pinctrl(pdev, sar);
   596		if (ret)
   597			return ret;
   598	
   599		clk_prepare_enable(sar->clk);
   600	
   601		regmap_write(sar->regmap, REG_SAMPLE_PERIOD, 0x0f);
   602	
   603		regmap_write(sar->regmap, REG_INT_CLR, ~0);
   604		regmap_write(sar->regmap, REG_INT_MASK, 0);
   605	
   606		/* turn the adc on */
   607		regmap_field_write(sar->field_analogpd, 0);
   608		regmap_field_write(sar->field_digitalpd, 0);
   609	
   610		/* set the temp sensor to 2.0v */
   611		regmap_field_write(sar->field_vref_ts, 0);
   612	
   613		device_init_wakeup(&pdev->dev, 1);
   614	
   615	out:
   616		return ret;
   617	}
   618	

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

Download attachment ".config.gz" of type "application/gzip" (66993 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ