lkml.org 
[lkml]   [2010]   [Aug]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC PATCH 05/43] ptrace, x86: cleanup arch_ptrace()
Date
change type of 'datap' variable into void pointer in order to remove
unnecessary castings.

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
---
arch/x86/kernel/ptrace.c | 10 ++++------
1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c
index ea7766a..29c17610 100644
--- a/arch/x86/kernel/ptrace.c
+++ b/arch/x86/kernel/ptrace.c
@@ -805,7 +805,7 @@ long arch_ptrace(struct task_struct *child, long request,
unsigned long addr, unsigned long data)
{
int ret;
- unsigned long __user *datap = (unsigned long __user *)data;
+ void __user *datap = (void __user *)data;

switch (request) {
/* read the word at location addr in the USER area. */
@@ -824,7 +824,7 @@ long arch_ptrace(struct task_struct *child, long request,
addr -= offsetof(struct user, u_debugreg[0]);
tmp = ptrace_get_debugreg(child, addr / sizeof(data));
}
- ret = put_user(tmp, datap);
+ ret = copy_to_user(datap, &tmp, sizeof(tmp)) ? -EFAULT : 0;
break;
}

@@ -889,15 +889,13 @@ long arch_ptrace(struct task_struct *child, long request,
case PTRACE_GET_THREAD_AREA:
if ((int) addr < 0)
return -EIO;
- ret = do_get_thread_area(child, addr,
- (struct user_desc __user *) data);
+ ret = do_get_thread_area(child, addr, datap);
break;

case PTRACE_SET_THREAD_AREA:
if ((int) addr < 0)
return -EIO;
- ret = do_set_thread_area(child, addr,
- (struct user_desc __user *) data, 0);
+ ret = do_set_thread_area(child, addr, datap, 0);
break;
#endif

--
1.7.2.2


\
 
 \ /
  Last update: 2010-08-27 11:53    [W:0.116 / U:2.400 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site