All of lore.kernel.org
 help / color / mirror / Atom feed
* [soc:board-remove-7.3 226/294] drivers/mtd/spi-nor/core.c:1178:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is true
@ 2026-09-10 15:42 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-09-10 15:42 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: oe-kbuild-all, linux-arm-kernel, arm

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git board-remove-7.3
head:   3ac93c1e700558259ea604f7d4f37e26820fba15
commit: 62e3b560c8fdcab6be5dce819f3b76df95cd95dc [226/294] mtd: spi-nor: remove controller_ops support
config: loongarch-allyesconfig (https://download.01.org/0day-ci/archive/20260910/202609101040.gBAHTWoN-lkp@intel.com/config)
compiler: clang version 22.1.8 (https://github.com/llvm/llvm-project ca7933e47d3a3451d81e72ac174dcb5aa28b59d1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260910/202609101040.gBAHTWoN-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/202609101040.gBAHTWoN-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/mtd/spi-nor/core.c:351:6: warning: unused variable 'ret' [-Wunused-variable]
     351 |         int ret;
         |             ^~~
>> drivers/mtd/spi-nor/core.c:1178:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
    1178 |         if (!spi_nor_use_parallel_locking(nor))
         |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/mtd/spi-nor/core.c:1184:9: note: uninitialized use occurs here
    1184 |         return ret;
         |                ^~~
   drivers/mtd/spi-nor/core.c:1178:2: note: remove the 'if' if its condition is always false
    1178 |         if (!spi_nor_use_parallel_locking(nor))
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    1179 |                 mutex_lock(&nor->lock);
         |                 ~~~~~~~~~~~~~~~~~~~~~~~
    1180 |         else
         |         ~~~~
    1181 |                 ret = wait_event_killable(nor->rww.wait,
   drivers/mtd/spi-nor/core.c:1176:9: note: initialize the variable 'ret' to silence this warning
    1176 |         int ret;
         |                ^
         |                 = 0
   drivers/mtd/spi-nor/core.c:1242:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
    1242 |         if (!spi_nor_use_parallel_locking(nor))
         |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/mtd/spi-nor/core.c:1248:9: note: uninitialized use occurs here
    1248 |         return ret;
         |                ^~~
   drivers/mtd/spi-nor/core.c:1242:2: note: remove the 'if' if its condition is always false
    1242 |         if (!spi_nor_use_parallel_locking(nor))
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    1243 |                 mutex_lock(&nor->lock);
         |                 ~~~~~~~~~~~~~~~~~~~~~~~
    1244 |         else
         |         ~~~~
    1245 |                 ret = wait_event_killable(nor->rww.wait,
   drivers/mtd/spi-nor/core.c:1240:9: note: initialize the variable 'ret' to silence this warning
    1240 |         int ret;
         |                ^
         |                 = 0
   drivers/mtd/spi-nor/core.c:1309:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
    1309 |         if (!spi_nor_use_parallel_locking(nor))
         |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/mtd/spi-nor/core.c:1315:9: note: uninitialized use occurs here
    1315 |         return ret;
         |                ^~~
   drivers/mtd/spi-nor/core.c:1309:2: note: remove the 'if' if its condition is always false
    1309 |         if (!spi_nor_use_parallel_locking(nor))
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    1310 |                 mutex_lock(&nor->lock);
         |                 ~~~~~~~~~~~~~~~~~~~~~~~
    1311 |         else
         |         ~~~~
    1312 |                 ret = wait_event_killable(nor->rww.wait,
   drivers/mtd/spi-nor/core.c:1307:9: note: initialize the variable 'ret' to silence this warning
    1307 |         int ret;
         |                ^
         |                 = 0
   drivers/mtd/spi-nor/core.c:1333:6: warning: unused variable 'i' [-Wunused-variable]
    1333 |         int i;
         |             ^
   drivers/mtd/spi-nor/core.c:2579:6: warning: unused variable 'ignored_mask' [-Wunused-variable]
    2579 |         u32 ignored_mask, shared_mask;
         |             ^~~~~~~~~~~~
   6 warnings generated.


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

74df43b3f626a3 drivers/mtd/spi-nor/core.c    Miquel Raynal 2023-03-28  1173  
c154dbd28003d8 drivers/mtd/spi-nor/core.c    Miquel Raynal 2023-03-28  1174  int spi_nor_prep_and_lock(struct spi_nor *nor)
c154dbd28003d8 drivers/mtd/spi-nor/core.c    Miquel Raynal 2023-03-28  1175  {
c154dbd28003d8 drivers/mtd/spi-nor/core.c    Miquel Raynal 2023-03-28  1176  	int ret;
b199489d37b21c drivers/mtd/spi-nor/spi-nor.c Huang Shijie  2014-02-24  1177  
74df43b3f626a3 drivers/mtd/spi-nor/core.c    Miquel Raynal 2023-03-28 @1178  	if (!spi_nor_use_parallel_locking(nor))
c154dbd28003d8 drivers/mtd/spi-nor/core.c    Miquel Raynal 2023-03-28  1179  		mutex_lock(&nor->lock);
74df43b3f626a3 drivers/mtd/spi-nor/core.c    Miquel Raynal 2023-03-28  1180  	else
74df43b3f626a3 drivers/mtd/spi-nor/core.c    Miquel Raynal 2023-03-28  1181  		ret = wait_event_killable(nor->rww.wait,
74df43b3f626a3 drivers/mtd/spi-nor/core.c    Miquel Raynal 2023-03-28  1182  					  spi_nor_rww_start_exclusive(nor));
c154dbd28003d8 drivers/mtd/spi-nor/core.c    Miquel Raynal 2023-03-28  1183  
b199489d37b21c drivers/mtd/spi-nor/spi-nor.c Huang Shijie  2014-02-24  1184  	return ret;
b199489d37b21c drivers/mtd/spi-nor/spi-nor.c Huang Shijie  2014-02-24  1185  }
b199489d37b21c drivers/mtd/spi-nor/spi-nor.c Huang Shijie  2014-02-24  1186  

:::::: The code at line 1178 was first introduced by commit
:::::: 74df43b3f626a3594a4de50556048852bf2753f7 mtd: spi-nor: Enhance locking to support reads while writes

:::::: TO: Miquel Raynal <miquel.raynal@bootlin.com>
:::::: CC: Tudor Ambarus <tudor.ambarus@linaro.org>

--
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:[~2026-09-10 15:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-10 15:42 [soc:board-remove-7.3 226/294] drivers/mtd/spi-nor/core.c:1178:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is true kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.