[xlnx:master 11923/12130] drivers/mtd/spi-nor/core.c:454:6: warning: ISO C90 forbids mixing declarations and code
kernel test robot
lkp at intel.com
Wed Apr 21 21:52:42 BST 2021
tree: https://github.com/Xilinx/linux-xlnx master
head: 0605a36e057480f3a83ae401e7ff59739da78e82
commit: 26d248f9f56a753db263a6adde4a04f0c6265374 [11923/12130] mtd: spi-nor: Added EAR support for Zynq qspi driver
config: x86_64-randconfig-a015-20210421 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project d87b9b81ccb95217181ce75515c6c68bbb408ca4)
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
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# 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=clang make.cross W=1 ARCH=x86_64
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:454:6: warning: ISO C90 forbids mixing declarations and code [-Wdeclaration-after-statement]
u32 ear;
^
drivers/mtd/spi-nor/core.c:3538:6: warning: unused variable 'is_dual' [-Wunused-variable]
u32 is_dual;
^
drivers/mtd/spi-nor/core.c:3537:22: warning: unused variable 'np_spi' [-Wunused-variable]
struct device_node *np_spi;
^
drivers/mtd/spi-nor/core.c:542:12: warning: unused function 'read_ear' [-Wunused-function]
static int read_ear(struct spi_nor *nor, struct flash_info *info)
^
4 warnings generated.
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: 37988 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20210422/fb76379c/attachment-0001.gz>
More information about the linux-arm-kernel
mailing list