From: kernel test robot <lkp@intel.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: oe-kbuild-all@lists.linux.dev,
linux-arm-kernel@lists.infradead.org, arm@kernel.org
Subject: [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
Date: Thu, 10 Sep 2026 17:42:35 +0200 [thread overview]
Message-ID: <202609101040.gBAHTWoN-lkp@intel.com> (raw)
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
reply other threads:[~2026-09-10 15:43 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202609101040.gBAHTWoN-lkp@intel.com \
--to=lkp@intel.com \
--cc=arm@kernel.org \
--cc=arnd@arndb.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=oe-kbuild-all@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox