@@ -27,13 +27,13 @@ extern char __start_unwind[], __end_unwind[];
extern char __start_ivt_text[], __end_ivt_text[];
#undef dereference_function_descriptor
-static inline void *dereference_function_descriptor(void *ptr)
+static inline unsigned long dereference_function_descriptor(unsigned long ptr)
{
- struct fdesc *desc = ptr;
+ struct fdesc *desc = (struct fdesc *)ptr;
void *p;
if (!probe_kernel_address(&desc->ip, p))
- ptr = p;
+ ptr = (unsigned long)p;
return ptr;
}
@@ -6,7 +6,7 @@
#ifdef CONFIG_64BIT
#undef dereference_function_descriptor
-void *dereference_function_descriptor(void *);
+unsigned long dereference_function_descriptor(unsigned long);
#endif
#endif
@@ -267,13 +267,13 @@ get_wchan(struct task_struct *p)
}
#ifdef CONFIG_64BIT
-void *dereference_function_descriptor(void *ptr)
+unsigned long dereference_function_descriptor(unsigned long ptr)
{
- Elf64_Fdesc *desc = ptr;
+ Elf64_Fdesc *desc = (Elf64_Fdesc *)ptr;
void *p;
if (!probe_kernel_address(&desc->addr, p))
- ptr = p;
+ ptr = (unsigned long)p;
return ptr;
}
#endif
@@ -389,10 +389,10 @@ static void __init setup_bootmem(void)
static int __init parisc_text_address(unsigned long vaddr)
{
static unsigned long head_ptr __initdata;
+ unsigned long addr = (unsigned long)&parisc_kernel_start;
if (!head_ptr)
- head_ptr = PAGE_MASK & (unsigned long)
- dereference_function_descriptor(&parisc_kernel_start);
+ head_ptr = PAGE_MASK & dereference_function_descriptor(addr);
return core_kernel_text(vaddr) || vaddr == head_ptr;
}
@@ -66,13 +66,13 @@ static inline int overlaps_kvm_tmp(unsigned long start, unsigned long end)
#ifdef PPC64_ELF_ABI_v1
#undef dereference_function_descriptor
-static inline void *dereference_function_descriptor(void *ptr)
+static inline unsigned long dereference_function_descriptor(unsigned long ptr)
{
- struct ppc64_opd_entry *desc = ptr;
+ struct ppc64_opd_entry *desc = (struct ppc64_opd_entry *)ptr;
void *p;
if (!probe_kernel_address(&desc->funcaddr, p))
- ptr = p;
+ ptr = (unsigned long)p;
return ptr;
}
#endif /* PPC64_ELF_ABI_v1 */
@@ -225,7 +225,7 @@ static unsigned long lookup_addr(char *arg)
addr = (unsigned long)_do_fork;
else if (!strcmp(arg, "hw_break_val"))
addr = (unsigned long)&hw_break_val;
- addr = (unsigned long) dereference_function_descriptor((void *)addr);
+ addr = dereference_function_descriptor(addr);
return addr;
}
@@ -761,7 +761,7 @@ static bool __init_or_module initcall_blacklisted(initcall_t fn)
if (list_empty(&blacklisted_initcalls))
return false;
- addr = (unsigned long) dereference_function_descriptor(fn);
+ addr = dereference_function_descriptor((unsigned long)fn);
sprint_symbol_no_offset(fn_name, addr);
/*
@@ -150,7 +150,7 @@ int kernel_text_address(unsigned long addr)
int func_ptr_is_kernel_text(void *ptr)
{
unsigned long addr;
- addr = (unsigned long) dereference_function_descriptor(ptr);
+ addr = dereference_function_descriptor((unsigned long)ptr);
if (core_kernel_text(addr))
return 1;
return is_module_text_address(addr);
@@ -1067,7 +1067,7 @@ EXPORT_SYMBOL(__symbol_put);
void symbol_put_addr(void *addr)
{
struct module *modaddr;
- unsigned long a = (unsigned long)dereference_function_descriptor(addr);
+ unsigned long a = dereference_function_descriptor((unsigned long)addr);
if (core_kernel_text(a))
return;
@@ -1723,7 +1723,7 @@ char *pointer(const char *fmt, char *buf, char *end, void *ptr,
switch (*fmt) {
case 'F':
case 'f':
- ptr = dereference_function_descriptor(ptr);
+ ptr = (void *)dereference_function_descriptor((unsigned long)ptr);
/* Fallthrough */
case 'S':
case 's':
Convert dereference_function_descriptor() to accept and return `unsigned long'. There will be two new ARCH function for kernel and module function pointer dereference, which will work with `unsigned long', so the patch unifies interfaces. Besides, dereference_function_descriptor() mostly work with `unsigned long': drivers/misc/kgdbts.c: addr = (unsigned long) dereference_function_descriptor((void *)addr); init/main.c: addr = (unsigned long) dereference_function_descriptor(fn); kernel/extable.c: addr = (unsigned long) dereference_function_descriptor(ptr); kernel/module.c: unsigned long a = (unsigned long)dereference_function_descriptor(addr); Convert dereference_function_descriptor() users tree-wide. Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> --- arch/ia64/include/asm/sections.h | 6 +++--- arch/parisc/include/asm/sections.h | 2 +- arch/parisc/kernel/process.c | 6 +++--- arch/parisc/mm/init.c | 4 ++-- arch/powerpc/include/asm/sections.h | 6 +++--- drivers/misc/kgdbts.c | 2 +- init/main.c | 2 +- kernel/extable.c | 2 +- kernel/module.c | 2 +- lib/vsprintf.c | 2 +- 10 files changed, 17 insertions(+), 17 deletions(-)