All of lore.kernel.org
 help / color / mirror / Atom feed
* [bcache:for-next 7/14] drivers/md/bcache/nvm-pages.c:208:78: warning: parameter 'ns_nr' set but not used
@ 2021-06-02 16:10 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-06-02 16:10 UTC (permalink / raw)
  To: kbuild-all

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/colyli/linux-bcache.git for-next
head:   a019aef1d302e9dbc0b1d05f3a23d1220592c738
commit: 4c08712fe8558b9591c2b7301641147ee1058e22 [7/14] bcache: bch_nvm_free_pages() of the buddy
config: arc-allyesconfig (attached as .config)
compiler: arceb-elf-gcc (GCC) 9.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=4c08712fe8558b9591c2b7301641147ee1058e22
        git remote add bcache https://git.kernel.org/pub/scm/linux/kernel/git/colyli/linux-bcache.git
        git fetch --no-tags bcache for-next
        git checkout 4c08712fe8558b9591c2b7301641147ee1058e22
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arc 

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 'find_owner_head':
   drivers/md/bcache/nvm-pages.c:86:42: error: dereferencing pointer to incomplete type 'struct bch_owner_list_head'
      86 |   if (!memcmp(owner_uuid, owner_list_head->heads[i].uuid, 16)) {
         |                                          ^~
   drivers/md/bcache/nvm-pages.c: In function 'find_empty_pgalloc_recs':
   drivers/md/bcache/nvm-pages.c:115:62: error: 'BCH_MAX_PGALLOC_RECS' undeclared (first use in this function)
     115 |  start = bitmap_find_next_zero_area(ns->pgalloc_recs_bitmap, BCH_MAX_PGALLOC_RECS, 0, 1, 0);
         |                                                              ^~~~~~~~~~~~~~~~~~~~
   drivers/md/bcache/nvm-pages.c:115:62: note: each undeclared identifier is reported only once for each function it appears in
   drivers/md/bcache/nvm-pages.c:122:53: error: 'BCH_NVM_PAGES_SYS_RECS_HEAD_OFFSET' undeclared (first use in this function)
     122 |  recs = (struct bch_nvm_pgalloc_recs *)(ns->kaddr + BCH_NVM_PAGES_SYS_RECS_HEAD_OFFSET)
         |                                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/md/bcache/nvm-pages.c: In function 'find_nvm_pgalloc_recs':
   drivers/md/bcache/nvm-pages.c:130:20: error: dereferencing pointer to incomplete type 'struct bch_nvm_pages_sb'
     130 |  int ns_nr = ns->sb->this_namespace_nr;
         |                    ^~
   drivers/md/bcache/nvm-pages.c:131:67: error: dereferencing pointer to incomplete type 'struct bch_nvm_pages_owner_head'
     131 |  struct bch_nvm_pgalloc_recs *prev_recs = NULL, *recs = owner_head->recs[ns_nr];
         |                                                                   ^~
   drivers/md/bcache/nvm-pages.c:142:22: error: dereferencing pointer to incomplete type 'struct bch_nvm_pgalloc_recs'
     142 |  while (recs && (recs->used == recs->size)) {
         |                      ^~
   drivers/md/bcache/nvm-pages.c:155:34: error: 'bch_nvm_pages_pgalloc_magic' undeclared (first use in this function)
     155 |   memcpy_flushcache(recs->magic, bch_nvm_pages_pgalloc_magic, 16);
         |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/md/bcache/nvm-pages.c:157:16: error: 'BCH_MAX_RECS' undeclared (first use in this function); did you mean 'BIO_MAX_VECS'?
     157 |   recs->size = BCH_MAX_RECS;
         |                ^~~~~~~~~~~~
         |                BIO_MAX_VECS
   drivers/md/bcache/nvm-pages.c:130:6: warning: variable 'ns_nr' set but not used [-Wunused-but-set-variable]
     130 |  int ns_nr = ns->sb->this_namespace_nr;
         |      ^~~~~
   drivers/md/bcache/nvm-pages.c: In function 'remove_pgalloc_rec':
   drivers/md/bcache/nvm-pages.c:218:25: error: 'BCH_NVM_PAGES_SYS_RECS_HEAD_OFFSET' undeclared (first use in this function)
     218 |  sys_recs = ns->kaddr + BCH_NVM_PAGES_SYS_RECS_HEAD_OFFSET;
         |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/md/bcache/nvm-pages.c:223:11: error: dereferencing pointer to incomplete type 'struct bch_pgalloc_rec'
     223 |    if (rec->pgoff == pgoff) {
         |           ^~
   drivers/md/bcache/nvm-pages.c:230:34: error: arithmetic on pointer to an incomplete type
     230 |      int recs_pos = pgalloc_recs - sys_recs;
         |                                  ^
>> drivers/md/bcache/nvm-pages.c:208:78: warning: parameter 'ns_nr' set but not used [-Wunused-but-set-parameter]
     208 | static int remove_pgalloc_rec(struct bch_nvm_pgalloc_recs *pgalloc_recs, int ns_nr,
         |                                                                          ~~~~^~~~~
   drivers/md/bcache/nvm-pages.c: In function 'init_owner_info':
   drivers/md/bcache/nvm-pages.c:414:25: error: 'BCH_NVM_PAGES_SYS_RECS_HEAD_OFFSET' undeclared (first use in this function)
     414 |  sys_recs = ns->kaddr + BCH_NVM_PAGES_SYS_RECS_HEAD_OFFSET;
         |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/md/bcache/nvm-pages.c:419:19: error: 'BCH_NVM_PAGES_NAMESPACES_MAX' undeclared (first use in this function)
     419 |   for (j = 0; j < BCH_NVM_PAGES_NAMESPACES_MAX; j++) {
         |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/md/bcache/nvm-pages.c:425:56: error: arithmetic on pointer to an incomplete type
     425 |     u32 pgalloc_recs_pos = (unsigned int)(pgalloc_recs - sys_recs);
         |                                                        ^
   drivers/md/bcache/nvm-pages.c:427:37: error: 'bch_nvm_pages_pgalloc_magic' undeclared (first use in this function)
     427 |     if (memcmp(pgalloc_recs->magic, bch_nvm_pages_pgalloc_magic, 16)) {
         |                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/md/bcache/nvm-pages.c:447:13: error: dereferencing pointer to incomplete type 'struct bch_pgalloc_rec'
     447 |      if (rec->pgoff) {
         |             ^~
   drivers/md/bcache/nvm-pages.c: In function 'attach_nvm_set':
   drivers/md/bcache/nvm-pages.c:535:48: error: 'BCH_NVM_PAGES_OWNER_LIST_HEAD_OFFSET' undeclared (first use in this function)
     535 |  if ((unsigned long)ns->sb->owner_list_head == BCH_NVM_PAGES_OWNER_LIST_HEAD_OFFSET) {
         |                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/md/bcache/nvm-pages.c:540:34: error: 'BCH_NVM_PAGES_SYS_RECS_HEAD_OFFSET' undeclared (first use in this function)
     540 |   sys_pgalloc_recs = ns->kaddr + BCH_NVM_PAGES_SYS_RECS_HEAD_OFFSET;
         |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/md/bcache/nvm-pages.c: In function 'read_nvdimm_meta_super':
   drivers/md/bcache/nvm-pages.c:565:4: error: 'BCH_NVM_PAGES_SB_OFFSET' undeclared (first use in this function)
     565 |    BCH_NVM_PAGES_SB_OFFSET >> PAGE_SHIFT, GFP_KERNEL);
         |    ^~~~~~~~~~~~~~~~~~~~~~~
   drivers/md/bcache/nvm-pages.c:579:24: error: 'bch_nvm_pages_magic' undeclared (first use in this function); did you mean 'bch_nvm_pages_sb'?
     579 |  if (memcmp(sb->magic, bch_nvm_pages_magic, 16)) {
         |                        ^~~~~~~~~~~~~~~~~~~
         |                        bch_nvm_pages_sb
   drivers/md/bcache/nvm-pages.c: In function 'bch_register_namespace':
   drivers/md/bcache/nvm-pages.c:670:23: error: 'BCH_NVM_PAGES_SB_OFFSET' undeclared (first use in this function)
     670 |  ns->sb = ns->kaddr + BCH_NVM_PAGES_SB_OFFSET;
         |                       ^~~~~~~~~~~~~~~~~~~~~~~
   drivers/md/bcache/nvm-pages.c:674:28: error: 'bch_nvm_pages_magic' undeclared (first use in this function); did you mean 'bch_nvm_pages_sb'?
     674 |  if (memcmp(ns->sb->magic, bch_nvm_pages_magic, 16)) {
         |                            ^~~~~~~~~~~~~~~~~~~
         |                            bch_nvm_pages_sb
   drivers/md/bcache/nvm-pages.c:705:43: error: 'BCH_MAX_PGALLOC_RECS' undeclared (first use in this function)
     705 |   ns->pgalloc_recs_bitmap = bitmap_zalloc(BCH_MAX_PGALLOC_RECS, GFP_KERNEL);
         |                                           ^~~~~~~~~~~~~~~~~~~~


vim +/ns_nr +208 drivers/md/bcache/nvm-pages.c

   207	
 > 208	static int remove_pgalloc_rec(struct bch_nvm_pgalloc_recs *pgalloc_recs, int ns_nr,
   209					void *kaddr, int order)
   210	{
   211		struct bch_nvm_pages_owner_head *owner_head = pgalloc_recs->owner;
   212		struct bch_nvm_pgalloc_recs *prev_recs, *sys_recs;
   213		u64 pgoff = (unsigned long)kaddr >> PAGE_SHIFT;
   214		struct bch_nvm_namespace *ns = only_set->nss[0];
   215		int i;
   216	
   217		prev_recs = pgalloc_recs;
   218		sys_recs = ns->kaddr + BCH_NVM_PAGES_SYS_RECS_HEAD_OFFSET;
   219		while (pgalloc_recs) {
   220			for (i = 0; i < pgalloc_recs->size; i++) {
   221				struct bch_pgalloc_rec *rec = &(pgalloc_recs->recs[i]);
   222	
   223				if (rec->pgoff == pgoff) {
   224					WARN_ON(rec->order != order);
   225					rec->pgoff = 0;
   226					rec->order = 0;
   227					pgalloc_recs->used--;
   228	
   229					if (pgalloc_recs->used == 0) {
   230						int recs_pos = pgalloc_recs - sys_recs;
   231	
   232						if (pgalloc_recs == prev_recs)
   233							owner_head->recs[ns_nr] = pgalloc_recs->next;
   234						else
   235							prev_recs->next = pgalloc_recs->next;
   236	
   237						pgalloc_recs->next = NULL;
   238						pgalloc_recs->owner = NULL;
   239	
   240						bitmap_clear(ns->pgalloc_recs_bitmap, recs_pos, 1);
   241					}
   242					goto exit;
   243				}
   244			}
   245			prev_recs = pgalloc_recs;
   246			pgalloc_recs = pgalloc_recs->next;
   247		}
   248	exit:
   249		return pgalloc_recs ? 0 : -ENOENT;
   250	}
   251	

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

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

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

only message in thread, other threads:[~2021-06-02 16:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-02 16:10 [bcache:for-next 7/14] drivers/md/bcache/nvm-pages.c:208:78: warning: parameter 'ns_nr' set but not used kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.