linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [xlnx:master 11923/12154] drivers/mtd/spi-nor/core.c:454:2: warning: ISO C90 forbids mixed declarations and code
@ 2021-04-22 10:04 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-04-22 10:04 UTC (permalink / raw)
  To: Amit Kumar Mahapatra
  Cc: kbuild-all, linux-arm-kernel, Michal Simek,
	Naga Sureshkumar Relli, Tejas Prajapati Rameshchandra

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

Hi Amit,

FYI, the error/warning still remains.

tree:   https://github.com/Xilinx/linux-xlnx master
head:   bcd80b4c331c5d55de978ab0b2f6181a8aea3434
commit: 26d248f9f56a753db263a6adde4a04f0c6265374 [11923/12154] mtd: spi-nor: Added EAR support for Zynq qspi driver
config: alpha-randconfig-r015-20210421 (attached as .config)
compiler: alpha-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/Xilinx/linux-xlnx/commit/26d248f9f56a753db263a6adde4a04f0c6265374
        git remote add xlnx https://github.com/Xilinx/linux-xlnx
        git fetch --no-tags xlnx master
        git checkout 26d248f9f56a753db263a6adde4a04f0c6265374
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross W=1 ARCH=alpha 

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/mtd/spi-nor/core.c: In function 'spi_nor_write_ear':
>> drivers/mtd/spi-nor/core.c:454:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
     454 |  u32 ear;
         |  ^~~


vim +454 drivers/mtd/spi-nor/core.c

   443	
   444	/**
   445	 * spi_nor_write_ear() - Write Extended Address Register.
   446	 * @nor:	pointer to 'struct spi_nor'.
   447	 * @ear:	value to write to the Extended Address Register.
   448	 *
   449	 * Return: 0 on success, -errno otherwise.
   450	 */
   451	int spi_nor_write_ear(struct spi_nor *nor, u32 addr)
   452	{
   453		u8 code = SPINOR_OP_WREAR;;
 > 454		u32 ear;
   455		int ret;
   456		struct mtd_info *mtd = &nor->mtd;
   457	
   458		/* Wait until finished previous write command. */
   459		if (spi_nor_wait_till_ready(nor))
   460			return 1;
   461	
   462		if (mtd->size <= (0x1000000) << nor->shift)
   463			return 0;
   464	
   465		addr = addr % (u32)mtd->size;
   466		ear = addr >> 24;
   467	
   468		if (!nor->isstacked && ear == nor->curbank)
   469			return 0;
   470	
   471		if (nor->isstacked && mtd->size <= 0x2000000)
   472			return 0;
   473	
   474		if (nor->jedec_id == CFI_MFR_AMD)
   475			code = SPINOR_OP_BRWR;
   476		if (nor->jedec_id == CFI_MFR_ST ||
   477		    nor->jedec_id == CFI_MFR_MACRONIX ||
   478		    nor->jedec_id == CFI_MFR_PMC) {
   479			spi_nor_write_enable(nor);
   480			code = SPINOR_OP_WREAR;
   481		}
   482		nor->bouncebuf[0] = ear;
   483	
   484		if (nor->spimem) {
   485			struct spi_mem_op op =
   486				SPI_MEM_OP(SPI_MEM_OP_CMD(code, 1),
   487					   SPI_MEM_OP_NO_ADDR,
   488					   SPI_MEM_OP_NO_DUMMY,
   489					   SPI_MEM_OP_DATA_OUT(1, nor->bouncebuf, 1));
   490	
   491			ret = spi_mem_exec_op(nor->spimem, &op);
   492		} else {
   493			ret = nor->controller_ops->write_reg(nor, code, nor->bouncebuf, 1);
   494			if (ret < 0)
   495				return ret;
   496		}
   497	
   498		nor->curbank = ear;
   499	
   500		return ret;
   501	}
   502	

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

[-- Attachment #3: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-04-22 10:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-22 10:04 [xlnx:master 11923/12154] drivers/mtd/spi-nor/core.c:454:2: warning: ISO C90 forbids mixed declarations and code kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).