[gpio:devel-hierarchical-irqchip 44/62] drivers/gpio/gpio-amd-fch.c:173:57: sparse: sparse: incorrect type in argument 2 (different modifiers)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git devel-hierarchical-irqchip
head:   9b22e3be56602f4f7b2a1a05414d093ed607e6cf
commit: 9bb2e04525087b7d9f786aa5e68a167187576dbe [44/62] gpio: amd: Make resource struct const
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.1-rc1-7-g2b96cd8-dirty
        git checkout 9bb2e04525087b7d9f786aa5e68a167187576dbe
        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@xxxxxxxxx>


sparse warnings: (new ones prefixed by >>)

>> drivers/gpio/gpio-amd-fch.c:173:57: sparse: sparse: incorrect type in argument 2 (different modifiers) @@    expected struct resource *res @@    got structstruct resource *res @@
>> drivers/gpio/gpio-amd-fch.c:173:57: sparse:    expected struct resource *res
>> drivers/gpio/gpio-amd-fch.c:173:57: sparse:    got struct resource const *

vim +173 drivers/gpio/gpio-amd-fch.c

e09d168f Enrico Weigelt, metux IT consult 2019-02-22  139  
e09d168f Enrico Weigelt, metux IT consult 2019-02-22  140  static int amd_fch_gpio_probe(struct platform_device *pdev)
e09d168f Enrico Weigelt, metux IT consult 2019-02-22  141  {
e09d168f Enrico Weigelt, metux IT consult 2019-02-22  142  	struct amd_fch_gpio_priv *priv;
e09d168f Enrico Weigelt, metux IT consult 2019-02-22  143  	struct amd_fch_gpio_pdata *pdata;
e09d168f Enrico Weigelt, metux IT consult 2019-02-22  144  
e09d168f Enrico Weigelt, metux IT consult 2019-02-22  145  	pdata = dev_get_platdata(&pdev->dev);
e09d168f Enrico Weigelt, metux IT consult 2019-02-22  146  	if (!pdata) {
e09d168f Enrico Weigelt, metux IT consult 2019-02-22  147  		dev_err(&pdev->dev, "no platform_data\n");
e09d168f Enrico Weigelt, metux IT consult 2019-02-22  148  		return -ENOENT;
e09d168f Enrico Weigelt, metux IT consult 2019-02-22  149  	}
e09d168f Enrico Weigelt, metux IT consult 2019-02-22  150  
e09d168f Enrico Weigelt, metux IT consult 2019-02-22  151  	priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
e09d168f Enrico Weigelt, metux IT consult 2019-02-22  152  	if (!priv)
e09d168f Enrico Weigelt, metux IT consult 2019-02-22  153  		return -ENOMEM;
e09d168f Enrico Weigelt, metux IT consult 2019-02-22  154  
e09d168f Enrico Weigelt, metux IT consult 2019-02-22  155  	priv->pdata	= pdata;
e09d168f Enrico Weigelt, metux IT consult 2019-02-22  156  	priv->pdev	= pdev;
e09d168f Enrico Weigelt, metux IT consult 2019-02-22  157  
e09d168f Enrico Weigelt, metux IT consult 2019-02-22  158  	priv->gc.owner			= THIS_MODULE;
e09d168f Enrico Weigelt, metux IT consult 2019-02-22  159  	priv->gc.parent			= &pdev->dev;
e09d168f Enrico Weigelt, metux IT consult 2019-02-22  160  	priv->gc.label			= dev_name(&pdev->dev);
e09d168f Enrico Weigelt, metux IT consult 2019-02-22  161  	priv->gc.ngpio			= priv->pdata->gpio_num;
e09d168f Enrico Weigelt, metux IT consult 2019-02-22  162  	priv->gc.names			= priv->pdata->gpio_names;
e09d168f Enrico Weigelt, metux IT consult 2019-02-22  163  	priv->gc.base			= -1;
e09d168f Enrico Weigelt, metux IT consult 2019-02-22  164  	priv->gc.request		= amd_fch_gpio_request;
e09d168f Enrico Weigelt, metux IT consult 2019-02-22  165  	priv->gc.direction_input	= amd_fch_gpio_direction_input;
e09d168f Enrico Weigelt, metux IT consult 2019-02-22  166  	priv->gc.direction_output	= amd_fch_gpio_direction_output;
e09d168f Enrico Weigelt, metux IT consult 2019-02-22  167  	priv->gc.get_direction		= amd_fch_gpio_get_direction;
e09d168f Enrico Weigelt, metux IT consult 2019-02-22  168  	priv->gc.get			= amd_fch_gpio_get;
e09d168f Enrico Weigelt, metux IT consult 2019-02-22  169  	priv->gc.set			= amd_fch_gpio_set;
e09d168f Enrico Weigelt, metux IT consult 2019-02-22  170  
e09d168f Enrico Weigelt, metux IT consult 2019-02-22  171  	spin_lock_init(&priv->lock);
e09d168f Enrico Weigelt, metux IT consult 2019-02-22  172  
e09d168f Enrico Weigelt, metux IT consult 2019-02-22 @173  	priv->base = devm_ioremap_resource(&pdev->dev, &amd_fch_gpio_iores);
e09d168f Enrico Weigelt, metux IT consult 2019-02-22  174  	if (IS_ERR(priv->base))
e09d168f Enrico Weigelt, metux IT consult 2019-02-22  175  		return PTR_ERR(priv->base);
e09d168f Enrico Weigelt, metux IT consult 2019-02-22  176  
e09d168f Enrico Weigelt, metux IT consult 2019-02-22  177  	platform_set_drvdata(pdev, priv);
e09d168f Enrico Weigelt, metux IT consult 2019-02-22  178  
e09d168f Enrico Weigelt, metux IT consult 2019-02-22  179  	return devm_gpiochip_add_data(&pdev->dev, &priv->gc, priv);
e09d168f Enrico Weigelt, metux IT consult 2019-02-22  180  }
e09d168f Enrico Weigelt, metux IT consult 2019-02-22  181  

:::::: The code at line 173 was first introduced by commit
:::::: e09d168f13f0d63df7fe095d52be04c16cbe1cef gpio: AMD G-Series PCH gpio driver

:::::: TO: Enrico Weigelt, metux IT consult <info@xxxxxxxxx>
:::::: CC: Linus Walleij <linus.walleij@xxxxxxxxxx>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux