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

ptrace: cleanup arch_ptrace() on m32r

Use new 'datap' variable in order to remove duplicated castings.
Signed-off-by: default avatarNamhyung Kim <namhyung@gmail.com>
Cc: Hirokazu Takata <takata@linux-m32r.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 05fabdac
...@@ -626,6 +626,7 @@ arch_ptrace(struct task_struct *child, long request, ...@@ -626,6 +626,7 @@ arch_ptrace(struct task_struct *child, long request,
unsigned long addr, unsigned long data) unsigned long addr, unsigned long data)
{ {
int ret; int ret;
unsigned long __user *datap = (unsigned long __user *) data;
switch (request) { switch (request) {
/* /*
...@@ -640,8 +641,7 @@ arch_ptrace(struct task_struct *child, long request, ...@@ -640,8 +641,7 @@ arch_ptrace(struct task_struct *child, long request,
* read the word at location addr in the USER area. * read the word at location addr in the USER area.
*/ */
case PTRACE_PEEKUSR: case PTRACE_PEEKUSR:
ret = ptrace_read_user(child, addr, ret = ptrace_read_user(child, addr, datap);
(unsigned long __user *)data);
break; break;
/* /*
...@@ -662,11 +662,11 @@ arch_ptrace(struct task_struct *child, long request, ...@@ -662,11 +662,11 @@ arch_ptrace(struct task_struct *child, long request,
break; break;
case PTRACE_GETREGS: case PTRACE_GETREGS:
ret = ptrace_getregs(child, (void __user *)data); ret = ptrace_getregs(child, datap);
break; break;
case PTRACE_SETREGS: case PTRACE_SETREGS:
ret = ptrace_setregs(child, (void __user *)data); ret = ptrace_setregs(child, datap);
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