Skip to content

Commit 9bccbe7

Browse files
ZhengzengkaiDaniel Thompson
authored andcommitted
kdb: Get rid of redundant kdb_curr_task()
Commit cf8e865 ("arch: Remove Itanium (IA-64) architecture") removed the only definition of macro _TIF_MCA_INIT, so kdb_curr_task() is actually the same as curr_task() now and becomes redundant. Let's remove the definition of kdb_curr_task() and replace remaining calls with curr_task(). Signed-off-by: Zheng Zengkai <[email protected]> Reviewed-by: Douglas Anderson <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Daniel Thompson <[email protected]>
1 parent e2e8210 commit 9bccbe7

File tree

3 files changed

+5
-17
lines changed

3 files changed

+5
-17
lines changed

kernel/debug/kdb/kdb_bt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ kdb_bt(int argc, const char **argv)
144144
kdb_ps_suppressed();
145145
/* Run the active tasks first */
146146
for_each_online_cpu(cpu) {
147-
p = kdb_curr_task(cpu);
147+
p = curr_task(cpu);
148148
if (kdb_bt1(p, mask, btaprompt))
149149
return 0;
150150
}

kernel/debug/kdb/kdb_main.c

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -155,16 +155,6 @@ static char *__env[31] = {
155155

156156
static const int __nenv = ARRAY_SIZE(__env);
157157

158-
struct task_struct *kdb_curr_task(int cpu)
159-
{
160-
struct task_struct *p = curr_task(cpu);
161-
#ifdef _TIF_MCA_INIT
162-
if ((task_thread_info(p)->flags & _TIF_MCA_INIT) && KDB_TSK(cpu))
163-
p = krp->p;
164-
#endif
165-
return p;
166-
}
167-
168158
/*
169159
* Update the permissions flags (kdb_cmd_enabled) to match the
170160
* current lockdown state.
@@ -1228,7 +1218,7 @@ static int kdb_local(kdb_reason_t reason, int error, struct pt_regs *regs,
12281218
char *cmdbuf;
12291219
int diag;
12301220
struct task_struct *kdb_current =
1231-
kdb_curr_task(raw_smp_processor_id());
1221+
curr_task(raw_smp_processor_id());
12321222

12331223
KDB_DEBUG_STATE("kdb_local 1", reason);
12341224

@@ -2278,7 +2268,7 @@ void kdb_ps_suppressed(void)
22782268
unsigned long cpu;
22792269
const struct task_struct *p, *g;
22802270
for_each_online_cpu(cpu) {
2281-
p = kdb_curr_task(cpu);
2271+
p = curr_task(cpu);
22822272
if (kdb_task_state(p, "-"))
22832273
++idle;
22842274
}
@@ -2314,7 +2304,7 @@ void kdb_ps1(const struct task_struct *p)
23142304
kdb_task_has_cpu(p), kdb_process_cpu(p),
23152305
kdb_task_state_char(p),
23162306
(void *)(&p->thread),
2317-
p == kdb_curr_task(raw_smp_processor_id()) ? '*' : ' ',
2307+
p == curr_task(raw_smp_processor_id()) ? '*' : ' ',
23182308
p->comm);
23192309
if (kdb_task_has_cpu(p)) {
23202310
if (!KDB_TSK(cpu)) {
@@ -2350,7 +2340,7 @@ static int kdb_ps(int argc, const char **argv)
23502340
for_each_online_cpu(cpu) {
23512341
if (KDB_FLAG(CMD_INTERRUPT))
23522342
return 0;
2353-
p = kdb_curr_task(cpu);
2343+
p = curr_task(cpu);
23542344
if (kdb_task_state(p, mask))
23552345
kdb_ps1(p);
23562346
}

kernel/debug/kdb/kdb_private.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,6 @@ extern void kdb_gdb_state_pass(char *buf);
210210
#define KDB_TSK(cpu) kgdb_info[cpu].task
211211
#define KDB_TSKREGS(cpu) kgdb_info[cpu].debuggerinfo
212212

213-
extern struct task_struct *kdb_curr_task(int);
214-
215213
#define kdb_task_has_cpu(p) (task_curr(p))
216214

217215
#define GFP_KDB (in_dbg_master() ? GFP_ATOMIC : GFP_KERNEL)

0 commit comments

Comments
 (0)