Skip to content

Commit

Permalink
kallsyms: unify 32- and 64-bit code
Browse files Browse the repository at this point in the history
Use the %p format string which already accounts for the padding you need
with a pointer type on a particular architecture.

Also replace the macro with a static inline function to match the rest of
the file.

Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Arjan van de Ven <arjan@infradead.org>
Signed-off-by: Vegard Nossum <vegard.nossum@gmail.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Vegard Nossum authored and Linus Torvalds committed Jul 25, 2008
1 parent 924d9ad commit 2711b79
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions include/linux/kallsyms.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#define _LINUX_KALLSYMS_H

#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/stddef.h>

#define KSYM_NAME_LEN 128
Expand Down Expand Up @@ -105,18 +106,10 @@ static inline void print_fn_descriptor_symbol(const char *fmt, void *addr)
print_symbol(fmt, (unsigned long)addr);
}

#ifndef CONFIG_64BIT
#define print_ip_sym(ip) \
do { \
printk("[<%08lx>]", ip); \
print_symbol(" %s\n", ip); \
} while(0)
#else
#define print_ip_sym(ip) \
do { \
printk("[<%016lx>]", ip); \
print_symbol(" %s\n", ip); \
} while(0)
#endif
static inline void print_ip_sym(unsigned long ip)
{
printk("[<%p>]", (void *) ip);
print_symbol(" %s\n", ip);
}

#endif /*_LINUX_KALLSYMS_H*/

0 comments on commit 2711b79

Please sign in to comment.