All of lore.kernel.org
 help / color / mirror / Atom feed
* [bcache:nvdimm-meta 10/16] drivers/md/bcache/journal.c:997:10: error: dereferencing pointer to incomplete type 'struct bch_extent'
@ 2021-03-29 19:53 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-03-29 19:53 UTC (permalink / raw)
  To: kbuild-all

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/colyli/linux-bcache.git nvdimm-meta
head:   be0f72faa6d269aa7d824296859cd055f0ba61a0
commit: 6521498ff4eb39bb26cbd09dd9965b43af366663 [10/16] bcache: initialize bcache journal for NVDIMM meta device
config: m68k-allmodconfig (attached as .config)
compiler: m68k-linux-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=6521498ff4eb39bb26cbd09dd9965b43af366663
        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 6521498ff4eb39bb26cbd09dd9965b43af366663
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=m68k 

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

All error/warnings (new ones prefixed by >>):

   In file included from drivers/md/bcache/nvm-pages.h:6,
                    from drivers/md/bcache/journal.c:12:
   include/uapi/linux/bcache-nvm.h:110:3: error: #error "Non-64bit platform is not supported"
     110 |  #error "Non-64bit platform is not supported"
         |   ^~~~~
   include/uapi/linux/bcache-nvm.h: In function 'pgalloc_rec_pageoff':
   include/uapi/linux/bcache-nvm.h:127:26: warning: left shift count >= width of type [-Wshift-count-overflow]
     127 |  return (rec->v & ~(~0UL << BCH_NVM_PAGES_PGOFF_BITS));
         |                          ^~
   include/uapi/linux/bcache-nvm.h: In function 'set_pgalloc_rec_pageoff':
   include/uapi/linux/bcache-nvm.h:133:17: warning: left shift count >= width of type [-Wshift-count-overflow]
     133 |  rec->v &= ~0UL << BCH_NVM_PAGES_PGOFF_BITS;
         |                 ^~
   include/uapi/linux/bcache-nvm.h:134:23: warning: left shift count >= width of type [-Wshift-count-overflow]
     134 |  rec->v |= v & ~(~0UL << BCH_NVM_PAGES_PGOFF_BITS);
         |                       ^~
   include/uapi/linux/bcache-nvm.h: In function 'set_pgalloc_rec_order':
   include/uapi/linux/bcache-nvm.h:150:56: warning: left shift count >= width of type [-Wshift-count-overflow]
     150 |  rec->v |= (v & ~(~0UL << BCH_NVM_PAGES_PGORDER_BITS)) <<
         |                                                        ^~
   drivers/md/bcache/journal.c: At top level:
   drivers/md/bcache/journal.c:988:43: warning: 'struct bch_extent' declared inside parameter list will not be visible outside of this definition or declaration
     988 | static void *find_journal_nvm_base(struct bch_extent *list, struct cache *ca)
         |                                           ^~~~~~~~~~
   drivers/md/bcache/journal.c: In function 'find_journal_nvm_base':
