Skip to content

Commit

Permalink
vsprintf: use new vsprintf symbolic function pointer format
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: Jesse Barnes <[email protected]>
Cc: Kyle McMartin <[email protected]>
Cc: "Rafael J. Wysocki" <[email protected]>
Cc: Kay Sievers <[email protected]>
Cc: Greg KH <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Bjorn Helgaas authored and torvalds committed Oct 16, 2008
1 parent 404d0ae commit c80cfb0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
9 changes: 9 additions & 0 deletions Documentation/feature-removal-schedule.txt
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,15 @@ Who: Jiri Slaby <[email protected]>

---------------------------

What: print_fn_descriptor_symbol()
When: October 2009
Why: The %pF vsprintf format provides the same functionality in a
simpler way. print_fn_descriptor_symbol() is deprecated but
still present to give out-of-tree modules time to change.
Who: Bjorn Helgaas <[email protected]>

---------------------------

What: /sys/o2cb symlink
When: January 2010
Why: /sys/fs/o2cb is the proper location for this information - /sys/o2cb
Expand Down
7 changes: 2 additions & 5 deletions drivers/base/power/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -778,10 +778,7 @@ EXPORT_SYMBOL_GPL(device_suspend);

void __suspend_report_result(const char *function, void *fn, int ret)
{
if (ret) {
printk(KERN_ERR "%s(): ", function);
print_fn_descriptor_symbol("%s returns ", fn);
printk("%d\n", ret);
}
if (ret)
printk(KERN_ERR "%s(): %pF returns %d\n", function, fn, ret);
}
EXPORT_SYMBOL_GPL(__suspend_report_result);
8 changes: 3 additions & 5 deletions include/linux/kallsyms.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,10 @@ static inline void print_symbol(const char *fmt, unsigned long addr)
}

/*
* Pretty-print a function pointer.
*
* ia64 and ppc64 function pointers are really function descriptors,
* which contain a pointer the real address.
* Pretty-print a function pointer. This function is deprecated.
* Please use the "%pF" vsprintf format instead.
*/
static inline void print_fn_descriptor_symbol(const char *fmt, void *addr)
static inline void __deprecated print_fn_descriptor_symbol(const char *fmt, void *addr)
{
#if defined(CONFIG_IA64) || defined(CONFIG_PPC64)
addr = *(void **)addr;
Expand Down

0 comments on commit c80cfb0

Please sign in to comment.