Consolidate PTRACE_DETACH
authorAlexey Dobriyan <adobriyan@sw.ru>
Tue, 16 Oct 2007 08:23:45 +0000 (01:23 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Tue, 16 Oct 2007 16:42:49 +0000 (09:42 -0700)
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>
19 files changed:
arch/alpha/kernel/ptrace.c
arch/arm/kernel/ptrace.c
arch/avr32/kernel/ptrace.c
arch/blackfin/kernel/ptrace.c
arch/cris/arch-v10/kernel/ptrace.c
arch/cris/arch-v32/kernel/ptrace.c
arch/m32r/kernel/ptrace.c
arch/m68k/kernel/ptrace.c
arch/mips/kernel/ptrace.c
arch/parisc/kernel/ptrace.c
arch/powerpc/kernel/ptrace.c
arch/s390/kernel/ptrace.c
arch/sh/kernel/ptrace.c
arch/sh64/kernel/ptrace.c
arch/um/kernel/ptrace.c
arch/x86/kernel/ptrace_32.c
arch/x86/kernel/ptrace_64.c
arch/xtensa/kernel/ptrace.c
kernel/ptrace.c

index 83a78184226623fa78f51e52c5643ce148de6f3f..eaf4ee5f0c356881c3588a0d5e9689db2ba5556d 100644 (file)
@@ -368,10 +368,6 @@ do_sys_ptrace(long request, long pid, long addr, long data,
                ret = 0;
                goto out;
 
-       case PTRACE_DETACH:      /* detach a process that was attached. */
-               ret = ptrace_detach(child, data);
-               goto out;
-
        default:
                ret = ptrace_request(child, request, addr, data);
                goto out;
index 78c9f1a3d41f725c428b352d413289c564ec3933..5feee722ea9878e08a9f6415fe7de8e45d7595f9 100644 (file)
@@ -731,10 +731,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
                        ret = 0;
                        break;
 
-               case PTRACE_DETACH:
-                       ret = ptrace_detach(child, data);
-                       break;
-
                case PTRACE_GETREGS:
                        ret = ptrace_getregs(child, (void __user *)data);
                        break;
index 39060cbeb2a3e2acc45509fe8ea8303222bd17e3..9e16b8a447f206ff81bec212e69055dac79c3718 100644 (file)
@@ -227,11 +227,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
                ret = 0;
                break;
 
-       /* Detach a process that was attached */
-       case PTRACE_DETACH:
-               ret = ptrace_detach(child, data);
-               break;
-
        case PTRACE_GETREGS:
                ret = ptrace_getregs(child, (void __user *)data);
                break;
index 64ce5fea8609afd848dbf301f2fccb10e53668a5..85caf9b711a16ff59eb069a42ee9fb29491a589b 100644 (file)
@@ -385,12 +385,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
                        break;
                }
 
-       case PTRACE_DETACH:
-               {               /* detach a process that was attached. */
-                       ret = ptrace_detach(child, data);
-                       break;
-               }
-
        case PTRACE_GETREGS:
                {
 
index f4f9db698b445afff62158c4b8e00e3451145b0c..b570ae9b6cad22396e987508b3bfc3f38d61659f 100644 (file)
@@ -177,10 +177,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
                        ret = 0;
                        break;
 
-               case PTRACE_DETACH:
-                       ret = ptrace_detach(child, data);
-                       break;
-
                /* Get all GP registers from the child. */
                case PTRACE_GETREGS: {
                        int i;
index 38ece0cd47cbbd4c6195b9e9bc1dbcc13f80e353..2df60529a8af3b8a4c9c2b19410266faef2eead6 100644 (file)
@@ -245,10 +245,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
                        break;
 
                }
-               case PTRACE_DETACH:
-                       ret = ptrace_detach(child, data);
-                       break;
-
                /* Get all GP registers from the child. */
                case PTRACE_GETREGS: {
                        int i;
index 62a51429306eb92269bb80817d5f4e3cb389f4db..abbeaf8f6d0af06815e7eff222bc9d6e05b62d7f 100644 (file)
@@ -704,14 +704,6 @@ do_ptrace(long request, struct task_struct *child, long addr, long data)
                break;
        }
 
-       /*
-        * detach a process that was attached.
-        */
-       case PTRACE_DETACH:
-               ret = 0;
-               ret = ptrace_detach(child, data);
-               break;
-
        case PTRACE_GETREGS:
                ret = ptrace_getregs(child, (void __user *)data);
                break;
index e792d3cba4c73e8cdfc9ac0cfd2e163cd471fa93..2075543c2d92182ce03d89a05479edf912559e36 100644 (file)
@@ -226,10 +226,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
                wake_up_process(child);
                break;
 
-       case PTRACE_DETACH:     /* detach a process that was attached. */
-               ret = ptrace_detach(child, data);
-               break;
-
        case PTRACE_GETREGS:    /* Get all gp regs from the child. */
                for (i = 0; i < 19; i++) {
                        tmp = get_reg(child, i);
index 58aa6fec1146256696dd1a4619e7659810abb260..999f7853de26162893be99098d2a7221809ca40d 100644 (file)
@@ -435,10 +435,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
                wake_up_process(child);
                break;
 
-       case PTRACE_DETACH: /* detach a process that was attached. */
-               ret = ptrace_detach(child, data);
-               break;
-
        case PTRACE_GET_THREAD_AREA:
                ret = put_user(task_thread_info(child)->tp_value,
                                (unsigned long __user *) data);
index 26ec774c5027fd9b8377c99a6c77df4ba9ffd484..49c637970789ba81da5741a75817ef1274e3b1ac 100644 (file)
@@ -329,10 +329,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
                /* give it a chance to run. */
                goto out_wake;
 
-       case PTRACE_DETACH:
-               ret = ptrace_detach(child, data);
-               goto out_tsk;
-
        case PTRACE_GETEVENTMSG:
                 ret = put_user(child->ptrace_message, (unsigned int __user *) data);
                goto out_tsk;
index cf7732cdd6c7e1ef65df511297dceac941e54ef5..3e17d154d0d44be624cb42f638ac4799804fa880 100644 (file)
@@ -505,10 +505,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
                ret = ptrace_set_debugreg(child, addr, data);
                break;
 
-       case PTRACE_DETACH:
-               ret = ptrace_detach(child, data);
-               break;
-
 #ifdef CONFIG_PPC64
        case PTRACE_GETREGS64:
 #endif
index f4503ca27630165b4166d93f275a90a525dac0e6..1d81bf9488aec20b968e305b2acf57fcd6d0bd85 100644 (file)
@@ -683,11 +683,6 @@ do_ptrace(struct task_struct *child, long request, long addr, long data)
                wake_up_process(child);
                return 0;
 
-       case PTRACE_DETACH:
-               /* detach a process that was attached. */
-               return ptrace_detach(child, data);
-
-
        /* Do requests that differ for 31/64 bit */
        default:
 #ifdef CONFIG_COMPAT
index f64a2d2416d4a364e0330ae5cab5e64666a65e54..ac725f0aeb72a992d7d10bfee54a66cd3d7cce79 100644 (file)
@@ -211,10 +211,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
                break;
        }
 
-       case PTRACE_DETACH: /* detach a process that was attached. */
-               ret = ptrace_detach(child, data);
-               break;
-
 #ifdef CONFIG_SH_DSP
        case PTRACE_GETDSPREGS: {
                unsigned long dp;
index df06c647746815cb0fb5ef19230ad80af9649372..8a2d339cf760b3df148e12bec2475e2b5c454b05 100644 (file)
@@ -244,10 +244,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
                break;
        }
 
-       case PTRACE_DETACH: /* detach a process that was attached. */
-               ret = ptrace_detach(child, data);
-               break;
-
        default:
                ret = ptrace_request(child, request, addr, data);
                break;
index 6916c8888dba7156850c16c9eb22009da851674a..36debc0de59410a9b294e9e061cfa4ed56373495 100644 (file)
@@ -119,11 +119,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
                break;
        }
 
-       case PTRACE_DETACH:
-               /* detach a process that was attached. */
-               ret = ptrace_detach(child, data);
-               break;
-
 #ifdef PTRACE_GETREGS
        case PTRACE_GETREGS: { /* Get all gp regs from the child. */
                if (!access_ok(VERIFY_WRITE, p, MAX_REG_OFFSET)) {
index 0cecd7513c9788fe1e13bee6a0f35c43b9b164ea..8622b9cd3e383eb259ec4101dac98464dc1bd9ce 100644 (file)
@@ -524,11 +524,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
                ret = 0;
                break;
 
-       case PTRACE_DETACH:
-               /* detach a process that was attached. */
-               ret = ptrace_detach(child, data);
-               break;
-
        case PTRACE_GETREGS: { /* Get all gp regs from the child. */
                if (!access_ok(VERIFY_WRITE, datap, FRAME_SIZE*sizeof(long))) {
                        ret = -EIO;
index c0cac42df3b6441010b7424788ad5e45b6a7119f..86321ee6da934a9803d8ee8c24e1dc9535e3537c 100644 (file)
@@ -500,11 +500,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
                ret = 0;
                break;
 
-       case PTRACE_DETACH:
-               /* detach a process that was attached. */
-               ret = ptrace_detach(child, data);
-               break;
-
        case PTRACE_GETREGS: { /* Get all gp regs from the child. */
                if (!access_ok(VERIFY_WRITE, (unsigned __user *)data,
                               sizeof(struct user_regs_struct))) {
index 06a13d9b69db54945e4d8a979e4468c88b9861ca..5533c7850d53b33c11aee1063ef1536bd91a46fd 100644 (file)
@@ -304,10 +304,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
                ret = put_user(sizeof(elf_fpregset_t), (unsigned long *) data);
                break;
 
-       case PTRACE_DETACH: /* detach a process that was attached. */
-               ret = ptrace_detach(child, data);
-               break;
-
        default:
                ret = ptrace_request(child, request, addr, data);
                goto out;
index 3eca7a55f2ee8b13fb2fb6f3e09ea2d7a685acaf..0870523c2ae40125c15ccb35a9542f0116939f4d 100644 (file)
@@ -386,6 +386,9 @@ int ptrace_request(struct task_struct *child, long request,
        case PTRACE_SETSIGINFO:
                ret = ptrace_setsiginfo(child, (siginfo_t __user *) data);
                break;
+       case PTRACE_DETACH:      /* detach a process that was attached. */
+               ret = ptrace_detach(child, data);
+               break;
        default:
                break;
        }