llvm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [ambarus:spi-nor/next 9/15] drivers/mtd/spi-nor/spansion.c:928:4: warning: variable 'priv' is uninitialized when used here
@ 2023-07-18  7:09 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2023-07-18  7:09 UTC (permalink / raw)
  To: Takahiro Kuwano; +Cc: llvm, oe-kbuild-all, Tudor Ambarus

tree:   https://github.com/ambarus/linux-0day spi-nor/next
head:   665be09f5a5735bb5dcb60043890682e20ac382f
commit: 8c49ad2ebb7ae23fef6859d3f326e82b8789fc09 [9/15] mtd: spi-nor: spansion: use CLPEF as an alternative to CLSR
config: i386-randconfig-i014-20230718 (https://download.01.org/0day-ci/archive/20230718/202307181511.GuBLaRAf-lkp@intel.com/config)
compiler: clang version 15.0.7 (https://github.com/llvm/llvm-project.git 8dfdcc7b7bf66834a761bd8de445840ef68e4d1a)
reproduce: (https://download.01.org/0day-ci/archive/20230718/202307181511.GuBLaRAf-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/202307181511.GuBLaRAf-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/mtd/spi-nor/spansion.c:928:4: warning: variable 'priv' is uninitialized when used here [-Wuninitialized]
                           priv->clsr = SPINOR_OP_CLSR;
                           ^~~~
   drivers/mtd/spi-nor/spansion.c:911:34: note: initialize the variable 'priv' to silence this warning
           struct spansion_nor_params *priv;
                                           ^
                                            = NULL
   1 warning generated.


vim +/priv +928 drivers/mtd/spi-nor/spansion.c

   907	
   908	static int spansion_nor_late_init(struct spi_nor *nor)
   909	{
   910		struct spi_nor_flash_parameter *params = nor->params;
   911		struct spansion_nor_params *priv;
   912		u8 mfr_flags = nor->info->mfr_flags;
   913	
   914		if (params->size > SZ_16M) {
   915			nor->flags |= SNOR_F_4B_OPCODES;
   916			/* No small sector erase for 4-byte command set */
   917			nor->erase_opcode = SPINOR_OP_SE;
   918			nor->mtd.erasesize = nor->info->sector_size;
   919		}
   920	
   921		if (mfr_flags & (USE_CLSR | USE_CLPEF)) {
   922			params->priv = devm_kmalloc(nor->dev, sizeof(*priv),
   923						    GFP_KERNEL);
   924			if (!params->priv)
   925				return -ENOMEM;
   926	
   927			if (mfr_flags & USE_CLSR)
 > 928				priv->clsr = SPINOR_OP_CLSR;
   929			else if (mfr_flags & USE_CLPEF)
   930				priv->clsr = SPINOR_OP_CLPEF;
   931	
   932			nor->params->ready = spansion_nor_sr_ready_and_clear;
   933		}
   934	
   935		return 0;
   936	}
   937	

-- 
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-07-18  7:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-18  7:09 [ambarus:spi-nor/next 9/15] drivers/mtd/spi-nor/spansion.c:928:4: warning: variable 'priv' is uninitialized when used here 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).