Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jwessel/linux-2.6-kgdb

* '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

+6 -6
+2 -2
arch/x86/kernel/kgdb.c
··· 121 memcpy(mem, (void *)regs + dbg_reg_def[regno].offset, 122 dbg_reg_def[regno].size); 123 124 - switch (regno) { 125 #ifdef CONFIG_X86_32 126 case GDB_SS: 127 if (!user_mode_vm(regs)) 128 *(unsigned long *)mem = __KERNEL_DS; ··· 135 case GDB_FS: 136 *(unsigned long *)mem = 0xFFFF; 137 break; 138 - #endif 139 } 140 return dbg_reg_def[regno].name; 141 } 142
··· 121 memcpy(mem, (void *)regs + dbg_reg_def[regno].offset, 122 dbg_reg_def[regno].size); 123 124 #ifdef CONFIG_X86_32 125 + switch (regno) { 126 case GDB_SS: 127 if (!user_mode_vm(regs)) 128 *(unsigned long *)mem = __KERNEL_DS; ··· 135 case GDB_FS: 136 *(unsigned long *)mem = 0xFFFF; 137 break; 138 } 139 + #endif 140 return dbg_reg_def[regno].name; 141 } 142
+1 -1
drivers/misc/kgdbts.c
··· 988 989 static int kgdbts_option_setup(char *opt) 990 { 991 - if (strlen(opt) > MAX_CONFIG_LEN) { 992 printk(KERN_ERR "kgdbts: config string too long\n"); 993 return -ENOSPC; 994 }
··· 988 989 static int kgdbts_option_setup(char *opt) 990 { 991 + if (strlen(opt) >= MAX_CONFIG_LEN) { 992 printk(KERN_ERR "kgdbts: config string too long\n"); 993 return -ENOSPC; 994 }
+1 -1
drivers/tty/serial/kgdboc.c
··· 131 132 static int kgdboc_option_setup(char *opt) 133 { 134 - if (strlen(opt) > MAX_CONFIG_LEN) { 135 printk(KERN_ERR "kgdboc: config string too long\n"); 136 return -ENOSPC; 137 }
··· 131 132 static int kgdboc_option_setup(char *opt) 133 { 134 + if (strlen(opt) >= MAX_CONFIG_LEN) { 135 printk(KERN_ERR "kgdboc: config string too long\n"); 136 return -ENOSPC; 137 }
+2 -2
kernel/debug/kdb/kdb_main.c
··· 78 static kdbtab_t *kdb_commands; 79 #define KDB_BASE_CMD_MAX 50 80 static int kdb_max_commands = KDB_BASE_CMD_MAX; 81 - static kdbtab_t kdb_base_commands[50]; 82 #define for_each_kdbcmd(cmd, num) \ 83 for ((cmd) = kdb_base_commands, (num) = 0; \ 84 num < kdb_max_commands; \ ··· 2892 "Send a signal to a process", 0, KDB_REPEAT_NONE); 2893 kdb_register_repeat("summary", kdb_summary, "", 2894 "Summarize the system", 4, KDB_REPEAT_NONE); 2895 - kdb_register_repeat("per_cpu", kdb_per_cpu, "", 2896 "Display per_cpu variables", 3, KDB_REPEAT_NONE); 2897 kdb_register_repeat("grephelp", kdb_grep_help, "", 2898 "Display help on | grep", 0, KDB_REPEAT_NONE);
··· 78 static kdbtab_t *kdb_commands; 79 #define KDB_BASE_CMD_MAX 50 80 static int kdb_max_commands = KDB_BASE_CMD_MAX; 81 + static kdbtab_t kdb_base_commands[KDB_BASE_CMD_MAX]; 82 #define for_each_kdbcmd(cmd, num) \ 83 for ((cmd) = kdb_base_commands, (num) = 0; \ 84 num < kdb_max_commands; \ ··· 2892 "Send a signal to a process", 0, KDB_REPEAT_NONE); 2893 kdb_register_repeat("summary", kdb_summary, "", 2894 "Summarize the system", 4, KDB_REPEAT_NONE); 2895 + kdb_register_repeat("per_cpu", kdb_per_cpu, "<sym> [<bytes>] [<cpu>]", 2896 "Display per_cpu variables", 3, KDB_REPEAT_NONE); 2897 kdb_register_repeat("grephelp", kdb_grep_help, "", 2898 "Display help on | grep", 0, KDB_REPEAT_NONE);