All of lore.kernel.org
 help / color / mirror / Atom feed
* [gpio:gpio-descriptors-spi 2/2] drivers/spi/spi-mpc512x-psc.c:469:39: warning: ISO C90 forbids mixed declarations and code
@ 2020-11-17  0:57 ` kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2020-11-17  0:57 UTC (permalink / raw)
  To: Linus Walleij; +Cc: kbuild-all, linux-gpio

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git gpio-descriptors-spi
head:   a40edbe3d2bf76cbc1a7c30b50de679811427aaf
commit: a40edbe3d2bf76cbc1a7c30b50de679811427aaf [2/2] spi: mpc512x-psc: Convert to use GPIO descriptors
config: powerpc-mpc512x_defconfig (attached as .config)
compiler: powerpc-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://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git/commit/?id=a40edbe3d2bf76cbc1a7c30b50de679811427aaf
        git remote add gpio https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git
        git fetch --no-tags gpio gpio-descriptors-spi
        git checkout a40edbe3d2bf76cbc1a7c30b50de679811427aaf
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=powerpc 

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

All warnings (new ones prefixed by >>):

   drivers/spi/spi-mpc512x-psc.c: In function 'mpc512x_psc_spi_setup':
   drivers/spi/spi-mpc512x-psc.c:350:6: warning: unused variable 'ret' [-Wunused-variable]
     350 |  int ret;
         |      ^~~
   drivers/spi/spi-mpc512x-psc.c: In function 'mpc512x_psc_spi_do_probe':
   drivers/spi/spi-mpc512x-psc.c:469:39: error: unknown type name 'x'
     469 |   mps->cs_control = pdata->cs_control;x
         |                                       ^
   drivers/spi/spi-mpc512x-psc.c:470:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '->' token
     470 |   master->bus_num = pdata->bus_num;
         |         ^~
>> drivers/spi/spi-mpc512x-psc.c:469:39: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
     469 |   mps->cs_control = pdata->cs_control;x
         |                                       ^

vim +469 drivers/spi/spi-mpc512x-psc.c

   448	
   449	static int mpc512x_psc_spi_do_probe(struct device *dev, u32 regaddr,
   450						      u32 size, unsigned int irq)
   451	{
   452		struct fsl_spi_platform_data *pdata = dev_get_platdata(dev);
   453		struct mpc512x_psc_spi *mps;
   454		struct spi_master *master;
   455		int ret;
   456		void *tempp;
   457		struct clk *clk;
   458	
   459		master = spi_alloc_master(dev, sizeof *mps);
   460		if (master == NULL)
   461			return -ENOMEM;
   462	
   463		dev_set_drvdata(dev, master);
   464		mps = spi_master_get_devdata(master);
   465		mps->type = (int)of_device_get_match_data(dev);
   466		mps->irq = irq;
   467	
   468		if (pdata) {
 > 469			mps->cs_control = pdata->cs_control;x
   470			master->bus_num = pdata->bus_num;
   471			master->num_chipselect = pdata->max_chipselect;
   472		}
   473	
   474		master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH | SPI_LSB_FIRST;
   475		master->setup = mpc512x_psc_spi_setup;
   476		master->prepare_transfer_hardware = mpc512x_psc_spi_prep_xfer_hw;
   477		master->transfer_one_message = mpc512x_psc_spi_msg_xfer;
   478		master->unprepare_transfer_hardware = mpc512x_psc_spi_unprep_xfer_hw;
   479		master->set_cs = mpc512x_psc_spi_set_cs;
   480		/* This makes sure our custom .set_cs() is always called */
   481		master->flags = SPI_MASTER_GPIO_SS;
   482		master->use_gpio_descriptors = true;
   483		master->cleanup = mpc512x_psc_spi_cleanup;
   484		master->dev.of_node = dev->of_node;
   485	
   486		tempp = devm_ioremap(dev, regaddr, size);
   487		if (!tempp) {
   488			dev_err(dev, "could not ioremap I/O port range\n");
   489			ret = -EFAULT;
   490			goto free_master;
   491		}
   492		mps->psc = tempp;
   493		mps->fifo =
   494			(struct mpc512x_psc_fifo *)(tempp + sizeof(struct mpc52xx_psc));
   495		ret = devm_request_irq(dev, mps->irq, mpc512x_psc_spi_isr, IRQF_SHARED,
   496					"mpc512x-psc-spi", mps);
   497		if (ret)
   498			goto free_master;
   499		init_completion(&mps->txisrdone);
   500	
   501		clk = devm_clk_get(dev, "mclk");
   502		if (IS_ERR(clk)) {
   503			ret = PTR_ERR(clk);
   504			goto free_master;
   505		}
   506		ret = clk_prepare_enable(clk);
   507		if (ret)
   508			goto free_master;
   509		mps->clk_mclk = clk;
   510		mps->mclk_rate = clk_get_rate(clk);
   511	
   512		clk = devm_clk_get(dev, "ipg");
   513		if (IS_ERR(clk)) {
   514			ret = PTR_ERR(clk);
   515			goto free_mclk_clock;
   516		}
   517		ret = clk_prepare_enable(clk);
   518		if (ret)
   519			goto free_mclk_clock;
   520		mps->clk_ipg = clk;
   521	
   522		ret = mpc512x_psc_spi_port_config(master, mps);
   523		if (ret < 0)
   524			goto free_ipg_clock;
   525	
   526		ret = devm_spi_register_master(dev, master);
   527		if (ret < 0)
   528			goto free_ipg_clock;
   529	
   530		return ret;
   531	
   532	free_ipg_clock:
   533		clk_disable_unprepare(mps->clk_ipg);
   534	free_mclk_clock:
   535		clk_disable_unprepare(mps->clk_mclk);
   536	free_master:
   537		spi_master_put(master);
   538	
   539		return ret;
   540	}
   541	

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

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [gpio:gpio-descriptors-spi 2/2] drivers/spi/spi-mpc512x-psc.c:469:39: warning: ISO C90 forbids mixed declarations and code
@ 2020-11-17  0:57 ` kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2020-11-17  0:57 UTC (permalink / raw)
  To: kbuild-all

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git gpio-descriptors-spi
head:   a40edbe3d2bf76cbc1a7c30b50de679811427aaf
commit: a40edbe3d2bf76cbc1a7c30b50de679811427aaf [2/2] spi: mpc512x-psc: Convert to use GPIO descriptors
config: powerpc-mpc512x_defconfig (attached as .config)
compiler: powerpc-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://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git/commit/?id=a40edbe3d2bf76cbc1a7c30b50de679811427aaf
        git remote add gpio https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git
        git fetch --no-tags gpio gpio-descriptors-spi
        git checkout a40edbe3d2bf76cbc1a7c30b50de679811427aaf
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=powerpc 

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

