Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
* [jaegeuk-f2fs:dev-test 4/4] fs/f2fs/sysfs.c:923:6: warning: variable 'res' is used uninitialized whenever 'if' condition is false
@ 2025-02-04  8:05 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-02-04  8:05 UTC (permalink / raw)
  To: Jaegeuk Kim; +Cc: llvm, oe-kbuild-all, linux-f2fs-devel

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git dev-test
head:   f0d674f43daa7e255465f8d847734a6b9b0f63db
commit: f0d674f43daa7e255465f8d847734a6b9b0f63db [4/4] f2fs: add a sysfs entry to request donate file-backed pages
config: i386-buildonly-randconfig-003-20250204 (https://download.01.org/0day-ci/archive/20250204/202502041610.nmS1Brio-lkp@intel.com/config)
compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250204/202502041610.nmS1Brio-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/202502041610.nmS1Brio-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> fs/f2fs/sysfs.c:923:6: warning: variable 'res' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
     923 |         if (!strcmp(a->attr.name, "reclaim_caches_kb"))
         |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/f2fs/sysfs.c:926:33: note: uninitialized use occurs here
     926 |         return sysfs_emit(buf, "%u\n", res);
         |                                        ^~~
   fs/f2fs/sysfs.c:923:2: note: remove the 'if' if its condition is always true
     923 |         if (!strcmp(a->attr.name, "reclaim_caches_kb"))
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     924 |                 res = f2fs_donate_files();
   fs/f2fs/sysfs.c:921:18: note: initialize the variable 'res' to silence this warning
     921 |         unsigned int res;
         |                         ^
         |                          = 0
   1 warning generated.


vim +923 fs/f2fs/sysfs.c

   918	
   919	static ssize_t f2fs_tune_show(struct f2fs_base_attr *a, char *buf)
   920	{
   921		unsigned int res;
   922	
 > 923		if (!strcmp(a->attr.name, "reclaim_caches_kb"))
   924			res = f2fs_donate_files();
   925	
   926		return sysfs_emit(buf, "%u\n", res);
   927	}
   928	

-- 
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:[~2025-02-04  8:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-04  8:05 [jaegeuk-f2fs:dev-test 4/4] fs/f2fs/sysfs.c:923:6: warning: variable 'res' is used uninitialized whenever 'if' 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