linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [bcache:nvdimm-meta 3/12] drivers/md/bcache/nvm-pages.c:204:18: warning: variable 'base_pgoff' set but not used
@ 2021-07-26 19:38 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-07-26 19:38 UTC (permalink / raw)
  To: Jianpeng Ma; +Cc: kbuild-all, linux-kernel, Coly Li, Qiaowei Ren

[-- Attachment #1: Type: text/plain, Size: 3561 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/colyli/linux-bcache.git nvdimm-meta
head:   e9d63ebcb289612237d5a62fa9876114798555eb
commit: 6d4dbab94b60ec3633c4b5a5244e110f36753b6d [3/12] bcache: initialization of the buddy
config: s390-allyesconfig (attached as .config)
compiler: s390-linux-gcc (GCC) 10.3.0
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/colyli/linux-bcache.git/commit/?id=6d4dbab94b60ec3633c4b5a5244e110f36753b6d
        git remote add bcache https://git.kernel.org/pub/scm/linux/kernel/git/colyli/linux-bcache.git
        git fetch --no-tags bcache nvdimm-meta
        git checkout 6d4dbab94b60ec3633c4b5a5244e110f36753b6d
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross ARCH=s390 

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

All warnings (new ones prefixed by >>):

   drivers/md/bcache/nvm-pages.c: In function 'init_nvmpg_set_header':
>> drivers/md/bcache/nvm-pages.c:204:18: warning: variable 'base_pgoff' set but not used [-Wunused-but-set-variable]
     204 |    unsigned long base_pgoff;
         |                  ^~~~~~~~~~


vim +/base_pgoff +204 drivers/md/bcache/nvm-pages.c

   168	
   169	/* Namespace 0 contains all meta data of the nvmpg allocation set */
   170	static int init_nvmpg_set_header(struct bch_nvmpg_ns *ns)
   171	{
   172		struct bch_nvmpg_set_header *set_header;
   173		struct bch_nvmpg_recs *sys_recs;
   174		int i, j, used = 0, rc = 0;
   175	
   176		if (ns->ns_id != 0) {
   177			pr_err("unexpected ns_id %u for first nvmpg namespace.\n",
   178			       ns->ns_id);
   179			return -EINVAL;
   180		}
   181	
   182		set_header = bch_nvmpg_offset_to_ptr(ns->sb->set_header_offset);
   183	
   184		mutex_lock(&global_nvmpg_set->lock);
   185		global_nvmpg_set->set_header = set_header;
   186		global_nvmpg_set->heads_size = set_header->size;
   187		global_nvmpg_set->heads_used = set_header->used;
   188	
   189		/* Reserve the used space from buddy allocator */
   190		reserve_nvmpg_pages(ns, 0, div_u64(ns->pages_offset, ns->page_size));
   191	
   192		sys_recs = ns->base_addr + BCH_NVMPG_SYSRECS_HEAD_OFFSET;
   193		for (i = 0; i < set_header->size; i++) {
   194			struct bch_nvmpg_head *head;
   195	
   196			head = &set_header->heads[i];
   197			if (head->state == BCH_NVMPG_HD_STAT_FREE)
   198				continue;
   199	
   200			used++;
   201	
   202			for (j = 0; j < BCH_NVMPG_NS_MAX; j++) {
   203				struct bch_nvmpg_recs *recs;
 > 204				unsigned long base_pgoff;
   205	
   206				base_pgoff = (unsigned long)ns->base_addr >> PAGE_SHIFT;
   207				recs = bch_nvmpg_offset_to_ptr(head->recs_offset[j]);
   208	
   209				/* Iterate the recs list */
   210				while (recs) {
   211					rc = validate_recs(j, head, recs);
   212					if (rc < 0)
   213						goto unlock;
   214	
   215					rc = reserve_nvmpg_recs(recs);
   216					if (rc < 0)
   217						goto unlock;
   218	
   219					bitmap_set(ns->recs_bitmap, recs - sys_recs, 1);
   220					recs = bch_nvmpg_offset_to_ptr(recs->next_offset);
   221				}
   222			}
   223		}
   224	unlock:
   225		mutex_unlock(&global_nvmpg_set->lock);
   226		return rc;
   227	}
   228	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 66780 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-07-26 19:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-26 19:38 [bcache:nvdimm-meta 3/12] drivers/md/bcache/nvm-pages.c:204:18: warning: variable 'base_pgoff' set but not used 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;
as well as URLs for NNTP newsgroup(s).