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

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Cc: Russell King <linux@arm.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/arm/kernel/ptrace.c

index 9bca6165459e310ef873d8fd0fc86fc6eaa41643..3e97483abcf029ea15eee056d4fa400b2e170a34 100644 (file)
@@ -1079,10 +1079,11 @@ long 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) {
                case PTRACE_PEEKUSR:
-                       ret = ptrace_read_user(child, addr, (unsigned long __user *)data);
+                       ret = ptrace_read_user(child, addr, datap);
                        break;
 
                case PTRACE_POKEUSR:
@@ -1090,34 +1091,34 @@ long 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;
 
                case PTRACE_GETFPREGS:
-                       ret = ptrace_getfpregs(child, (void __user *)data);
+                       ret = ptrace_getfpregs(child, datap);
                        break;
                
                case PTRACE_SETFPREGS:
-                       ret = ptrace_setfpregs(child, (void __user *)data);
+                       ret = ptrace_setfpregs(child, datap);
                        break;
 
 #ifdef CONFIG_IWMMXT
                case PTRACE_GETWMMXREGS:
-                       ret = ptrace_getwmmxregs(child, (void __user *)data);
+                       ret = ptrace_getwmmxregs(child, datap);
                        break;
 
                case PTRACE_SETWMMXREGS:
-                       ret = ptrace_setwmmxregs(child, (void __user *)data);
+                       ret = ptrace_setwmmxregs(child, datap);
                        break;
 #endif
 
                case PTRACE_GET_THREAD_AREA:
                        ret = put_user(task_thread_info(child)->tp_value,
-                                      (unsigned long __user *) data);
+                                      datap);
                        break;
 
                case PTRACE_SET_SYSCALL:
@@ -1127,21 +1128,21 @@ long arch_ptrace(struct task_struct *child, long request,
 
 #ifdef CONFIG_CRUNCH
                case PTRACE_GETCRUNCHREGS:
-                       ret = ptrace_getcrunchregs(child, (void __user *)data);
+                       ret = ptrace_getcrunchregs(child, datap);
                        break;
 
                case PTRACE_SETCRUNCHREGS:
-                       ret = ptrace_setcrunchregs(child, (void __user *)data);
+                       ret = ptrace_setcrunchregs(child, datap);
                        break;
 #endif
 
 #ifdef CONFIG_VFP
                case PTRACE_GETVFPREGS:
-                       ret = ptrace_getvfpregs(child, (void __user *)data);
+                       ret = ptrace_getvfpregs(child, datap);
                        break;
 
                case PTRACE_SETVFPREGS:
-                       ret = ptrace_setvfpregs(child, (void __user *)data);
+                       ret = ptrace_setvfpregs(child, datap);
                        break;
 #endif