Commit 95e14ed7fc4b2db62eb597a70850a0fede48b78a

Authored by Linus Torvalds

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

Showing 4 changed files Side-by-side Diff

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