Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'kgdb-6.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/danielt/linux

Pull kgdb updates from Daniel Thompson:
"Three small changes this cycle:

- Clean up an architecture abstraction that is no longer needed
because all the architectures have converged.

- Actually use the prompt argument to kdb_position_cursor() instead
of ignoring it (functionally this fix is a nop but that was due to
luck rather than good judgement)

- Fix a -Wformat-security warning"

* tag 'kgdb-6.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/danielt/linux:
kdb: Get rid of redundant kdb_curr_task()
kdb: Use the passed prompt in kdb_position_cursor()
kdb: address -Wformat-security warnings

+8 -20
+1 -1
kernel/debug/kdb/kdb_bt.c
··· 144 144 kdb_ps_suppressed(); 145 145 /* Run the active tasks first */ 146 146 for_each_online_cpu(cpu) { 147 - p = kdb_curr_task(cpu); 147 + p = curr_task(cpu); 148 148 if (kdb_bt1(p, mask, btaprompt)) 149 149 return 0; 150 150 }
+3 -3
kernel/debug/kdb/kdb_io.c
··· 206 206 */ 207 207 static void kdb_position_cursor(char *prompt, char *buffer, char *cp) 208 208 { 209 - kdb_printf("\r%s", kdb_prompt_str); 209 + kdb_printf("\r%s", prompt); 210 210 if (cp > buffer) 211 211 kdb_printf("%.*s", (int)(cp - buffer), buffer); 212 212 } ··· 362 362 if (i >= dtab_count) 363 363 kdb_printf("..."); 364 364 kdb_printf("\n"); 365 - kdb_printf(kdb_prompt_str); 365 + kdb_printf("%s", kdb_prompt_str); 366 366 kdb_printf("%s", buffer); 367 367 if (cp != lastchar) 368 368 kdb_position_cursor(kdb_prompt_str, buffer, cp); ··· 453 453 { 454 454 if (prompt && kdb_prompt_str != prompt) 455 455 strscpy(kdb_prompt_str, prompt, CMD_BUFLEN); 456 - kdb_printf(kdb_prompt_str); 456 + kdb_printf("%s", kdb_prompt_str); 457 457 kdb_nextline = 1; /* Prompt and input resets line number */ 458 458 return kdb_read(buffer, bufsize); 459 459 }
+4 -14
kernel/debug/kdb/kdb_main.c
··· 155 155 156 156 static const int __nenv = ARRAY_SIZE(__env); 157 157 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 - 168 158 /* 169 159 * Update the permissions flags (kdb_cmd_enabled) to match the 170 160 * current lockdown state. ··· 1218 1228 char *cmdbuf; 1219 1229 int diag; 1220 1230 struct task_struct *kdb_current = 1221 - kdb_curr_task(raw_smp_processor_id()); 1231 + curr_task(raw_smp_processor_id()); 1222 1232 1223 1233 KDB_DEBUG_STATE("kdb_local 1", reason); 1224 1234 ··· 2268 2278 unsigned long cpu; 2269 2279 const struct task_struct *p, *g; 2270 2280 for_each_online_cpu(cpu) { 2271 - p = kdb_curr_task(cpu); 2281 + p = curr_task(cpu); 2272 2282 if (kdb_task_state(p, "-")) 2273 2283 ++idle; 2274 2284 } ··· 2304 2314 kdb_task_has_cpu(p), kdb_process_cpu(p), 2305 2315 kdb_task_state_char(p), 2306 2316 (void *)(&p->thread), 2307 - p == kdb_curr_task(raw_smp_processor_id()) ? '*' : ' ', 2317 + p == curr_task(raw_smp_processor_id()) ? '*' : ' ', 2308 2318 p->comm); 2309 2319 if (kdb_task_has_cpu(p)) { 2310 2320 if (!KDB_TSK(cpu)) { ··· 2340 2350 for_each_online_cpu(cpu) { 2341 2351 if (KDB_FLAG(CMD_INTERRUPT)) 2342 2352 return 0; 2343 - p = kdb_curr_task(cpu); 2353 + p = curr_task(cpu); 2344 2354 if (kdb_task_state(p, mask)) 2345 2355 kdb_ps1(p); 2346 2356 }
-2
kernel/debug/kdb/kdb_private.h
··· 210 210 #define KDB_TSK(cpu) kgdb_info[cpu].task 211 211 #define KDB_TSKREGS(cpu) kgdb_info[cpu].debuggerinfo 212 212 213 - extern struct task_struct *kdb_curr_task(int); 214 - 215 213 #define kdb_task_has_cpu(p) (task_curr(p)) 216 214 217 215 #define GFP_KDB (in_dbg_master() ? GFP_ATOMIC : GFP_KERNEL)