提交 5ef45079 编写于 作者: N Namhyung Kim 提交者: Linus Torvalds

ptrace: cleanup arch_ptrace() on xtensa

Use new 'datap' variable in order to remove unnecessary castings.
Signed-off-by: NNamhyung Kim <namhyung@gmail.com>
Cc: Chris Zankel <chris@zankel.net>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 0a3d763f
...@@ -260,6 +260,7 @@ long arch_ptrace(struct task_struct *child, long request, ...@@ -260,6 +260,7 @@ long arch_ptrace(struct task_struct *child, long request,
unsigned long addr, unsigned long data) unsigned long addr, unsigned long data)
{ {
int ret = -EPERM; int ret = -EPERM;
void __user *datap = (void __user *) data;
switch (request) { switch (request) {
case PTRACE_PEEKTEXT: /* read word at location addr. */ case PTRACE_PEEKTEXT: /* read word at location addr. */
...@@ -268,7 +269,7 @@ long arch_ptrace(struct task_struct *child, long request, ...@@ -268,7 +269,7 @@ long arch_ptrace(struct task_struct *child, long request,
break; break;
case PTRACE_PEEKUSR: /* read register specified by addr. */ case PTRACE_PEEKUSR: /* read register specified by addr. */
ret = ptrace_peekusr(child, addr, (void __user *) data); ret = ptrace_peekusr(child, addr, datap);
break; break;
case PTRACE_POKETEXT: /* write the word at location addr. */ case PTRACE_POKETEXT: /* write the word at location addr. */
...@@ -281,19 +282,19 @@ long arch_ptrace(struct task_struct *child, long request, ...@@ -281,19 +282,19 @@ long 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;
case PTRACE_GETXTREGS: case PTRACE_GETXTREGS:
ret = ptrace_getxregs(child, (void __user *) data); ret = ptrace_getxregs(child, datap);
break; break;
case PTRACE_SETXTREGS: case PTRACE_SETXTREGS:
ret = ptrace_setxregs(child, (void __user *) data); ret = ptrace_setxregs(child, datap);
break; break;
default: default:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册