Commit 001fddf5 authored by Harvey Harrison's avatar Harvey Harrison Committed by Jason Wessel

kgdb: trivial sparse fixes in kgdb test-suite

Shadowed variable and integer as NULL pointer fixes:
drivers/misc/kgdbts.c:877:6: warning: symbol 'sys_open_test' shadows an earlier one
drivers/misc/kgdbts.c:537:27: originally declared here
drivers/misc/kgdbts.c:378:22: warning: Using plain integer as NULL pointer
drivers/misc/kgdbts.c:386:22: warning: Using plain integer as NULL pointer
drivers/misc/kgdbts.c:468:30: warning: Using plain integer as NULL pointer
drivers/misc/kgdbts.c:472:15: warning: Using plain integer as NULL pointer
drivers/misc/kgdbts.c:502:30: warning: Using plain integer as NULL pointer
drivers/misc/kgdbts.c:506:30: warning: Using plain integer as NULL pointer
drivers/misc/kgdbts.c:509:30: warning: Using plain integer as NULL pointer
drivers/misc/kgdbts.c:523:20: warning: Using plain integer as NULL pointer
drivers/misc/kgdbts.c:527:20: warning: Using plain integer as NULL pointer
drivers/misc/kgdbts.c:530:15: warning: Using plain integer as NULL pointer
drivers/misc/kgdbts.c:541:21: warning: Using plain integer as NULL pointer
drivers/misc/kgdbts.c:545:21: warning: Using plain integer as NULL pointer
drivers/misc/kgdbts.c:548:15: warning: Using plain integer as NULL pointer
drivers/misc/kgdbts.c:559:30: warning: Using plain integer as NULL pointer
drivers/misc/kgdbts.c:563:15: warning: Using plain integer as NULL pointer
drivers/misc/kgdbts.c:573:16: warning: Using plain integer as NULL pointer
drivers/misc/kgdbts.c:574:19: warning: Using plain integer as NULL pointer
drivers/misc/kgdbts.c:578:15: warning: Using plain integer as NULL pointer
drivers/misc/kgdbts.c:588:16: warning: Using plain integer as NULL pointer
drivers/misc/kgdbts.c:589:19: warning: Using plain integer as NULL pointer
drivers/misc/kgdbts.c:593:15: warning: Using plain integer as NULL pointer
drivers/misc/kgdbts.c:602:16: warning: Using plain integer as NULL pointer
drivers/misc/kgdbts.c:604:15: warning: Using plain integer as NULL pointer
drivers/misc/kgdbts.c:925:3: warning: Using plain integer as NULL pointer
drivers/misc/kgdbts.c:938:3: warning: Using plain integer as NULL pointer
Signed-off-by: default avatarHarvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: default avatarJason Wessel <jason.wessel@windriver.com>
parent f9250937
...@@ -375,7 +375,7 @@ static void emul_sstep_get(char *arg) ...@@ -375,7 +375,7 @@ static void emul_sstep_get(char *arg)
break; break;
case 1: case 1:
/* set breakpoint */ /* set breakpoint */
break_helper("Z0", 0, sstep_addr); break_helper("Z0", NULL, sstep_addr);
break; break;
case 2: case 2:
/* Continue */ /* Continue */
...@@ -383,7 +383,7 @@ static void emul_sstep_get(char *arg) ...@@ -383,7 +383,7 @@ static void emul_sstep_get(char *arg)
break; break;
case 3: case 3:
/* Clear breakpoint */ /* Clear breakpoint */
break_helper("z0", 0, sstep_addr); break_helper("z0", NULL, sstep_addr);
break; break;
default: default:
eprintk("kgdbts: ERROR failed sstep get emulation\n"); eprintk("kgdbts: ERROR failed sstep get emulation\n");
...@@ -465,11 +465,11 @@ static struct test_struct sw_breakpoint_test[] = { ...@@ -465,11 +465,11 @@ static struct test_struct sw_breakpoint_test[] = {
{ "?", "S0*" }, /* Clear break points */ { "?", "S0*" }, /* Clear break points */
{ "kgdbts_break_test", "OK", sw_break, }, /* set sw breakpoint */ { "kgdbts_break_test", "OK", sw_break, }, /* set sw breakpoint */
{ "c", "T0*", }, /* Continue */ { "c", "T0*", }, /* Continue */
{ "g", "kgdbts_break_test", 0, check_and_rewind_pc }, { "g", "kgdbts_break_test", NULL, check_and_rewind_pc },
{ "write", "OK", write_regs }, { "write", "OK", write_regs },
{ "kgdbts_break_test", "OK", sw_rem_break }, /*remove breakpoint */ { "kgdbts_break_test", "OK", sw_rem_break }, /*remove breakpoint */
{ "D", "OK" }, /* Detach */ { "D", "OK" }, /* Detach */
{ "D", "OK", 0, got_break }, /* If the test worked we made it here */ { "D", "OK", NULL, got_break }, /* On success we made it here */
{ "", "" }, { "", "" },
}; };
...@@ -499,14 +499,14 @@ static struct test_struct singlestep_break_test[] = { ...@@ -499,14 +499,14 @@ static struct test_struct singlestep_break_test[] = {
{ "?", "S0*" }, /* Clear break points */ { "?", "S0*" }, /* Clear break points */
{ "kgdbts_break_test", "OK", sw_break, }, /* set sw breakpoint */ { "kgdbts_break_test", "OK", sw_break, }, /* set sw breakpoint */
{ "c", "T0*", }, /* Continue */ { "c", "T0*", }, /* Continue */
{ "g", "kgdbts_break_test", 0, check_and_rewind_pc }, { "g", "kgdbts_break_test", NULL, check_and_rewind_pc },
{ "write", "OK", write_regs }, /* Write registers */ { "write", "OK", write_regs }, /* Write registers */
{ "kgdbts_break_test", "OK", sw_rem_break }, /*remove breakpoint */ { "kgdbts_break_test", "OK", sw_rem_break }, /*remove breakpoint */
{ "s", "T0*", emul_sstep_get, emul_sstep_put }, /* Single step */ { "s", "T0*", emul_sstep_get, emul_sstep_put }, /* Single step */
{ "g", "kgdbts_break_test", 0, check_single_step }, { "g", "kgdbts_break_test", NULL, check_single_step },
{ "kgdbts_break_test", "OK", sw_break, }, /* set sw breakpoint */ { "kgdbts_break_test", "OK", sw_break, }, /* set sw breakpoint */
{ "c", "T0*", }, /* Continue */ { "c", "T0*", }, /* Continue */
{ "g", "kgdbts_break_test", 0, check_and_rewind_pc }, { "g", "kgdbts_break_test", NULL, check_and_rewind_pc },
{ "write", "OK", write_regs }, /* Write registers */ { "write", "OK", write_regs }, /* Write registers */
{ "D", "OK" }, /* Remove all breakpoints and continues */ { "D", "OK" }, /* Remove all breakpoints and continues */
{ "", "" }, { "", "" },
...@@ -520,14 +520,14 @@ static struct test_struct do_fork_test[] = { ...@@ -520,14 +520,14 @@ static struct test_struct do_fork_test[] = {
{ "?", "S0*" }, /* Clear break points */ { "?", "S0*" }, /* Clear break points */
{ "do_fork", "OK", sw_break, }, /* set sw breakpoint */ { "do_fork", "OK", sw_break, }, /* set sw breakpoint */
{ "c", "T0*", }, /* Continue */ { "c", "T0*", }, /* Continue */
{ "g", "do_fork", 0, check_and_rewind_pc }, /* check location */ { "g", "do_fork", NULL, check_and_rewind_pc }, /* check location */
{ "write", "OK", write_regs }, /* Write registers */ { "write", "OK", write_regs }, /* Write registers */
{ "do_fork", "OK", sw_rem_break }, /*remove breakpoint */ { "do_fork", "OK", sw_rem_break }, /*remove breakpoint */
{ "s", "T0*", emul_sstep_get, emul_sstep_put }, /* Single step */ { "s", "T0*", emul_sstep_get, emul_sstep_put }, /* Single step */
{ "g", "do_fork", 0, check_single_step }, { "g", "do_fork", NULL, check_single_step },
{ "do_fork", "OK", sw_break, }, /* set sw breakpoint */ { "do_fork", "OK", sw_break, }, /* set sw breakpoint */
{ "7", "T0*", skip_back_repeat_test }, /* Loop based on repeat_test */ { "7", "T0*", skip_back_repeat_test }, /* Loop based on repeat_test */
{ "D", "OK", 0, final_ack_set }, /* detach and unregister I/O */ { "D", "OK", NULL, final_ack_set }, /* detach and unregister I/O */
{ "", "" }, { "", "" },
}; };
...@@ -538,14 +538,14 @@ static struct test_struct sys_open_test[] = { ...@@ -538,14 +538,14 @@ static struct test_struct sys_open_test[] = {
{ "?", "S0*" }, /* Clear break points */ { "?", "S0*" }, /* Clear break points */
{ "sys_open", "OK", sw_break, }, /* set sw breakpoint */ { "sys_open", "OK", sw_break, }, /* set sw breakpoint */
{ "c", "T0*", }, /* Continue */ { "c", "T0*", }, /* Continue */
{ "g", "sys_open", 0, check_and_rewind_pc }, /* check location */ { "g", "sys_open", NULL, check_and_rewind_pc }, /* check location */
{ "write", "OK", write_regs }, /* Write registers */ { "write", "OK", write_regs }, /* Write registers */
{ "sys_open", "OK", sw_rem_break }, /*remove breakpoint */ { "sys_open", "OK", sw_rem_break }, /*remove breakpoint */
{ "s", "T0*", emul_sstep_get, emul_sstep_put }, /* Single step */ { "s", "T0*", emul_sstep_get, emul_sstep_put }, /* Single step */
{ "g", "sys_open", 0, check_single_step }, { "g", "sys_open", NULL, check_single_step },
{ "sys_open", "OK", sw_break, }, /* set sw breakpoint */ { "sys_open", "OK", sw_break, }, /* set sw breakpoint */
{ "7", "T0*", skip_back_repeat_test }, /* Loop based on repeat_test */ { "7", "T0*", skip_back_repeat_test }, /* Loop based on repeat_test */
{ "D", "OK", 0, final_ack_set }, /* detach and unregister I/O */ { "D", "OK", NULL, final_ack_set }, /* detach and unregister I/O */
{ "", "" }, { "", "" },
}; };
...@@ -556,11 +556,11 @@ static struct test_struct hw_breakpoint_test[] = { ...@@ -556,11 +556,11 @@ static struct test_struct hw_breakpoint_test[] = {
{ "?", "S0*" }, /* Clear break points */ { "?", "S0*" }, /* Clear break points */
{ "kgdbts_break_test", "OK", hw_break, }, /* set hw breakpoint */ { "kgdbts_break_test", "OK", hw_break, }, /* set hw breakpoint */
{ "c", "T0*", }, /* Continue */ { "c", "T0*", }, /* Continue */
{ "g", "kgdbts_break_test", 0, check_and_rewind_pc }, { "g", "kgdbts_break_test", NULL, check_and_rewind_pc },
{ "write", "OK", write_regs }, { "write", "OK", write_regs },
{ "kgdbts_break_test", "OK", hw_rem_break }, /*remove breakpoint */ { "kgdbts_break_test", "OK", hw_rem_break }, /*remove breakpoint */
{ "D", "OK" }, /* Detach */ { "D", "OK" }, /* Detach */
{ "D", "OK", 0, got_break }, /* If the test worked we made it here */ { "D", "OK", NULL, got_break }, /* On success we made it here */
{ "", "" }, { "", "" },
}; };
...@@ -570,12 +570,12 @@ static struct test_struct hw_breakpoint_test[] = { ...@@ -570,12 +570,12 @@ static struct test_struct hw_breakpoint_test[] = {
static struct test_struct hw_write_break_test[] = { static struct test_struct hw_write_break_test[] = {
{ "?", "S0*" }, /* Clear break points */ { "?", "S0*" }, /* Clear break points */
{ "hw_break_val", "OK", hw_write_break, }, /* set hw breakpoint */ { "hw_break_val", "OK", hw_write_break, }, /* set hw breakpoint */
{ "c", "T0*", 0, got_break }, /* Continue */ { "c", "T0*", NULL, got_break }, /* Continue */
{ "g", "silent", 0, check_and_rewind_pc }, { "g", "silent", NULL, check_and_rewind_pc },
{ "write", "OK", write_regs }, { "write", "OK", write_regs },
{ "hw_break_val", "OK", hw_rem_write_break }, /*remove breakpoint */ { "hw_break_val", "OK", hw_rem_write_break }, /*remove breakpoint */
{ "D", "OK" }, /* Detach */ { "D", "OK" }, /* Detach */
{ "D", "OK", 0, got_break }, /* If the test worked we made it here */ { "D", "OK", NULL, got_break }, /* On success we made it here */
{ "", "" }, { "", "" },
}; };
...@@ -585,12 +585,12 @@ static struct test_struct hw_write_break_test[] = { ...@@ -585,12 +585,12 @@ static struct test_struct hw_write_break_test[] = {
static struct test_struct hw_access_break_test[] = { static struct test_struct hw_access_break_test[] = {
{ "?", "S0*" }, /* Clear break points */ { "?", "S0*" }, /* Clear break points */
{ "hw_break_val", "OK", hw_access_break, }, /* set hw breakpoint */ { "hw_break_val", "OK", hw_access_break, }, /* set hw breakpoint */
{ "c", "T0*", 0, got_break }, /* Continue */ { "c", "T0*", NULL, got_break }, /* Continue */
{ "g", "silent", 0, check_and_rewind_pc }, { "g", "silent", NULL, check_and_rewind_pc },
{ "write", "OK", write_regs }, { "write", "OK", write_regs },
{ "hw_break_val", "OK", hw_rem_access_break }, /*remove breakpoint */ { "hw_break_val", "OK", hw_rem_access_break }, /*remove breakpoint */
{ "D", "OK" }, /* Detach */ { "D", "OK" }, /* Detach */
{ "D", "OK", 0, got_break }, /* If the test worked we made it here */ { "D", "OK", NULL, got_break }, /* On success we made it here */
{ "", "" }, { "", "" },
}; };
...@@ -599,9 +599,9 @@ static struct test_struct hw_access_break_test[] = { ...@@ -599,9 +599,9 @@ static struct test_struct hw_access_break_test[] = {
*/ */
static struct test_struct nmi_sleep_test[] = { static struct test_struct nmi_sleep_test[] = {
{ "?", "S0*" }, /* Clear break points */ { "?", "S0*" }, /* Clear break points */
{ "c", "T0*", 0, got_break }, /* Continue */ { "c", "T0*", NULL, got_break }, /* Continue */
{ "D", "OK" }, /* Detach */ { "D", "OK" }, /* Detach */
{ "D", "OK", 0, got_break }, /* If the test worked we made it here */ { "D", "OK", NULL, got_break }, /* On success we made it here */
{ "", "" }, { "", "" },
}; };
...@@ -874,15 +874,15 @@ static void kgdbts_run_tests(void) ...@@ -874,15 +874,15 @@ static void kgdbts_run_tests(void)
{ {
char *ptr; char *ptr;
int fork_test = 0; int fork_test = 0;
int sys_open_test = 0; int do_sys_open_test = 0;
int nmi_sleep = 0; int nmi_sleep = 0;
ptr = strstr(config, "F"); ptr = strstr(config, "F");
if (ptr) if (ptr)
fork_test = simple_strtol(ptr+1, NULL, 10); fork_test = simple_strtol(ptr + 1, NULL, 10);
ptr = strstr(config, "S"); ptr = strstr(config, "S");
if (ptr) if (ptr)
sys_open_test = simple_strtol(ptr+1, NULL, 10); do_sys_open_test = simple_strtol(ptr + 1, NULL, 10);
ptr = strstr(config, "N"); ptr = strstr(config, "N");
if (ptr) if (ptr)
nmi_sleep = simple_strtol(ptr+1, NULL, 10); nmi_sleep = simple_strtol(ptr+1, NULL, 10);
...@@ -922,7 +922,7 @@ static void kgdbts_run_tests(void) ...@@ -922,7 +922,7 @@ static void kgdbts_run_tests(void)
repeat_test = fork_test; repeat_test = fork_test;
printk(KERN_INFO "kgdbts:RUN do_fork for %i breakpoints\n", printk(KERN_INFO "kgdbts:RUN do_fork for %i breakpoints\n",
repeat_test); repeat_test);
kthread_run(kgdbts_unreg_thread, 0, "kgdbts_unreg"); kthread_run(kgdbts_unreg_thread, NULL, "kgdbts_unreg");
run_do_fork_test(); run_do_fork_test();
return; return;
} }
...@@ -931,11 +931,11 @@ static void kgdbts_run_tests(void) ...@@ -931,11 +931,11 @@ static void kgdbts_run_tests(void)
* executed because a kernel thread will be spawned at the very * executed because a kernel thread will be spawned at the very
* end to unregister the debug hooks. * end to unregister the debug hooks.
*/ */
if (sys_open_test) { if (do_sys_open_test) {
repeat_test = sys_open_test; repeat_test = do_sys_open_test;
printk(KERN_INFO "kgdbts:RUN sys_open for %i breakpoints\n", printk(KERN_INFO "kgdbts:RUN sys_open for %i breakpoints\n",
repeat_test); repeat_test);
kthread_run(kgdbts_unreg_thread, 0, "kgdbts_unreg"); kthread_run(kgdbts_unreg_thread, NULL, "kgdbts_unreg");
run_sys_open_test(); run_sys_open_test();
return; return;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment