powerpc: clean up bug.h further
authorPaul Mackerras <paulus@samba.org>
Wed, 2 Nov 2005 04:19:47 +0000 (15:19 +1100)
committerPaul Mackerras <paulus@samba.org>
Wed, 2 Nov 2005 04:19:47 +0000 (15:19 +1100)
This simplifies the macros which are different between 32-bit and
64-bit.  It also fixes a couple of printks on the bug->line element,
which is now a long.

Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/kernel/traps.c
include/asm-powerpc/bug.h

index bb0d00284a7e5335749f97dd172bd232cbde54b3..07e5ee40b8700aadc5cc82a395c7c20e088a402a 100644 (file)
@@ -749,22 +749,22 @@ static int check_bug_trap(struct pt_regs *regs)
        if (bug->line & BUG_WARNING_TRAP) {
                /* this is a WARN_ON rather than BUG/BUG_ON */
 #ifdef CONFIG_XMON
-               xmon_printf(KERN_ERR "Badness in %s at %s:%d\n",
+               xmon_printf(KERN_ERR "Badness in %s at %s:%ld\n",
                       bug->function, bug->file,
                       bug->line & ~BUG_WARNING_TRAP);
 #endif /* CONFIG_XMON */               
-               printk(KERN_ERR "Badness in %s at %s:%d\n",
+               printk(KERN_ERR "Badness in %s at %s:%ld\n",
                       bug->function, bug->file,
                       bug->line & ~BUG_WARNING_TRAP);
                dump_stack();
                return 1;
        }
 #ifdef CONFIG_XMON
-       xmon_printf(KERN_CRIT "kernel BUG in %s at %s:%d!\n",
+       xmon_printf(KERN_CRIT "kernel BUG in %s at %s:%ld!\n",
               bug->function, bug->file, bug->line);
        xmon(regs);
 #endif /* CONFIG_XMON */
-       printk(KERN_CRIT "kernel BUG in %s at %s:%d!\n",
+       printk(KERN_CRIT "kernel BUG in %s at %s:%ld!\n",
               bug->function, bug->file, bug->line);
 
        return 0;
index f49f46271ba6c83e0146ab32209acf39255c2c09..d625ee55f9571e68503cbd43d01240de1875d22b 100644 (file)
 #ifndef __ASSEMBLY__
 
 #ifdef __powerpc64__
-#define BUG_TABLE_ENTRY(label, line, file, func) \
-       ".llong " #label ", " #line ", " #file ", " #func "\n"
-#define TRAP_OP(ra, rb) "1: tdnei " #ra ", " #rb "\n"
+#define BUG_TABLE_ENTRY                ".llong"
+#define BUG_TRAP_OP            "tdnei"
 #else 
-#define BUG_TABLE_ENTRY(label, line, file, func) \
-       ".long " #label ", " #line ", " #file ", " #func "\n"
-#define TRAP_OP(ra, rb) "1: twnei " #ra ", " #rb "\n"
+#define BUG_TABLE_ENTRY                ".long"
+#define BUG_TRAP_OP            "twnei"
 #endif /* __powerpc64__ */
 
 struct bug_entry {
@@ -41,17 +39,17 @@ struct bug_entry *find_bug(unsigned long bugaddr);
 #define BUG() do {                                                      \
        __asm__ __volatile__(                                            \
                "1:     twi 31,0,0\n"                                    \
-               ".section __bug_table,\"a\"\n\t"                         \
-               BUG_TABLE_ENTRY(1b,%0,%1,%2)                             \
+               ".section __bug_table,\"a\"\n"                           \
+               "\t"BUG_TABLE_ENTRY"    1b,%0,%1,%2\n"                   \
                ".previous"                                              \
                : : "i" (__LINE__), "i" (__FILE__), "i" (__FUNCTION__)); \
 } while (0)
 
 #define BUG_ON(x) do {                                         \
        __asm__ __volatile__(                                   \
-               TRAP_OP(%0,0)                                   \
-               ".section __bug_table,\"a\"\n\t"                \
-               BUG_TABLE_ENTRY(1b,%1,%2,%3)                    \
+               "1:     "BUG_TRAP_OP"   %0,0\n"                 \
+               ".section __bug_table,\"a\"\n"                  \
+               "\t"BUG_TABLE_ENTRY"    1b,%1,%2,%3\n"          \
                ".previous"                                     \
                : : "r" ((long)(x)), "i" (__LINE__),            \
                    "i" (__FILE__), "i" (__FUNCTION__));        \
@@ -59,9 +57,9 @@ struct bug_entry *find_bug(unsigned long bugaddr);
 
 #define WARN_ON(x) do {                                                \
        __asm__ __volatile__(                                   \
-               TRAP_OP(%0,0)                                   \
-               ".section __bug_table,\"a\"\n\t"                \
-               BUG_TABLE_ENTRY(1b,%1,%2,%3)                    \
+               "1:     "BUG_TRAP_OP"   %0,0\n"                 \
+               ".section __bug_table,\"a\"\n"                  \
+               "\t"BUG_TABLE_ENTRY"    1b,%1,%2,%3\n"          \
                ".previous"                                     \
                : : "r" ((long)(x)),                            \
                    "i" (__LINE__ + BUG_WARNING_TRAP),          \