From: Mike Travis <travis@sgi.com>
Subject: KDB: Fix conflict in function prototypes between kdb.h and lkdb.h.
References: bnc#744655
Patch-mainline: N/A

Fix conflict in function prototypes between kdb.h and lkdb.h.

Update the KDB per_cpu command for sles11sp2 which does not use
the "per_cpu__" prefix.

Signed-off-by: Mike Travis <travis@sgi.com>
Acked-by: Jeff Mahoney <jeffm@suse.com>
---
 include/linux/kdb.h  |    5 +++--
 include/linux/lkdb.h |    2 +-
 kdb/kdbmain.c        |    5 ++---
 3 files changed, 6 insertions(+), 6 deletions(-)

Index: linux-3.0/include/linux/kdb.h
===================================================================
--- linux-3.0.orig/include/linux/kdb.h
+++ linux-3.0/include/linux/kdb.h
@@ -119,9 +119,10 @@ typedef enum {
 	KDB_REASON_SILENT,	/* Silent entry/exit to kdb; regs invalid - internal only */
 } kdb_reason_t;
 
-#define kdb(reason,error_code,frame) (0)
+#ifndef CONFIG_KGDB
+static inline int kdb(lkdb_reason_t, int, struct pt_regs *) { return 0; }
 
-#ifdef CONFIG_KGDB
+#else /* CONFIG_KGDB */
 extern int kdb_trap_printk;
 typedef int (*kdb_printf_t)(const char *, ...)
              __attribute__ ((format (printf, 1, 2)));
Index: linux-3.0/include/linux/lkdb.h
===================================================================
--- linux-3.0.orig/include/linux/lkdb.h
+++ linux-3.0/include/linux/lkdb.h
@@ -169,7 +169,7 @@ typedef enum {
 #ifdef CONFIG_KDB
 extern int kdb(lkdb_reason_t, int, struct pt_regs *);
 #else
-#define kdb(reason,error_code,frame) (0)
+static inline int kdb(lkdb_reason_t, int, struct pt_regs *) { return 0; }
 #endif
 
 #ifdef CONFIG_KDB
Index: linux-3.0/kdb/kdbmain.c
===================================================================
--- linux-3.0.orig/kdb/kdbmain.c
+++ linux-3.0/kdb/kdbmain.c
@@ -3713,7 +3713,7 @@ kdb_summary(int argc, const char **argv)
 static int
 kdb_per_cpu(int argc, const char **argv)
 {
-	char buf[256], fmtstr[64];
+	char fmtstr[64];
 	lkdb_symtab_t symtab;
 	cpumask_t suppress;
 	int cpu, diag;
@@ -3723,8 +3723,7 @@ kdb_per_cpu(int argc, const char **argv)
 		return LKDB_ARGCOUNT;
 
 	cpus_clear(suppress);
-	snprintf(buf, sizeof(buf), "per_cpu__%s", argv[1]);
-	if (!lkdbgetsymval(buf, &symtab)) {
+	if (!lkdbgetsymval(argv[1], &symtab)) {
 		lkdb_printf("%s is not a per_cpu variable\n", argv[1]);
 		return LKDB_BADADDR;
 	}

