Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

vsprintf: use new vsprintf symbolic function pointer format

Use the '%pF' format to get rid of an "#ifdef DEBUG" and make some printks
atomic.

This removes the last in-tree uses of print_fn_descriptor_symbol(). I
marked print_fn_descriptor_symbol() deprecated and scheduled it for
removal next year to give time for out-of-tree modules to be updated.

parisc's print_fn_descriptor_symbol() is currently broken there (it needs
to dereference the function pointer similar to ia64 and power). This
patch shouldn't make anything worse, but it means we need to fix
dereference_function_descriptor() instead of print_fn_descriptor_symbol()
to get meaningful initcall_debug output.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Cc: Kyle McMartin <kyle@mcmartin.ca>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Bjorn Helgaas and committed by
Linus Torvalds
c80cfb04 404d0ae2

+14 -10
+9
Documentation/feature-removal-schedule.txt
··· 294 294 295 295 --------------------------- 296 296 297 + What: print_fn_descriptor_symbol() 298 + When: October 2009 299 + Why: The %pF vsprintf format provides the same functionality in a 300 + simpler way. print_fn_descriptor_symbol() is deprecated but 301 + still present to give out-of-tree modules time to change. 302 + Who: Bjorn Helgaas <bjorn.helgaas@hp.com> 303 + 304 + --------------------------- 305 + 297 306 What: /sys/o2cb symlink 298 307 When: January 2010 299 308 Why: /sys/fs/o2cb is the proper location for this information - /sys/o2cb
+2 -5
drivers/base/power/main.c
··· 778 778 779 779 void __suspend_report_result(const char *function, void *fn, int ret) 780 780 { 781 - if (ret) { 782 - printk(KERN_ERR "%s(): ", function); 783 - print_fn_descriptor_symbol("%s returns ", fn); 784 - printk("%d\n", ret); 785 - } 781 + if (ret) 782 + printk(KERN_ERR "%s(): %pF returns %d\n", function, fn, ret); 786 783 } 787 784 EXPORT_SYMBOL_GPL(__suspend_report_result);
+3 -5
include/linux/kallsyms.h
··· 93 93 } 94 94 95 95 /* 96 - * Pretty-print a function pointer. 97 - * 98 - * ia64 and ppc64 function pointers are really function descriptors, 99 - * which contain a pointer the real address. 96 + * Pretty-print a function pointer. This function is deprecated. 97 + * Please use the "%pF" vsprintf format instead. 100 98 */ 101 - static inline void print_fn_descriptor_symbol(const char *fmt, void *addr) 99 + static inline void __deprecated print_fn_descriptor_symbol(const char *fmt, void *addr) 102 100 { 103 101 #if defined(CONFIG_IA64) || defined(CONFIG_PPC64) 104 102 addr = *(void **)addr;