All of lore.kernel.org
 help / color / mirror / Atom feed
* [peterz-queue:modules/core 1/5] kernel/module.c:2158:27: error: dereferencing pointer to incomplete type
@ 2019-10-18  7:18 kbuild test robot
  0 siblings, 0 replies; only message in thread
From: kbuild test robot @ 2019-10-18  7:18 UTC (permalink / raw)
  To: kbuild-all

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git modules/core
head:   acdb3b4c0fd4a3c6d3a7f5f0b411c5dda45f952b
commit: fe64802b6d0eaa1171826acc8f68d829f776d052 [1/5] module,klp: Add module_section_{en,dis}able_*()
config: x86_64-randconfig-s2-201941 (attached as .config)
compiler: gcc-4.9 (Debian 4.9.2-10+deb8u1) 4.9.2
reproduce:
        git checkout fe64802b6d0eaa1171826acc8f68d829f776d052
        # save the attached .config to linux build tree
        make ARCH=x86_64 

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

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

   In file included from arch/x86/include/asm/module.h:5:0,
                    from include/linux/module.h:27,
                    from include/linux/moduleloader.h:6,
                    from kernel/module.c:9:
>> include/asm-generic/module.h:16:18: warning: 'struct Elf64_Shdr' declared inside parameter list
    #define Elf_Shdr Elf64_Shdr
                     ^
   kernel/module.c:2156:35: note: in expansion of macro 'Elf_Shdr'
    static void __frob_section(struct Elf_Shdr *sec, int (*set_memory)(unsigned long start, int num_pages))
                                      ^
>> include/asm-generic/module.h:16:18: warning: its scope is only this definition or declaration, which is probably not what you want
    #define Elf_Shdr Elf64_Shdr
                     ^
   kernel/module.c:2156:35: note: in expansion of macro 'Elf_Shdr'
    static void __frob_section(struct Elf_Shdr *sec, int (*set_memory)(unsigned long start, int num_pages))
                                      ^
   In file included from include/linux/export.h:44:0,
                    from kernel/module.c:7:
   kernel/module.c: In function '__frob_section':
>> kernel/module.c:2158:27: error: dereferencing pointer to incomplete type
     BUG_ON((unsigned long)sec->sh_addr & (PAGE_SIZE-1));
                              ^
   include/linux/compiler.h:33:34: note: in definition of macro '__branch_check__'
       ______r = __builtin_expect(!!(x), expect); \
                                     ^
   include/asm-generic/bug.h:62:36: note: in expansion of macro 'unlikely'
    #define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while (0)
                                       ^
   kernel/module.c:2158:2: note: in expansion of macro 'BUG_ON'
     BUG_ON((unsigned long)sec->sh_addr & (PAGE_SIZE-1));
     ^
>> kernel/module.c:2158:27: error: dereferencing pointer to incomplete type
     BUG_ON((unsigned long)sec->sh_addr & (PAGE_SIZE-1));
                              ^
   include/linux/compiler.h:35:19: note: in definition of macro '__branch_check__'
              expect, is_constant); \
                      ^
   include/asm-generic/bug.h:62:36: note: in expansion of macro 'unlikely'
    #define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while (0)
                                       ^
   kernel/module.c:2158:2: note: in expansion of macro 'BUG_ON'
     BUG_ON((unsigned long)sec->sh_addr & (PAGE_SIZE-1));
     ^
   kernel/module.c:2159:27: error: dereferencing pointer to incomplete type
     BUG_ON((unsigned long)sec->sh_size & (PAGE_SIZE-1));
                              ^
   include/linux/compiler.h:33:34: note: in definition of macro '__branch_check__'
       ______r = __builtin_expect(!!(x), expect); \
                                     ^
   include/asm-generic/bug.h:62:36: note: in expansion of macro 'unlikely'
    #define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while (0)
                                       ^
   kernel/module.c:2159:2: note: in expansion of macro 'BUG_ON'
     BUG_ON((unsigned long)sec->sh_size & (PAGE_SIZE-1));
     ^
   kernel/module.c:2159:27: error: dereferencing pointer to incomplete type
     BUG_ON((unsigned long)sec->sh_size & (PAGE_SIZE-1));
                              ^
   include/linux/compiler.h:35:19: note: in definition of macro '__branch_check__'
              expect, is_constant); \
                      ^
   include/asm-generic/bug.h:62:36: note: in expansion of macro 'unlikely'
    #define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while (0)
                                       ^
   kernel/module.c:2159:2: note: in expansion of macro 'BUG_ON'
     BUG_ON((unsigned long)sec->sh_size & (PAGE_SIZE-1));
     ^
   kernel/module.c:2160:31: error: dereferencing pointer to incomplete type
     set_memory((unsigned long)sec->sh_addr, sec->sh_size >> PAGE_SHIFT);
                                  ^
   kernel/module.c:2160:45: error: dereferencing pointer to incomplete type
     set_memory((unsigned long)sec->sh_addr, sec->sh_size >> PAGE_SHIFT);
                                                ^
   kernel/module.c: In function 'frob_section':
>> kernel/module.c:2175:18: warning: passing argument 1 of '__frob_section' from incompatible pointer type
      __frob_section(s, set_memory);
                     ^
   kernel/module.c:2156:13: note: expected 'struct Elf64_Shdr *' but argument is of type 'struct Elf64_Shdr *'
    static void __frob_section(struct Elf_Shdr *sec, int (*set_memory)(unsigned long start, int num_pages))
                ^

vim +2158 kernel/module.c

  2155	
> 2156	static void __frob_section(struct Elf_Shdr *sec, int (*set_memory)(unsigned long start, int num_pages))
  2157	{
> 2158		BUG_ON((unsigned long)sec->sh_addr & (PAGE_SIZE-1));
  2159		BUG_ON((unsigned long)sec->sh_size & (PAGE_SIZE-1));
> 2160		set_memory((unsigned long)sec->sh_addr, sec->sh_size >> PAGE_SHIFT);
  2161	}
  2162	
  2163	static void frob_section(struct module *mod, const char *section,
  2164				 int (*set_memory)(unsigned long start, int num_pages))
  2165	{
  2166		struct klp_modinfo *info = mod->klp_info;
  2167		const char *secname;
  2168		Elf_Shdr *s;
  2169	
  2170		for (s = info->sechdrs; s < info->sechdrs + info->hdr.e_shnum; s++) {
  2171			secname = mod->klp_info->secstrings + s->sh_name;
  2172			if (strcmp(secname, section))
  2173				continue;
  2174	
> 2175			__frob_section(s, set_memory);
  2176		}
  2177	}
  2178	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

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

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

only message in thread, other threads:[~2019-10-18  7:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-18  7:18 [peterz-queue:modules/core 1/5] kernel/module.c:2158:27: error: dereferencing pointer to incomplete type kbuild 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.