{
if (ret) {
printk(KERN_ERR "%s(): ", function);
- print_fn_descriptor_symbol("%s() returns ", (unsigned long)fn);
+ print_fn_descriptor_symbol("%s returns ", fn);
printk("%d\n", ret);
}
}
(f->device == dev->device || f->device == (u16) PCI_ANY_ID)) {
#ifdef DEBUG
dev_dbg(&dev->dev, "calling ");
- print_fn_descriptor_symbol("%s()\n",
- (unsigned long) f->hook);
+ print_fn_descriptor_symbol("%s\n", f->hook);
#endif
f->hook(dev);
}
continue;
#ifdef DEBUG
dev_dbg(&dev->dev, "%s: calling ", f->id);
- print_fn_descriptor_symbol("%s\n",
- (unsigned long) f->quirk_function);
+ print_fn_descriptor_symbol("%s\n", f->quirk_function);
#endif
f->quirk_function(dev);
}
static inline void __check_printsym_format(const char *fmt, ...)
{
}
-/* ia64 and ppc64 use function descriptors, which contain the real address */
-#if defined(CONFIG_IA64) || defined(CONFIG_PPC64)
-#define print_fn_descriptor_symbol(fmt, addr) \
-do { \
- unsigned long *__faddr = (unsigned long*) addr; \
- print_symbol(fmt, __faddr[0]); \
-} while (0)
-#else
-#define print_fn_descriptor_symbol(fmt, addr) print_symbol(fmt, addr)
-#endif
static inline void print_symbol(const char *fmt, unsigned long addr)
{
__builtin_extract_return_addr((void *)addr));
}
+/*
+ * Pretty-print a function pointer.
+ *
+ * ia64 and ppc64 function pointers are really function descriptors,
+ * which contain a pointer the real address.
+ */
+static inline void print_fn_descriptor_symbol(const char *fmt, void *addr)
+{
+#if defined(CONFIG_IA64) || defined(CONFIG_PPC64)
+ addr = *(void **)addr;
+#endif
+ print_symbol(fmt, (unsigned long)addr);
+}
+
#ifndef CONFIG_64BIT
#define print_ip_sym(ip) \
do { \
int result;
if (initcall_debug) {
- print_fn_descriptor_symbol("calling %s()\n",
- (unsigned long) *call);
+ print_fn_descriptor_symbol("calling %s\n", *call);
t0 = ktime_get();
}
t1 = ktime_get();
delta = ktime_sub(t1, t0);
- print_fn_descriptor_symbol("initcall %s()",
- (unsigned long) *call);
+ print_fn_descriptor_symbol("initcall %s", *call);
printk(" returned %d after %Ld msecs\n", result,
(unsigned long long) delta.tv64 >> 20);
}
local_irq_enable();
}
if (msgbuf[0]) {
- print_fn_descriptor_symbol(KERN_WARNING "initcall %s()",
- (unsigned long) *call);
+ print_fn_descriptor_symbol(KERN_WARNING "initcall %s", *call);
printk(" returned with %s\n", msgbuf);
}
}