[xlnx:master 11923/12154] drivers/mtd/spi-nor/core.c:454:2: warning: ISO C90 forbids mixed declarations and code
kernel test robot
lkp at intel.com
Thu Apr 22 11:04:15 BST 2021
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 at 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 22869 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20210422/5739ff8b/attachment-0001.gz>
More information about the linux-arm-kernel
mailing list