Skip to content

Commit c80cfb0

Browse files
Bjorn Helgaastorvalds
authored andcommitted
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>
1 parent 404d0ae commit c80cfb0

3 files changed

Lines changed: 14 additions & 10 deletions

File tree

‎Documentation/feature-removal-schedule.txt‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,15 @@ Who: Jiri Slaby <jirislaby@gmail.com>
294294

295295
---------------------------
296296

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+
297306
What: /sys/o2cb symlink
298307
When: January 2010
299308
Why: /sys/fs/o2cb is the proper location for this information - /sys/o2cb

‎drivers/base/power/main.c‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -778,10 +778,7 @@ EXPORT_SYMBOL_GPL(device_suspend);
778778

779779
void __suspend_report_result(const char *function, void *fn, int ret)
780780
{
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);
786783
}
787784
EXPORT_SYMBOL_GPL(__suspend_report_result);

‎include/linux/kallsyms.h‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,10 @@ static inline void print_symbol(const char *fmt, unsigned long addr)
9393
}
9494

9595
/*
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.
10098
*/
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)
102100
{
103101
#if defined(CONFIG_IA64) || defined(CONFIG_PPC64)
104102
addr = *(void **)addr;

0 commit comments

Comments
 (0)