ptrace: cleanup arch_ptrace() on m32r
authorNamhyung Kim <namhyung@gmail.com>
Wed, 27 Oct 2010 22:33:54 +0000 (15:33 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 28 Oct 2010 01:03:11 +0000 (18:03 -0700)
Use new 'datap' variable in order to remove duplicated castings.

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Cc: Hirokazu Takata <takata@linux-m32r.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/m32r/kernel/ptrace.c

index 5e00e0a41fff552f62b5e4af9b546d48fd7ea7ce..20743754f2b218fad41b16898beab57a687e1f90 100644 (file)
@@ -626,6 +626,7 @@ arch_ptrace(struct task_struct *child, long request,
            unsigned long addr, unsigned long data)
 {
        int ret;
+       unsigned long __user *datap = (unsigned long __user *) data;
 
        switch (request) {
        /*
@@ -640,8 +641,7 @@ arch_ptrace(struct task_struct *child, long request,
         * read the word at location addr in the USER area.
         */
        case PTRACE_PEEKUSR:
-               ret = ptrace_read_user(child, addr,
-                                      (unsigned long __user *)data);
+               ret = ptrace_read_user(child, addr, datap);
                break;
 
        /*
@@ -662,11 +662,11 @@ arch_ptrace(struct task_struct *child, long request,
                break;
 
        case PTRACE_GETREGS:
-               ret = ptrace_getregs(child, (void __user *)data);
+               ret = ptrace_getregs(child, datap);
                break;
 
        case PTRACE_SETREGS:
-               ret = ptrace_setregs(child, (void __user *)data);
+               ret = ptrace_setregs(child, datap);
                break;
 
        default: