Skip to content

Commit

Permalink
ptrace: cleanup arch_ptrace() on m32r
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Namhyung Kim authored and Linus Torvalds committed Oct 28, 2010
1 parent 05fabda commit a68caa0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions arch/m32r/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
/*
Expand All @@ -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;

/*
Expand All @@ -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:
Expand Down

0 comments on commit a68caa0

Please sign in to comment.