Commit fb671139 authored by Namhyung Kim's avatar Namhyung Kim Committed by Linus Torvalds

ptrace: cleanup arch_ptrace() on MIPS

Use new 'addrp', 'datavp' and 'datalp' variables in order to remove
unnecessary castings.
Signed-off-by: default avatarNamhyung Kim <namhyung@gmail.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent cfd866f6
...@@ -259,6 +259,9 @@ long arch_ptrace(struct task_struct *child, long request, ...@@ -259,6 +259,9 @@ long arch_ptrace(struct task_struct *child, long request,
unsigned long addr, unsigned long data) unsigned long addr, unsigned long data)
{ {
int ret; int ret;
void __user *addrp = (void __user *) addr;
void __user *datavp = (void __user *) data;
unsigned long __user *datalp = (void __user *) data;
switch (request) { switch (request) {
/* when I and D space are separate, these will need to be fixed. */ /* when I and D space are separate, these will need to be fixed. */
...@@ -387,7 +390,7 @@ long arch_ptrace(struct task_struct *child, long request, ...@@ -387,7 +390,7 @@ long arch_ptrace(struct task_struct *child, long request,
ret = -EIO; ret = -EIO;
goto out; goto out;
} }
ret = put_user(tmp, (unsigned long __user *) data); ret = put_user(tmp, datalp);
break; break;
} }
...@@ -479,34 +482,31 @@ long arch_ptrace(struct task_struct *child, long request, ...@@ -479,34 +482,31 @@ long arch_ptrace(struct task_struct *child, long request,
} }
case PTRACE_GETREGS: case PTRACE_GETREGS:
ret = ptrace_getregs(child, (__s64 __user *) data); ret = ptrace_getregs(child, datavp);
break; break;
case PTRACE_SETREGS: case PTRACE_SETREGS:
ret = ptrace_setregs(child, (__s64 __user *) data); ret = ptrace_setregs(child, datavp);
break; break;
case PTRACE_GETFPREGS: case PTRACE_GETFPREGS:
ret = ptrace_getfpregs(child, (__u32 __user *) data); ret = ptrace_getfpregs(child, datavp);
break; break;
case PTRACE_SETFPREGS: case PTRACE_SETFPREGS:
ret = ptrace_setfpregs(child, (__u32 __user *) data); ret = ptrace_setfpregs(child, datavp);
break; break;
case PTRACE_GET_THREAD_AREA: case PTRACE_GET_THREAD_AREA:
ret = put_user(task_thread_info(child)->tp_value, ret = put_user(task_thread_info(child)->tp_value, datalp);
(unsigned long __user *) data);
break; break;
case PTRACE_GET_WATCH_REGS: case PTRACE_GET_WATCH_REGS:
ret = ptrace_get_watch_regs(child, ret = ptrace_get_watch_regs(child, addrp);
(struct pt_watch_regs __user *) addr);
break; break;
case PTRACE_SET_WATCH_REGS: case PTRACE_SET_WATCH_REGS:
ret = ptrace_set_watch_regs(child, ret = ptrace_set_watch_regs(child, addrp);
(struct pt_watch_regs __user *) addr);
break; break;
default: default:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment