Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jwessel...
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 26 Mar 2011 04:04:56 +0000 (21:04 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 26 Mar 2011 04:04:56 +0000 (21:04 -0700)
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jwessel/linux-2.6-kgdb:
  kdb: add usage string of 'per_cpu' command
  kgdb,x86_64: fix compile warning found with sparse
  kdb: code cleanup to use macro instead of value
  kgdboc,kgdbts: strlen() doesn't count the terminator

arch/x86/kernel/kgdb.c
drivers/misc/kgdbts.c
drivers/tty/serial/kgdboc.c
kernel/debug/kdb/kdb_main.c

index dba0b36941a51b6e9d85be0d5011b8f309e19369..5f9ecff328b5f9604eb4d053e21b19c7d2618c88 100644 (file)
@@ -121,8 +121,8 @@ char *dbg_get_reg(int regno, void *mem, struct pt_regs *regs)
                memcpy(mem, (void *)regs + dbg_reg_def[regno].offset,
                       dbg_reg_def[regno].size);
 
-       switch (regno) {
 #ifdef CONFIG_X86_32
+       switch (regno) {
        case GDB_SS:
                if (!user_mode_vm(regs))
                        *(unsigned long *)mem = __KERNEL_DS;
@@ -135,8 +135,8 @@ char *dbg_get_reg(int regno, void *mem, struct pt_regs *regs)
        case GDB_FS:
                *(unsigned long *)mem = 0xFFFF;
                break;
-#endif
        }
+#endif
        return dbg_reg_def[regno].name;
 }
 
index 59c118c19a910e9950a04a069dacf62352a25e9a..27dc463097f37c5e75a3f5859e8f82c65193f81f 100644 (file)
@@ -988,7 +988,7 @@ static void kgdbts_run_tests(void)
 
 static int kgdbts_option_setup(char *opt)
 {
-       if (strlen(opt) > MAX_CONFIG_LEN) {
+       if (strlen(opt) >= MAX_CONFIG_LEN) {
                printk(KERN_ERR "kgdbts: config string too long\n");
                return -ENOSPC;
        }
index 25a8bc565f400b62c155dd31bb39ff08e8d85dd0..87e7e6c876d4b857aacea79feab04bf3c5d04953 100644 (file)
@@ -131,7 +131,7 @@ static void kgdboc_unregister_kbd(void)
 
 static int kgdboc_option_setup(char *opt)
 {
-       if (strlen(opt) > MAX_CONFIG_LEN) {
+       if (strlen(opt) >= MAX_CONFIG_LEN) {
                printk(KERN_ERR "kgdboc: config string too long\n");
                return -ENOSPC;
        }
index bd3e8e29caa37e3861a6832fd0614a0bd6d5dab4..6bc6e3bc4f9c309b72a34b70718ac10cd3d14d83 100644 (file)
@@ -78,7 +78,7 @@ static unsigned int kdb_continue_catastrophic;
 static kdbtab_t *kdb_commands;
 #define KDB_BASE_CMD_MAX 50
 static int kdb_max_commands = KDB_BASE_CMD_MAX;
-static kdbtab_t kdb_base_commands[50];
+static kdbtab_t kdb_base_commands[KDB_BASE_CMD_MAX];
 #define for_each_kdbcmd(cmd, num)                                      \
        for ((cmd) = kdb_base_commands, (num) = 0;                      \
             num < kdb_max_commands;                                    \
@@ -2892,7 +2892,7 @@ static void __init kdb_inittab(void)
          "Send a signal to a process", 0, KDB_REPEAT_NONE);
        kdb_register_repeat("summary", kdb_summary, "",
          "Summarize the system", 4, KDB_REPEAT_NONE);
-       kdb_register_repeat("per_cpu", kdb_per_cpu, "",
+       kdb_register_repeat("per_cpu", kdb_per_cpu, "<sym> [<bytes>] [<cpu>]",
          "Display per_cpu variables", 3, KDB_REPEAT_NONE);
        kdb_register_repeat("grephelp", kdb_grep_help, "",
          "Display help on | grep", 0, KDB_REPEAT_NONE);