All warnings (new ones prefixed by >>):

   drivers/spi/spi-mpc512x-psc.c: In function 'mpc512x_psc_spi_setup':
   drivers/spi/spi-mpc512x-psc.c:350:6: warning: unused variable 'ret' [-Wunused-variable]
     350 |  int ret;
         |      ^~~
   drivers/spi/spi-mpc512x-psc.c: In function 'mpc512x_psc_spi_do_probe':
   drivers/spi/spi-mpc512x-psc.c:469:39: error: unknown type name 'x'
     469 |   mps->cs_control = pdata->cs_control;x
         |                                       ^
   drivers/spi/spi-mpc512x-psc.c:470:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '->' token
     470 |   master->bus_num = pdata->bus_num;
         |         ^~
>> drivers/spi/spi-mpc512x-psc.c:469:39: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
     469 |   mps->cs_control = pdata->cs_control;x
         |                                       ^

vim +469 drivers/spi/spi-mpc512x-psc.c

   448	
   449	static int mpc512x_psc_spi_do_probe(struct device *dev, u32 regaddr,
   450						      u32 size, unsigned int irq)
   451	{
   452		struct fsl_spi_platform_data *pdata = dev_get_platdata(dev);
   453		struct mpc512x_psc_spi *mps;
   454		struct spi_master *master;
   455		int ret;
   456		void *tempp;
   457		struct clk *clk;
   458	
   459		master = spi_alloc_master(dev, sizeof *mps);
   460		if (master == NULL)
   461			return -ENOMEM;
   462	
   463		dev_set_drvdata(dev, master);
   464		mps = spi_master_get_devdata(master);
   465		mps->type = (int)of_device_get_match_data(dev);
   466		mps->irq = irq;
   467	
   468		if (pdata) {
 > 469			mps->cs_control = pdata->cs_control;x
   470			master->bus_num = pdata->bus_num;
   471			master->num_chipselect = pdata->max_chipselect;
   472		}
   473	
   474		master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH | SPI_LSB_FIRST;
   475		master->setup = mpc512x_psc_spi_setup;
   476		master->prepare_transfer_hardware = mpc512x_psc_spi_prep_xfer_hw;
   477		master->transfer_one_message = mpc512x_psc_spi_msg_xfer;
   478		master->unprepare_transfer_hardware = mpc512x_psc_spi_unprep_xfer_hw;
   479		master->set_cs = mpc512x_psc_spi_set_cs;
   480		/* This makes sure our custom .set_cs() is always called */
   481		master->flags = SPI_MASTER_GPIO_SS;
   482		master->use_gpio_descriptors = true;
   483		master->cleanup = mpc512x_psc_spi_cleanup;
   484		master->dev.of_node = dev->of_node;
   485	
   486		tempp = devm_ioremap(dev, regaddr, size);
   487		if (!tempp) {
   488			dev_err(dev, "could not ioremap I/O port range\n");
   489			ret = -EFAULT;
   490			goto free_master;
   491		}
   492		mps->psc = tempp;
   493		mps->fifo =
   494			(struct mpc512x_psc_fifo *)(tempp + sizeof(struct mpc52xx_psc));
   495		ret = devm_request_irq(dev, mps->irq, mpc512x_psc_spi_isr, IRQF_SHARED,
   496					"mpc512x-psc-spi", mps);
   497		if (ret)
   498			goto free_master;
   499		init_completion(&mps->txisrdone);
   500	
   501		clk = devm_clk_get(dev, "mclk");
   502		if (IS_ERR(clk)) {
   503			ret = PTR_ERR(clk);
   504			goto free_master;
   505		}
   506		ret = clk_prepare_enable(clk);
   507		if (ret)
   508			goto free_master;
   509		mps->clk_mclk = clk;
   510		mps->mclk_rate = clk_get_rate(clk);
   511	
   512		clk = devm_clk_get(dev, "ipg");
   513		if (IS_ERR(clk)) {
   514			ret = PTR_ERR(clk);
   515			goto free_mclk_clock;
   516		}
   517		ret = clk_prepare_enable(clk);
   518		if (ret)
   519			goto free_mclk_clock;
   520		mps->clk_ipg = clk;
   521	
   522		ret = mpc512x_psc_spi_port_config(master, mps);
   523		if (ret < 0)
   524			goto free_ipg_clock;
   525	
   526		ret = devm_spi_register_master(dev, master);
   527		if (ret < 0)
   528			goto free_ipg_clock;
   529	
   530		return ret;
   531	
   532	free_ipg_clock:
   533		clk_disable_unprepare(mps->clk_ipg);
   534	free_mclk_clock:
   535		clk_disable_unprepare(mps->clk_mclk);
   536	free_master:
   537		spi_master_put(master);
   538	
   539		return ret;
   540	}
   541	

---
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: 17336 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-11-17  0:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-17  0:57 [gpio:gpio-descriptors-spi 2/2] drivers/spi/spi-mpc512x-psc.c:469:39: warning: ISO C90 forbids mixed declarations and code kernel test robot
2020-11-17  0:57 ` kernel test robot

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.