aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung@gmail.com>2010-10-27 15:33:46 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2010-10-27 18:03:10 -0700
commit9fed81dc40f5a1ac2783bcc78d4029873be72894 (patch)
tree6eee883c2a782380f277e045f6a7258ef949a9a6
parent4abf986960ecda6a87fc2f795aacf888a2f0127e (diff)
downloadkernel_samsung_smdk4412-9fed81dc40f5a1ac2783bcc78d4029873be72894.zip
kernel_samsung_smdk4412-9fed81dc40f5a1ac2783bcc78d4029873be72894.tar.gz
kernel_samsung_smdk4412-9fed81dc40f5a1ac2783bcc78d4029873be72894.tar.bz2
ptrace: cleanup ptrace_request()
Use new 'datavp' and 'datalp' variables to remove unnecesary castings. Signed-off-by: Namhyung Kim <namhyung@gmail.com> Acked-by: Roland McGrath <roland@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--kernel/ptrace.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/kernel/ptrace.c b/kernel/ptrace.c
index 06981a8..ea7ce02 100644
--- a/kernel/ptrace.c
+++ b/kernel/ptrace.c
@@ -565,6 +565,8 @@ int ptrace_request(struct task_struct *child, long request,
{
int ret = -EIO;
siginfo_t siginfo;
+ void __user *datavp = (void __user *) data;
+ unsigned long __user *datalp = datavp;
switch (request) {
case PTRACE_PEEKTEXT:
@@ -581,19 +583,17 @@ int ptrace_request(struct task_struct *child, long request,
ret = ptrace_setoptions(child, data);
break;
case PTRACE_GETEVENTMSG:
- ret = put_user(child->ptrace_message, (unsigned long __user *) data);
+ ret = put_user(child->ptrace_message, datalp);
break;
case PTRACE_GETSIGINFO:
ret = ptrace_getsiginfo(child, &siginfo);
if (!ret)
- ret = copy_siginfo_to_user((siginfo_t __user *) data,
- &siginfo);
+ ret = copy_siginfo_to_user(datavp, &siginfo);
break;
case PTRACE_SETSIGINFO:
- if (copy_from_user(&siginfo, (siginfo_t __user *) data,
- sizeof siginfo))
+ if (copy_from_user(&siginfo, datavp, sizeof siginfo))
ret = -EFAULT;
else
ret = ptrace_setsiginfo(child, &siginfo);
@@ -624,7 +624,7 @@ int ptrace_request(struct task_struct *child, long request,
}
mmput(mm);
- ret = put_user(tmp, (unsigned long __user *) data);
+ ret = put_user(tmp, datalp);
break;
}
#endif
@@ -653,7 +653,7 @@ int ptrace_request(struct task_struct *child, long request,
case PTRACE_SETREGSET:
{
struct iovec kiov;
- struct iovec __user *uiov = (struct iovec __user *) data;
+ struct iovec __user *uiov = datavp;
if (!access_ok(VERIFY_WRITE, uiov, sizeof(*uiov)))
return -EFAULT;