lkml.org 
[lkml]   [2022]   [Jul]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subject[xiang:erofs/advancedpcl 15/15] fs/erofs/zdata.c:920:15: warning: variable 'mappednr' is uninitialized when used here
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/xiang/linux.git erofs/advancedpcl
head: cf39c4e41414797419bd1d6b45bcdc365904ad68
commit: cf39c4e41414797419bd1d6b45bcdc365904ad68 [15/15] erofs: introduce multi-reference pclusters
config: i386-randconfig-a015 (https://download.01.org/0day-ci/archive/20220704/202207040759.hbbBfdAF-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 5d787689b14574fe58ba9798563f4a6df6059fbf)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/xiang/linux.git/commit/?id=cf39c4e41414797419bd1d6b45bcdc365904ad68
git remote add xiang https://git.kernel.org/pub/scm/linux/kernel/git/xiang/linux.git
git fetch --no-tags xiang erofs/advancedpcl
git checkout cf39c4e41414797419bd1d6b45bcdc365904ad68
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash fs/erofs/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> fs/erofs/zdata.c:920:15: warning: variable 'mappednr' is uninitialized when used here [-Wuninitialized]
if (src && mappednr != pgnr) {
^~~~~~~~
fs/erofs/zdata.c:899:23: note: initialize the variable 'mappednr' to silence this warning
unsigned int mappednr;
^
= 0
fs/erofs/zdata.c:1608:5: error: too many arguments to function call, expected 3, have 4
z_erofs_get_sync_decompress_policy(sbi, 0));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/erofs/zdata.c:1502:13: note: 'z_erofs_runqueue' declared here
static void z_erofs_runqueue(struct z_erofs_decompress_frontend *f,
^
1 warning and 1 error generated.


vim +/mappednr +920 fs/erofs/zdata.c

895
896 static void z_erofs_fill_duplicated_copy(struct z_erofs_decompress_backend *be)
897 {
898 unsigned char *src = NULL;
899 unsigned int mappednr;
900 struct list_head *p, *n;
901
902 list_for_each_safe(p, n, &be->decompressed_secondary_bvecs) {
903 struct z_erofs_bvec_item *bvi;
904 unsigned int end, cur = 0;
905 int off0;
906 void *dst;
907
908 bvi = container_of(p, struct z_erofs_bvec_item, list);
909 dst = kmap_local_page(bvi->bvec.page);
910
911 if (bvi->bvec.offset < 0)
912 cur = -bvi->bvec.offset;
913 off0 = bvi->bvec.offset + (bvi->bvec.offset & ~PAGE_MASK);
914 end = min_t(unsigned int, be->outputsize - off0, PAGE_SIZE);
915 off0 -= be->pcl->pageofs_out;
916 while (cur < end) {
917 unsigned int pgnr, scur;
918
919 pgnr = (off0 + cur + PAGE_SIZE - 1) >> PAGE_SHIFT;
> 920 if (src && mappednr != pgnr) {
921 kunmap_local(src);
922 src = NULL;
923 }
924 scur = (pgnr << PAGE_SHIFT) - (off0 + cur);
925
926 if (!src)
927 src = kmap_local_page(
928 be->decompressed_pages[pgnr]);
929 memcpy(dst + cur, src + scur, end - max(cur, scur));
930 }
931 kunmap_local(dst);
932 z_erofs_onlinepage_endio(bvi->bvec.page);
933 }
934
935 if (src)
936 kunmap_local(src);
937 }
938

--
0-DAY CI Kernel Test Service
https://01.org/lkp

\
 
 \ /
  Last update: 2022-07-04 01:50    [W:0.057 / U:0.216 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site