public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
* [zab-rpdfs:rpdfs-initial 1/51] fs/rpdfs/block.c:309:6: warning: variable 'now' is used uninitialized whenever '&&' condition is false
@ 2026-04-07  8:18 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-04-07  8:18 UTC (permalink / raw)
  To: Zach Brown; +Cc: llvm, oe-kbuild-all

Hi Zach,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/zab/linux-rpdfs.git rpdfs-initial
head:   9a0627207ad856d2a5eb09f3458afb1e34ac10a3
commit: e8e76da7ed715ef67ccc4436f4981a5b39983d9f [1/51] rpdfs: initial commit
config: s390-allmodconfig (https://download.01.org/0day-ci/archive/20260407/202604071621.RJ4cJwBm-lkp@intel.com/config)
compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260407/202604071621.RJ4cJwBm-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/202604071621.RJ4cJwBm-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> fs/rpdfs/block.c:309:6: warning: variable 'now' is used uninitialized whenever '&&' condition is false [-Wsometimes-uninitialized]
     309 |         if (!IS_ERR_OR_NULL(bk) && (now = atomic64_dec_return(&bk->refcount)) == 0)
         |             ^~~~~~~~~~~~~~~~~~~
   fs/rpdfs/block.c:312:15: note: uninitialized use occurs here
     312 |         WARN_ON_ONCE(now < 0);
         |                      ^~~
   include/asm-generic/bug.h:111:25: note: expanded from macro 'WARN_ON_ONCE'
     111 |         int __ret_warn_on = !!(condition);                      \
         |                                ^~~~~~~~~
   fs/rpdfs/block.c:309:6: note: remove the '&&' if its condition is always true
     309 |         if (!IS_ERR_OR_NULL(bk) && (now = atomic64_dec_return(&bk->refcount)) == 0)
         |             ^~~~~~~~~~~~~~~~~~~~~~
   fs/rpdfs/block.c:307:9: note: initialize the variable 'now' to silence this warning
     307 |         s64 now;
         |                ^
         |                 = 0
   1 warning generated.
--
>> fs/rpdfs/super.c:160:7: warning: variable 'ret' is used uninitialized whenever switch case is taken [-Wsometimes-uninitialized]
     160 |         case Opt_mkfs:
         |              ^~~~~~~~
   fs/rpdfs/super.c:178:9: note: uninitialized use occurs here
     178 |         return ret;
         |                ^~~
   fs/rpdfs/super.c:153:9: note: initialize the variable 'ret' to silence this warning
     153 |         int ret;
         |                ^
         |                 = 0
   1 warning generated.


vim +309 fs/rpdfs/block.c

   304	
   305	static void put_block(struct rpdfs_block *bk)
   306	{
   307		s64 now;
   308	
 > 309		if (!IS_ERR_OR_NULL(bk) && (now = atomic64_dec_return(&bk->refcount)) == 0)
   310			free_block(bk);
   311	
   312		WARN_ON_ONCE(now < 0);
   313		WARN_ON_ONCE(now == REMOVAL_REFCOUNT - 1);
   314	}
   315	

-- 
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-04-07  8:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-07  8:18 [zab-rpdfs:rpdfs-initial 1/51] fs/rpdfs/block.c:309:6: warning: variable 'now' is used uninitialized whenever '&&' condition is false 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