>> drivers/md/bcache/journal.c:997:10: error: dereferencing pointer to incomplete type 'struct bch_extent'
     997 |   if (cur->kaddr == (void *)ca->sb.d[0]) {
         |          ^~
>> drivers/md/bcache/journal.c:997:21: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     997 |   if (cur->kaddr == (void *)ca->sb.d[0]) {
         |                     ^
   In file included from <command-line>:
>> include/linux/compiler_types.h:140:35: error: invalid use of undefined type 'struct bch_extent'
     140 | #define __compiler_offsetof(a, b) __builtin_offsetof(a, b)
         |                                   ^~~~~~~~~~~~~~~~~~
   include/linux/stddef.h:17:32: note: in expansion of macro '__compiler_offsetof'
      17 | #define offsetof(TYPE, MEMBER) __compiler_offsetof(TYPE, MEMBER)
         |                                ^~~~~~~~~~~~~~~~~~~
   include/linux/kernel.h:712:21: note: in expansion of macro 'offsetof'
     712 |  ((type *)(__mptr - offsetof(type, member))); })
         |                     ^~~~~~~~
   include/linux/list.h:511:2: note: in expansion of macro 'container_of'
     511 |  container_of(ptr, type, member)
         |  ^~~~~~~~~~~~
   drivers/md/bcache/journal.c:1001:10: note: in expansion of macro 'list_entry'
    1001 |   next = list_entry(cur->list.next, struct bch_extent, list);
         |          ^~~~~~~~~~
   drivers/md/bcache/journal.c: At top level:
   drivers/md/bcache/journal.c:1007:48: warning: 'struct bch_extent' declared inside parameter list will not be visible outside of this definition or declaration
    1007 | static void bch_release_nvm_extent_list(struct bch_extent *list)
         |                                                ^~~~~~~~~~
   In file included from include/linux/wait.h:7,
                    from include/linux/wait_bit.h:8,
                    from include/linux/fs.h:6,
                    from include/linux/highmem.h:5,
                    from include/linux/bio.h:8,
                    from drivers/md/bcache/bcache.h:182,
                    from drivers/md/bcache/journal.c:8:
   drivers/md/bcache/journal.c: In function 'bch_release_nvm_extent_list':
   drivers/md/bcache/journal.c:1012:37: error: dereferencing pointer to incomplete type 'struct bch_extent'
    1012 |  list_for_each_safe(cur, next, &list->list) {
         |                                     ^~
   include/linux/list.h:598:14: note: in definition of macro 'list_for_each_safe'
     598 |  for (pos = (head)->next, n = pos->next; pos != (head); \
         |              ^~~~
   include/linux/list.h:598:25: warning: left-hand operand of comma expression has no effect [-Wunused-value]
     598 |  for (pos = (head)->next, n = pos->next; pos != (head); \
         |                         ^
   drivers/md/bcache/journal.c:1012:2: note: in expansion of macro 'list_for_each_safe'
    1012 |  list_for_each_safe(cur, next, &list->list) {
         |  ^~~~~~~~~~~~~~~~~~
   In file included from <command-line>:
>> include/linux/compiler_types.h:140:35: error: invalid use of undefined type 'struct bch_extent'
     140 | #define __compiler_offsetof(a, b) __builtin_offsetof(a, b)
         |                                   ^~~~~~~~~~~~~~~~~~
   include/linux/stddef.h:17:32: note: in expansion of macro '__compiler_offsetof'
      17 | #define offsetof(TYPE, MEMBER) __compiler_offsetof(TYPE, MEMBER)
         |                                ^~~~~~~~~~~~~~~~~~~
   include/linux/kernel.h:712:21: note: in expansion of macro 'offsetof'
     712 |  ((type *)(__mptr - offsetof(type, member))); })
         |                     ^~~~~~~~
   include/linux/list.h:511:2: note: in expansion of macro 'container_of'
     511 |  container_of(ptr, type, member)
         |  ^~~~~~~~~~~~
   drivers/md/bcache/journal.c:1013:9: note: in expansion of macro 'list_entry'
    1013 |   ext = list_entry(cur, struct bch_extent, list);
         |         ^~~~~~~~~~
   drivers/md/bcache/journal.c: In function 'get_nvdimm_journal_space':
>> drivers/md/bcache/journal.c:1023:17: error: assignment to 'struct bch_extent *' from incompatible pointer type 'struct bch_nvm_pages_owner_head *' [-Werror=incompatible-pointer-types]
    1023 |  allocated_list = bch_get_allocated_pages(ca->sb.set_uuid);
         |                 ^
>> drivers/md/bcache/journal.c:1025:31: error: passing argument 1 of 'find_journal_nvm_base' from incompatible pointer type [-Werror=incompatible-pointer-types]
    1025 |   ret = find_journal_nvm_base(allocated_list, ca);
         |                               ^~~~~~~~~~~~~~
         |                               |
         |                               struct bch_extent *
   drivers/md/bcache/journal.c:988:55: note: expected 'struct bch_extent *' but argument is of type 'struct bch_extent *'
     988 | static void *find_journal_nvm_base(struct bch_extent *list, struct cache *ca)
         |                                    ~~~~~~~~~~~~~~~~~~~^~~~
>> drivers/md/bcache/journal.c:1026:31: error: passing argument 1 of 'bch_release_nvm_extent_list' from incompatible pointer type [-Werror=incompatible-pointer-types]
    1026 |   bch_release_nvm_extent_list(allocated_list);
         |                               ^~~~~~~~~~~~~~
         |                               |
         |                               struct bch_extent *
   drivers/md/bcache/journal.c:1007:60: note: expected 'struct bch_extent *' but argument is of type 'struct bch_extent *'
    1007 | static void bch_release_nvm_extent_list(struct bch_extent *list)
         |                                         ~~~~~~~~~~~~~~~~~~~^~~~
   drivers/md/bcache/journal.c: In function '__bch_journal_nvdimm_init':
>> drivers/md/bcache/journal.c:1059:4: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
    1059 |    (u64)(journal_nvm_base + (ca->sb.bucket_size * i));
         |    ^
   In file included from drivers/md/bcache/nvm-pages.h:6,
                    from drivers/md/bcache/journal.c:12:
   At top level:
   include/uapi/linux/bcache-nvm.h:105:28: warning: 'bch_nvm_pages_pgalloc_magic' defined but not used [-Wunused-const-variable=]
     105 | static const unsigned char bch_nvm_pages_pgalloc_magic[] = {
         |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/uapi/linux/bcache-nvm.h:102:28: warning: 'bch_nvm_pages_magic' defined but not used [-Wunused-const-variable=]
     102 | static const unsigned char bch_nvm_pages_magic[] = {
         |                            ^~~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors


vim +997 drivers/md/bcache/journal.c

   987	
   988	static void *find_journal_nvm_base(struct bch_extent *list, struct cache *ca)
   989	{
   990		void *ret = NULL;
   991		struct bch_extent *cur, *next;
   992	
   993		next = list;
   994		do {
   995			cur = next;
   996			/* Match journal area's nvdimm address */
 > 997			if (cur->kaddr == (void *)ca->sb.d[0]) {
   998				ret = cur->kaddr;
   999				break;
  1000			}
  1001			next = list_entry(cur->list.next, struct bch_extent, list);
  1002		} while (next != list);
  1003	
  1004		return ret;
  1005	}
  1006	
  1007	static void bch_release_nvm_extent_list(struct bch_extent *list)
  1008	{
  1009		struct bch_extent *ext;
  1010		struct list_head *cur, *next;
  1011	
  1012		list_for_each_safe(cur, next, &list->list) {
  1013			ext = list_entry(cur, struct bch_extent, list);
  1014			kfree(ext);
  1015		}
  1016	}
  1017	
  1018	static void *get_nvdimm_journal_space(struct cache *ca)
  1019	{
  1020		struct bch_extent *allocated_list = NULL;
  1021		void *ret = NULL;
  1022	
> 1023		allocated_list = bch_get_allocated_pages(ca->sb.set_uuid);
  1024		if (allocated_list) {
> 1025			ret = find_journal_nvm_base(allocated_list, ca);
> 1026			bch_release_nvm_extent_list(allocated_list);
  1027		}
  1028	
  1029		if (!ret) {
  1030			int order = ilog2(ca->sb.bucket_size * ca->sb.njournal_buckets /
  1031					  PAGE_SECTORS);
  1032	
  1033			ret = bch_nvm_alloc_pages(order, ca->sb.set_uuid);
  1034			if (ret)
  1035				memset(ret, 0, (1 << order) * PAGE_SIZE);
  1036		}
  1037	
  1038		return ret;
  1039	}
  1040	
  1041	static int __bch_journal_nvdimm_init(struct cache *ca)
  1042	{
  1043		int i, ret = 0;
  1044		void *journal_nvm_base = NULL;
  1045	
  1046		journal_nvm_base = get_nvdimm_journal_space(ca);
  1047		if (!journal_nvm_base) {
  1048			pr_err("Failed to get journal space from nvdimm\n");
  1049			ret = -1;
  1050			goto out;
  1051		}
  1052	
  1053		/* Iniialized and reloaded from on-disk super block already */
  1054		if (ca->sb.d[0] != 0)
  1055			goto out;
  1056	
  1057		for (i = 0; i < ca->sb.keys; i++)
  1058			ca->sb.d[i] =
> 1059				(u64)(journal_nvm_base + (ca->sb.bucket_size * i));
  1060	
  1061	out:
  1062		return ret;
  1063	}
  1064	

---
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: 59899 bytes --]

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

only message in thread, other threads:[~2021-03-29 19:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-29 19:53 [bcache:nvdimm-meta 10/16] drivers/md/bcache/journal.c:997:10: error: dereferencing pointer to incomplete type 'struct bch_extent' 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.