public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Gao Xiang <hsiangkao@linux.alibaba.com>
Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org,
	Xiang Gao <xiang@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: [xiang:erofs/advancedpcl 15/15] fs/erofs/zdata.c:920:15: warning: variable 'mappednr' is uninitialized when used here
Date: Mon, 4 Jul 2022 07:48:47 +0800	[thread overview]
Message-ID: <202207040759.hbbBfdAF-lkp@intel.com> (raw)

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

                 reply	other threads:[~2022-07-03 23:49 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=202207040759.hbbBfdAF-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=hsiangkao@linux.alibaba.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=xiang@kernel.org \
    /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