diff options
author | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-09-03 21:43:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-09-09 14:51:15 -0400 |
commit | deac93df26b20cf8438339b5935b5f5643bc30c9 (patch) | |
tree | 8e67edd505e4a8bde380c724b67ce9ca98b8ee91 /lib/vsprintf.c | |
parent | 7ae115b4f50d3c5824f1a15e572b5de9d1b06d35 (diff) |
lib: Correct printk %pF to work on all architectures
It was introduced by "vsprintf: add support for '%pS' and '%pF' pointer
formats" in commit 0fe1ef24f7bd0020f29ffe287dfdb9ead33ca0b2. However,
the current way its coded doesn't work on parisc64. For two reasons: 1)
parisc isn't in the #ifdef and 2) parisc has a different format for
function descriptors
Make dereference_function_descriptor() more accommodating by allowing
architecture overrides. I put the three overrides (for parisc64, ppc64
and ia64) in arch/kernel/module.c because that's where the kernel
internal linker which knows how to deal with function descriptors sits.
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Tony Luck <tony.luck@intel.com>
Acked-by: Kyle McMartin <kyle@mcmartin.ca>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'lib/vsprintf.c')
-rw-r--r-- | lib/vsprintf.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/lib/vsprintf.c b/lib/vsprintf.c index d8d1d1142248..c399bc1093cb 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c | |||
@@ -27,6 +27,7 @@ | |||
27 | 27 | ||
28 | #include <asm/page.h> /* for PAGE_SIZE */ | 28 | #include <asm/page.h> /* for PAGE_SIZE */ |
29 | #include <asm/div64.h> | 29 | #include <asm/div64.h> |
30 | #include <asm/sections.h> /* for dereference_function_descriptor() */ | ||
30 | 31 | ||
31 | /* Works only for digits and letters, but small and fast */ | 32 | /* Works only for digits and letters, but small and fast */ |
32 | #define TOLOWER(x) ((x) | 0x20) | 33 | #define TOLOWER(x) ((x) | 0x20) |
@@ -513,16 +514,6 @@ static char *string(char *buf, char *end, char *s, int field_width, int precisio | |||
513 | return buf; | 514 | return buf; |
514 | } | 515 | } |
515 | 516 | ||
516 | static inline void *dereference_function_descriptor(void *ptr) | ||
517 | { | ||
518 | #if defined(CONFIG_IA64) || defined(CONFIG_PPC64) | ||
519 | void *p; | ||
520 | if (!probe_kernel_address(ptr, p)) | ||
521 | ptr = p; | ||
522 | #endif | ||
523 | return ptr; | ||
524 | } | ||
525 | |||
526 | static char *symbol_string(char *buf, char *end, void *ptr, int field_width, int precision, int flags) | 517 | static char *symbol_string(char *buf, char *end, void *ptr, int field_width, int precision, int flags) |
527 | { | 518 | { |
528 | unsigned long value = (unsigned long) ptr; | 519 | unsigned long value = (unsigned long) ptr; |