public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
* [xilinx-xlnx:lkp_test 14/42] drivers/mtd/spi-nor/core.c:632:5: warning: no previous prototype for function 'spi_nor_write_ear'
@ 2023-12-06  2:46 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2023-12-06  2:46 UTC (permalink / raw)
  To: Amit Kumar Mahapatra; +Cc: llvm, oe-kbuild-all, git, Radhey Shyam Pandey

tree:   https://github.com/Xilinx/linux-xlnx lkp_test
head:   414b0dc753ec961cf8e532b86412522e78a00169
commit: c29562880a8dec6ead1ec39e25e91840bad9da62 [14/42] mtd: spi-nor: Add EAR support
config: x86_64-randconfig-006-20231201 (https://download.01.org/0day-ci/archive/20231206/202312061040.MaLcPvKI-lkp@intel.com/config)
compiler: clang version 16.0.4 (https://github.com/llvm/llvm-project.git ae42196bc493ffe877a7e3dff8be32035dea4d07)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231206/202312061040.MaLcPvKI-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202312061040.MaLcPvKI-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/mtd/spi-nor/core.c:632:5: warning: no previous prototype for function 'spi_nor_write_ear' [-Wmissing-prototypes]
   int spi_nor_write_ear(struct spi_nor *nor, u32 addr)
       ^
   drivers/mtd/spi-nor/core.c:632:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   int spi_nor_write_ear(struct spi_nor *nor, u32 addr)
   ^
   static 
   drivers/mtd/spi-nor/core.c:2102:14: warning: variable 'offset' is uninitialized when used here [-Wuninitialized]
                           u64 aux = offset;
                                     ^~~~~~
   drivers/mtd/spi-nor/core.c:1951:23: note: initialize the variable 'offset' to silence this warning
           u32 addr, len, offset, cur_cs_num = 0;
                                ^
                                 = 0
   drivers/mtd/spi-nor/core.c:4022:8: warning: variable 'ret' is uninitialized when used here [-Wuninitialized]
                           if (ret)
                               ^~~
   drivers/mtd/spi-nor/core.c:4006:9: note: initialize the variable 'ret' to silence this warning
           int ret;
                  ^
                   = 0
   3 warnings generated.


vim +/spi_nor_write_ear +632 drivers/mtd/spi-nor/core.c

   624	
   625	/**
   626	 * spi_nor_write_ear() - Write Extended Address Register.
   627	 * @nor:	pointer to 'struct spi_nor'.
   628	 * @addr:	value to write to the Extended Address Register.
   629	 *
   630	 * Return: 0 on success, -errno otherwise.
   631	 */
 > 632	int spi_nor_write_ear(struct spi_nor *nor, u32 addr)
   633	{
   634		u8 code = SPINOR_OP_WREAR;
   635		u32 ear;
   636		int ret;
   637		struct mtd_info *mtd = &nor->mtd;
   638	
   639		/* Wait until finished previous write command. */
   640		if (spi_nor_wait_till_ready(nor))
   641			return 1;
   642	
   643		ret = spi_nor_write_enable(nor);
   644		if (ret)
   645			return ret;
   646	
   647		if (!(nor->flags & SNOR_F_HAS_PARALLEL) && mtd->size <= 0x1000000)
   648			return 0;
   649		else if (mtd->size <= 0x2000000)
   650			return 0;
   651	
   652		if (!(nor->flags & SNOR_F_HAS_PARALLEL) || !(nor->flags & SNOR_F_HAS_STACKED))
   653			addr = addr % (u32)mtd->size;
   654		else
   655			addr = addr % (u32)(mtd->size >> 0x1);
   656	
   657		ear = addr >> 24;
   658	
   659		if (!(nor->flags & SNOR_F_HAS_STACKED) && ear == nor->curbank)
   660			return 0;
   661	
   662		if ((nor->flags & SNOR_F_HAS_STACKED) && mtd->size <= 0x2000000)
   663			return 0;
   664	
   665		if (nor->jedec_id == CFI_MFR_AMD)
   666			code = SPINOR_OP_BRWR;
   667		if (nor->jedec_id == CFI_MFR_ST ||
   668		    nor->jedec_id == CFI_MFR_MACRONIX ||
   669		    nor->jedec_id == CFI_MFR_PMC) {
   670			spi_nor_write_enable(nor);
   671			code = SPINOR_OP_WREAR;
   672		}
   673		nor->bouncebuf[0] = ear;
   674	
   675		if (nor->spimem) {
   676			struct spi_mem_op op =
   677				SPI_MEM_OP(SPI_MEM_OP_CMD(code, 0),
   678					   SPI_MEM_OP_NO_ADDR,
   679					   SPI_MEM_OP_NO_DUMMY,
   680					   SPI_MEM_OP_DATA_OUT(1, nor->bouncebuf, 0));
   681	
   682			spi_nor_spimem_setup_op(nor, &op, nor->reg_proto);
   683	
   684			ret = spi_mem_exec_op(nor->spimem, &op);
   685		} else {
   686			ret = spi_nor_controller_ops_write_reg(nor, code, nor->bouncebuf, 1);
   687			if (ret < 0)
   688				return ret;
   689		}
   690	
   691		nor->curbank = ear;
   692	
   693		return ret;
   694	}
   695	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

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

only message in thread, other threads:[~2023-12-06  2:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-06  2:46 [xilinx-xlnx:lkp_test 14/42] drivers/mtd/spi-nor/core.c:632:5: warning: no previous prototype for function 'spi_nor_write_ear' 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