2011-03-25 21:45:11

by Jason Wessel

[permalink] [raw]
Subject: [GIT PULL] kgdb/kdb tree for 2.6.39-rc1

Linus, please pull the for_linus branch to pick up the minor clean ups
for kgdb for 2.6.39.

git://git.kernel.org/pub/scm/linux/kernel/git/jwessel/linux-2.6-kgdb.git for_linus

Thanks,
Jason.

---
The following changes since commit 4bbba111d94781d34081c37856bbc5eb33f6c72a:

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6 (2011-03-23 07:58:09 -0700)

are available in the git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/jwessel/linux-2.6-kgdb.git for_linus

Dan Carpenter (1):
kgdboc,kgdbts: strlen() doesn't count the terminator

Jason Wessel (1):
kgdb,x86_64: fix compile warning found with sparse

Jovi Zhang (1):
kdb: code cleanup to use macro instead of value

Namhyung Kim (1):
kdb: add usage string of 'per_cpu' command

arch/x86/kernel/kgdb.c | 4 ++--
drivers/misc/kgdbts.c | 2 +-
drivers/tty/serial/kgdboc.c | 2 +-
kernel/debug/kdb/kdb_main.c | 4 ++--
4 files changed, 6 insertions(+), 6 deletions(-)


2011-03-25 21:45:03

by Jason Wessel

[permalink] [raw]
Subject: [PATCH 1/4] kgdboc,kgdbts: strlen() doesn't count the terminator

From: Dan Carpenter <[email protected]>

This is an off by one because strlen() doesn't count the null
terminator. We strcpy() these strings into an array of size
MAX_CONFIG_LEN.

Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: Jason Wessel <[email protected]>
---
drivers/misc/kgdbts.c | 2 +-
drivers/tty/serial/kgdboc.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/misc/kgdbts.c b/drivers/misc/kgdbts.c
index 59c118c..27dc463 100644
--- a/drivers/misc/kgdbts.c
+++ b/drivers/misc/kgdbts.c
@@ -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;
}
diff --git a/drivers/tty/serial/kgdboc.c b/drivers/tty/serial/kgdboc.c
index 25a8bc5..87e7e6c 100644
--- a/drivers/tty/serial/kgdboc.c
+++ b/drivers/tty/serial/kgdboc.c
@@ -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;
}
--
1.7.1

2011-03-25 21:45:10

by Jason Wessel

[permalink] [raw]
Subject: [PATCH 2/4] kdb: code cleanup to use macro instead of value

From: Jovi Zhang <[email protected]>

It's better to use macro KDB_BASE_CMD_MAX instead of 50

Signed-off-by: Jovi Zhang <[email protected]>
Signed-off-by: Jason Wessel <[email protected]>
---
kernel/debug/kdb/kdb_main.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/debug/kdb/kdb_main.c b/kernel/debug/kdb/kdb_main.c
index bd3e8e2..38a8542 100644
--- a/kernel/debug/kdb/kdb_main.c
+++ b/kernel/debug/kdb/kdb_main.c
@@ -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; \
--
1.7.1

2011-03-25 21:45:08

by Jason Wessel

[permalink] [raw]
Subject: [PATCH 4/4] kdb: add usage string of 'per_cpu' command

From: Namhyung Kim <[email protected]>

Signed-off-by: Namhyung Kim <[email protected]>
Signed-off-by: Jason Wessel <[email protected]>
---
kernel/debug/kdb/kdb_main.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/debug/kdb/kdb_main.c b/kernel/debug/kdb/kdb_main.c
index 38a8542..6bc6e3b 100644
--- a/kernel/debug/kdb/kdb_main.c
+++ b/kernel/debug/kdb/kdb_main.c
@@ -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);
--
1.7.1

2011-03-25 21:46:01

by Jason Wessel

[permalink] [raw]
Subject: [PATCH 3/4] kgdb,x86_64: fix compile warning found with sparse

Fix sparse warning:

arch/x86/kernel/kgdb.c:123:9: warning: switch with no cases

Reported-by: Namhyung Kim <[email protected]>
Signed-off-by: Jason Wessel <[email protected]>
---
arch/x86/kernel/kgdb.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/kgdb.c b/arch/x86/kernel/kgdb.c
index a413000..3c2fb0f 100644
--- a/arch/x86/kernel/kgdb.c
+++ b/arch/x86/kernel/kgdb.c
@@ -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;
}

--
1.7.1