aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@sw.ru>2007-10-16 04:23:45 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-16 12:42:49 -0400
commit1bcf548293aef19b0797348332cf1dfbf2116cef (patch)
tree80b2535e3dd2a6d23c15b91e10cae227310a44ee
parente6716b87d5c9edf19c711212785cd30c6ec21868 (diff)
Consolidate PTRACE_DETACH
Identical handlers of PTRACE_DETACH go into ptrace_request(). Not touching compat code. Not touching archs that don't call ptrace_request. Signed-off-by: Alexey Dobriyan <adobriyan@sw.ru> Acked-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--arch/alpha/kernel/ptrace.c4
-rw-r--r--arch/arm/kernel/ptrace.c4
-rw-r--r--arch/avr32/kernel/ptrace.c5
-rw-r--r--arch/blackfin/kernel/ptrace.c6
-rw-r--r--arch/cris/arch-v10/kernel/ptrace.c4
-rw-r--r--arch/cris/arch-v32/kernel/ptrace.c4
-rw-r--r--arch/m32r/kernel/ptrace.c8
-rw-r--r--arch/m68k/kernel/ptrace.c4
-rw-r--r--arch/mips/kernel/ptrace.c4
-rw-r--r--arch/parisc/kernel/ptrace.c4
-rw-r--r--arch/powerpc/kernel/ptrace.c4
-rw-r--r--arch/s390/kernel/ptrace.c5
-rw-r--r--arch/sh/kernel/ptrace.c4
-rw-r--r--arch/sh64/kernel/ptrace.c4
-rw-r--r--arch/um/kernel/ptrace.c5
-rw-r--r--arch/x86/kernel/ptrace_32.c5
-rw-r--r--arch/x86/kernel/ptrace_64.c5
-rw-r--r--arch/xtensa/kernel/ptrace.c4
-rw-r--r--kernel/ptrace.c3
19 files changed, 3 insertions, 83 deletions
diff --git a/arch/alpha/kernel/ptrace.c b/arch/alpha/kernel/ptrace.c
index 83a781842266..eaf4ee5f0c35 100644
--- a/arch/alpha/kernel/ptrace.c
+++ b/arch/alpha/kernel/ptrace.c
@@ -368,10 +368,6 @@ do_sys_ptrace(long request, long pid, long addr, long data,
368 ret = 0; 368 ret = 0;
369 goto out; 369 goto out;
370 370
371 case PTRACE_DETACH: /* detach a process that was attached. */
372 ret = ptrace_detach(child, data);
373 goto out;
374
375 default: 371 default:
376 ret = ptrace_request(child, request, addr, data); 372 ret = ptrace_request(child, request, addr, data);
377 goto out; 373 goto out;
diff --git a/arch/arm/kernel/ptrace.c b/arch/arm/kernel/ptrace.c
index 78c9f1a3d41f..5feee722ea98 100644
--- a/arch/arm/kernel/ptrace.c
+++ b/arch/arm/kernel/ptrace.c
@@ -731,10 +731,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
731 ret = 0; 731 ret = 0;
732 break; 732 break;
733 733
734 case PTRACE_DETACH:
735 ret = ptrace_detach(child, data);
736 break;
737
738 case PTRACE_GETREGS: 734 case PTRACE_GETREGS:
739 ret = ptrace_getregs(child, (void __user *)data); 735 ret = ptrace_getregs(child, (void __user *)data);
740 break; 736 break;
diff --git a/arch/avr32/kernel/ptrace.c b/arch/avr32/kernel/ptrace.c
index 39060cbeb2a3..9e16b8a447f2 100644
--- a/arch/avr32/kernel/ptrace.c
+++ b/arch/avr32/kernel/ptrace.c
@@ -227,11 +227,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
227 ret = 0; 227 ret = 0;
228 break; 228 break;
229 229
230 /* Detach a process that was attached */
231 case PTRACE_DETACH:
232 ret = ptrace_detach(child, data);
233 break;
234
235 case PTRACE_GETREGS: 230 case PTRACE_GETREGS:
236 ret = ptrace_getregs(child, (void __user *)data); 231 ret = ptrace_getregs(child, (void __user *)data);
237 break; 232 break;
diff --git a/arch/blackfin/kernel/ptrace.c b/arch/blackfin/kernel/ptrace.c
index 64ce5fea8609..85caf9b711a1 100644
--- a/arch/blackfin/kernel/ptrace.c
+++ b/arch/blackfin/kernel/ptrace.c
@@ -385,12 +385,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
385 break; 385 break;
386 } 386 }
387 387
388 case PTRACE_DETACH:
389 { /* detach a process that was attached. */
390 ret = ptrace_detach(child, data);
391 break;
392 }
393
394 case PTRACE_GETREGS: 388 case PTRACE_GETREGS:
395 { 389 {
396 390
diff --git a/arch/cris/arch-v10/kernel/ptrace.c b/arch/cris/arch-v10/kernel/ptrace.c
index f4f9db698b44..b570ae9b6cad 100644
--- a/arch/cris/arch-v10/kernel/ptrace.c
+++ b/arch/cris/arch-v10/kernel/ptrace.c
@@ -177,10 +177,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
177 ret = 0; 177 ret = 0;
178 break; 178 break;
179 179
180 case PTRACE_DETACH:
181 ret = ptrace_detach(child, data);
182 break;
183
184 /* Get all GP registers from the child. */ 180 /* Get all GP registers from the child. */
185 case PTRACE_GETREGS: { 181 case PTRACE_GETREGS: {
186 int i; 182 int i;
diff --git a/arch/cris/arch-v32/kernel/ptrace.c b/arch/cris/arch-v32/kernel/ptrace.c
index 38ece0cd47cb..2df60529a8af 100644
--- a/arch/cris/arch-v32/kernel/ptrace.c
+++ b/arch/cris/arch-v32/kernel/ptrace.c
@@ -245,10 +245,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
245 break; 245 break;
246 246
247 } 247 }
248 case PTRACE_DETACH:
249 ret = ptrace_detach(child, data);
250 break;
251
252 /* Get all GP registers from the child. */ 248 /* Get all GP registers from the child. */
253 case PTRACE_GETREGS: { 249 case PTRACE_GETREGS: {
254 int i; 250 int i;
diff --git a/arch/m32r/kernel/ptrace.c b/arch/m32r/kernel/ptrace.c
index 62a51429306e..abbeaf8f6d0a 100644
--- a/arch/m32r/kernel/ptrace.c
+++ b/arch/m32r/kernel/ptrace.c
@@ -704,14 +704,6 @@ do_ptrace(long request, struct task_struct *child, long addr, long data)
704 break; 704 break;
705 } 705 }
706 706
707 /*
708 * detach a process that was attached.
709 */
710 case PTRACE_DETACH:
711 ret = 0;
712 ret = ptrace_detach(child, data);
713 break;
714
715 case PTRACE_GETREGS: 707 case PTRACE_GETREGS:
716 ret = ptrace_getregs(child, (void __user *)data); 708 ret = ptrace_getregs(child, (void __user *)data);
717 break; 709 break;
diff --git a/arch/m68k/kernel/ptrace.c b/arch/m68k/kernel/ptrace.c
index e792d3cba4c7..2075543c2d92 100644
--- a/arch/m68k/kernel/ptrace.c
+++ b/arch/m68k/kernel/ptrace.c
@@ -226,10 +226,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
226 wake_up_process(child); 226 wake_up_process(child);
227 break; 227 break;
228 228
229 case PTRACE_DETACH: /* detach a process that was attached. */
230 ret = ptrace_detach(child, data);
231 break;
232
233 case PTRACE_GETREGS: /* Get all gp regs from the child. */ 229 case PTRACE_GETREGS: /* Get all gp regs from the child. */
234 for (i = 0; i < 19; i++) { 230 for (i = 0; i < 19; i++) {
235 tmp = get_reg(child, i); 231 tmp = get_reg(child, i);
diff --git a/arch/mips/kernel/ptrace.c b/arch/mips/kernel/ptrace.c
index 58aa6fec1146..999f7853de26 100644
--- a/arch/mips/kernel/ptrace.c
+++ b/arch/mips/kernel/ptrace.c
@@ -435,10 +435,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
435 wake_up_process(child); 435 wake_up_process(child);
436 break; 436 break;
437 437
438 case PTRACE_DETACH: /* detach a process that was attached. */
439 ret = ptrace_detach(child, data);
440 break;
441
442 case PTRACE_GET_THREAD_AREA: 438 case PTRACE_GET_THREAD_AREA:
443 ret = put_user(task_thread_info(child)->tp_value, 439 ret = put_user(task_thread_info(child)->tp_value,
444 (unsigned long __user *) data); 440 (unsigned long __user *) data);
diff --git a/arch/parisc/kernel/ptrace.c b/arch/parisc/kernel/ptrace.c
index 26ec774c5027..49c637970789 100644
--- a/arch/parisc/kernel/ptrace.c
+++ b/arch/parisc/kernel/ptrace.c
@@ -329,10 +329,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
329 /* give it a chance to run. */ 329 /* give it a chance to run. */
330 goto out_wake; 330 goto out_wake;
331 331
332 case PTRACE_DETACH:
333 ret = ptrace_detach(child, data);
334 goto out_tsk;
335
336 case PTRACE_GETEVENTMSG: 332 case PTRACE_GETEVENTMSG:
337 ret = put_user(child->ptrace_message, (unsigned int __user *) data); 333 ret = put_user(child->ptrace_message, (unsigned int __user *) data);
338 goto out_tsk; 334 goto out_tsk;
diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c
index cf7732cdd6c7..3e17d154d0d4 100644
--- a/arch/powerpc/kernel/ptrace.c
+++ b/arch/powerpc/kernel/ptrace.c
@@ -505,10 +505,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
505 ret = ptrace_set_debugreg(child, addr, data); 505 ret = ptrace_set_debugreg(child, addr, data);
506 break; 506 break;
507 507
508 case PTRACE_DETACH:
509 ret = ptrace_detach(child, data);
510 break;
511
512#ifdef CONFIG_PPC64 508#ifdef CONFIG_PPC64
513 case PTRACE_GETREGS64: 509 case PTRACE_GETREGS64:
514#endif 510#endif
diff --git a/arch/s390/kernel/ptrace.c b/arch/s390/kernel/ptrace.c
index f4503ca27630..1d81bf9488ae 100644
--- a/arch/s390/kernel/ptrace.c
+++ b/arch/s390/kernel/ptrace.c
@@ -683,11 +683,6 @@ do_ptrace(struct task_struct *child, long request, long addr, long data)
683 wake_up_process(child); 683 wake_up_process(child);
684 return 0; 684 return 0;
685 685
686 case PTRACE_DETACH:
687 /* detach a process that was attached. */
688 return ptrace_detach(child, data);
689
690
691 /* Do requests that differ for 31/64 bit */ 686 /* Do requests that differ for 31/64 bit */
692 default: 687 default:
693#ifdef CONFIG_COMPAT 688#ifdef CONFIG_COMPAT
diff --git a/arch/sh/kernel/ptrace.c b/arch/sh/kernel/ptrace.c
index f64a2d2416d4..ac725f0aeb72 100644
--- a/arch/sh/kernel/ptrace.c
+++ b/arch/sh/kernel/ptrace.c
@@ -211,10 +211,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
211 break; 211 break;
212 } 212 }
213 213
214 case PTRACE_DETACH: /* detach a process that was attached. */
215 ret = ptrace_detach(child, data);
216 break;
217
218#ifdef CONFIG_SH_DSP 214#ifdef CONFIG_SH_DSP
219 case PTRACE_GETDSPREGS: { 215 case PTRACE_GETDSPREGS: {
220 unsigned long dp; 216 unsigned long dp;
diff --git a/arch/sh64/kernel/ptrace.c b/arch/sh64/kernel/ptrace.c
index df06c6477468..8a2d339cf760 100644
--- a/arch/sh64/kernel/ptrace.c
+++ b/arch/sh64/kernel/ptrace.c
@@ -244,10 +244,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
244 break; 244 break;
245 } 245 }
246 246
247 case PTRACE_DETACH: /* detach a process that was attached. */
248 ret = ptrace_detach(child, data);
249 break;
250
251 default: 247 default:
252 ret = ptrace_request(child, request, addr, data); 248 ret = ptrace_request(child, request, addr, data);
253 break; 249 break;
diff --git a/arch/um/kernel/ptrace.c b/arch/um/kernel/ptrace.c
index 6916c8888dba..36debc0de594 100644
--- a/arch/um/kernel/ptrace.c
+++ b/arch/um/kernel/ptrace.c
@@ -119,11 +119,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
119 break; 119 break;
120 } 120 }
121 121
122 case PTRACE_DETACH:
123 /* detach a process that was attached. */
124 ret = ptrace_detach(child, data);
125 break;
126
127#ifdef PTRACE_GETREGS 122#ifdef PTRACE_GETREGS
128 case PTRACE_GETREGS: { /* Get all gp regs from the child. */ 123 case PTRACE_GETREGS: { /* Get all gp regs from the child. */
129 if (!access_ok(VERIFY_WRITE, p, MAX_REG_OFFSET)) { 124 if (!access_ok(VERIFY_WRITE, p, MAX_REG_OFFSET)) {
diff --git a/arch/x86/kernel/ptrace_32.c b/arch/x86/kernel/ptrace_32.c
index 0cecd7513c97..8622b9cd3e38 100644
--- a/arch/x86/kernel/ptrace_32.c
+++ b/arch/x86/kernel/ptrace_32.c
@@ -524,11 +524,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
524 ret = 0; 524 ret = 0;
525 break; 525 break;
526 526
527 case PTRACE_DETACH:
528 /* detach a process that was attached. */
529 ret = ptrace_detach(child, data);
530 break;
531
532 case PTRACE_GETREGS: { /* Get all gp regs from the child. */ 527 case PTRACE_GETREGS: { /* Get all gp regs from the child. */
533 if (!access_ok(VERIFY_WRITE, datap, FRAME_SIZE*sizeof(long))) { 528 if (!access_ok(VERIFY_WRITE, datap, FRAME_SIZE*sizeof(long))) {
534 ret = -EIO; 529 ret = -EIO;
diff --git a/arch/x86/kernel/ptrace_64.c b/arch/x86/kernel/ptrace_64.c
index c0cac42df3b6..86321ee6da93 100644
--- a/arch/x86/kernel/ptrace_64.c
+++ b/arch/x86/kernel/ptrace_64.c
@@ -500,11 +500,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
500 ret = 0; 500 ret = 0;
501 break; 501 break;
502 502
503 case PTRACE_DETACH:
504 /* detach a process that was attached. */
505 ret = ptrace_detach(child, data);
506 break;
507
508 case PTRACE_GETREGS: { /* Get all gp regs from the child. */ 503 case PTRACE_GETREGS: { /* Get all gp regs from the child. */
509 if (!access_ok(VERIFY_WRITE, (unsigned __user *)data, 504 if (!access_ok(VERIFY_WRITE, (unsigned __user *)data,
510 sizeof(struct user_regs_struct))) { 505 sizeof(struct user_regs_struct))) {
diff --git a/arch/xtensa/kernel/ptrace.c b/arch/xtensa/kernel/ptrace.c
index 06a13d9b69db..5533c7850d53 100644
--- a/arch/xtensa/kernel/ptrace.c
+++ b/arch/xtensa/kernel/ptrace.c
@@ -304,10 +304,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
304 ret = put_user(sizeof(elf_fpregset_t), (unsigned long *) data); 304 ret = put_user(sizeof(elf_fpregset_t), (unsigned long *) data);
305 break; 305 break;
306 306
307 case PTRACE_DETACH: /* detach a process that was attached. */
308 ret = ptrace_detach(child, data);
309 break;
310
311 default: 307 default:
312 ret = ptrace_request(child, request, addr, data); 308 ret = ptrace_request(child, request, addr, data);
313 goto out; 309 goto out;
diff --git a/kernel/ptrace.c b/kernel/ptrace.c
index 3eca7a55f2ee..0870523c2ae4 100644
--- a/kernel/ptrace.c
+++ b/kernel/ptrace.c
@@ -386,6 +386,9 @@ int ptrace_request(struct task_struct *child, long request,
386 case PTRACE_SETSIGINFO: 386 case PTRACE_SETSIGINFO:
387 ret = ptrace_setsiginfo(child, (siginfo_t __user *) data); 387 ret = ptrace_setsiginfo(child, (siginfo_t __user *) data);
388 break; 388 break;
389 case PTRACE_DETACH: /* detach a process that was attached. */
390 ret = ptrace_detach(child, data);
391 break;
389 default: 392 default:
390 break; 393 break;
391 } 394 }