Skip to content

Commit

Permalink
kdb: Remove unused "argcount" param from kdb_bt1(); make btaprompt bool
Browse files Browse the repository at this point in the history
The kdb_bt1() had a mysterious "argcount" parameter passed in (always
the number 5, by the way) and never used.  Presumably this is just old
cruft.  Remove it.  While at it, upgrade the btaprompt parameter to a
full fledged bool instead of an int.

Signed-off-by: Douglas Anderson <dianders@chromium.org>
Acked-by: Will Deacon <will@kernel.org>
Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
  • Loading branch information
Douglas Anderson authored and Daniel Thompson committed Oct 10, 2019
1 parent 0f8b5b6 commit 54af3e3
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions kernel/debug/kdb/kdb_bt.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ static void kdb_show_stack(struct task_struct *p, void *addr)
*/

static int
kdb_bt1(struct task_struct *p, unsigned long mask,
int argcount, int btaprompt)
kdb_bt1(struct task_struct *p, unsigned long mask, bool btaprompt)
{
char buffer[2];
if (kdb_getarea(buffer[0], (unsigned long)p) ||
Expand All @@ -106,7 +105,6 @@ int
kdb_bt(int argc, const char **argv)
{
int diag;
int argcount = 5;
int btaprompt = 1;
int nextarg;
unsigned long addr;
Expand All @@ -125,7 +123,7 @@ kdb_bt(int argc, const char **argv)
/* Run the active tasks first */
for_each_online_cpu(cpu) {
p = kdb_curr_task(cpu);
if (kdb_bt1(p, mask, argcount, btaprompt))
if (kdb_bt1(p, mask, btaprompt))
return 0;
}
/* Now the inactive tasks */
Expand All @@ -134,7 +132,7 @@ kdb_bt(int argc, const char **argv)
return 0;
if (task_curr(p))
continue;
if (kdb_bt1(p, mask, argcount, btaprompt))
if (kdb_bt1(p, mask, btaprompt))
return 0;
} kdb_while_each_thread(g, p);
} else if (strcmp(argv[0], "btp") == 0) {
Expand All @@ -148,7 +146,7 @@ kdb_bt(int argc, const char **argv)
p = find_task_by_pid_ns(pid, &init_pid_ns);
if (p) {
kdb_set_current_task(p);
return kdb_bt1(p, ~0UL, argcount, 0);
return kdb_bt1(p, ~0UL, false);
}
kdb_printf("No process with pid == %ld found\n", pid);
return 0;
Expand All @@ -159,7 +157,7 @@ kdb_bt(int argc, const char **argv)
if (diag)
return diag;
kdb_set_current_task((struct task_struct *)addr);
return kdb_bt1((struct task_struct *)addr, ~0UL, argcount, 0);
return kdb_bt1((struct task_struct *)addr, ~0UL, false);
} else if (strcmp(argv[0], "btc") == 0) {
unsigned long cpu = ~0;
struct task_struct *save_current_task = kdb_current_task;
Expand Down Expand Up @@ -211,7 +209,7 @@ kdb_bt(int argc, const char **argv)
kdb_show_stack(kdb_current_task, (void *)addr);
return 0;
} else {
return kdb_bt1(kdb_current_task, ~0UL, argcount, 0);
return kdb_bt1(kdb_current_task, ~0UL, false);
}
}

Expand Down

0 comments on commit 54af3e3

Please sign in to comment.