Skip to content

Commit

Permalink
ptrace: cleanup arch_ptrace() on MIPS
Browse files Browse the repository at this point in the history
Use new 'addrp', 'datavp' and 'datalp' variables in order to remove
unnecessary castings.

Signed-off-by: Namhyung Kim <[email protected]>
Cc: Ralf Baechle <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
namhyung authored and torvalds committed Oct 28, 2010
1 parent cfd866f commit fb67113
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions arch/mips/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,9 @@ long arch_ptrace(struct task_struct *child, long request,
unsigned long addr, unsigned long data)
{
int ret;
void __user *addrp = (void __user *) addr;
void __user *datavp = (void __user *) data;
unsigned long __user *datalp = (void __user *) data;

switch (request) {
/* when I and D space are separate, these will need to be fixed. */
Expand Down Expand Up @@ -387,7 +390,7 @@ long arch_ptrace(struct task_struct *child, long request,
ret = -EIO;
goto out;
}
ret = put_user(tmp, (unsigned long __user *) data);
ret = put_user(tmp, datalp);
break;
}

Expand Down Expand Up @@ -479,34 +482,31 @@ long arch_ptrace(struct task_struct *child, long request,
}

case PTRACE_GETREGS:
ret = ptrace_getregs(child, (__s64 __user *) data);
ret = ptrace_getregs(child, datavp);
break;

case PTRACE_SETREGS:
ret = ptrace_setregs(child, (__s64 __user *) data);
ret = ptrace_setregs(child, datavp);
break;

case PTRACE_GETFPREGS:
ret = ptrace_getfpregs(child, (__u32 __user *) data);
ret = ptrace_getfpregs(child, datavp);
break;

case PTRACE_SETFPREGS:
ret = ptrace_setfpregs(child, (__u32 __user *) data);
ret = ptrace_setfpregs(child, datavp);
break;

case PTRACE_GET_THREAD_AREA:
ret = put_user(task_thread_info(child)->tp_value,
(unsigned long __user *) data);
ret = put_user(task_thread_info(child)->tp_value, datalp);
break;

case PTRACE_GET_WATCH_REGS:
ret = ptrace_get_watch_regs(child,
(struct pt_watch_regs __user *) addr);
ret = ptrace_get_watch_regs(child, addrp);
break;

case PTRACE_SET_WATCH_REGS:
ret = ptrace_set_watch_regs(child,
(struct pt_watch_regs __user *) addr);
ret = ptrace_set_watch_regs(child, addrp);
break;

default:
Expand Down

0 comments on commit fb67113

Please sign in to comment.