diff options
author | Peter Huewe <peterhuewe@gmx.de> | 2011-06-07 21:58:27 +0200 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2011-06-14 22:48:50 -0400 |
commit | 22fe9b54d859e53bfbbbdc1a0a77a82bc453927c (patch) | |
tree | 4aec2d069decbe0786ad5474908f5bbe49732ad4 /kernel/trace/trace_stack.c | |
parent | 749230b06a753a22f6ed96e5dd60815d6ab12865 (diff) | |
download | op-kernel-dev-22fe9b54d859e53bfbbbdc1a0a77a82bc453927c.zip op-kernel-dev-22fe9b54d859e53bfbbbdc1a0a77a82bc453927c.tar.gz |
tracing: Convert to kstrtoul_from_user
This patch replaces the code for getting an unsigned long from a
userspace buffer by a simple call to kstroul_from_user.
This makes it easier to read and less error prone.
Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Link: http://lkml.kernel.org/r/1307476707-14762-1-git-send-email-peterhuewe@gmx.de
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace/trace_stack.c')
-rw-r--r-- | kernel/trace/trace_stack.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/kernel/trace/trace_stack.c b/kernel/trace/trace_stack.c index b0b53b8..77575b3 100644 --- a/kernel/trace/trace_stack.c +++ b/kernel/trace/trace_stack.c @@ -156,20 +156,11 @@ stack_max_size_write(struct file *filp, const char __user *ubuf, { long *ptr = filp->private_data; unsigned long val, flags; - char buf[64]; int ret; int cpu; - if (count >= sizeof(buf)) - return -EINVAL; - - if (copy_from_user(&buf, ubuf, count)) - return -EFAULT; - - buf[count] = 0; - - ret = strict_strtoul(buf, 10, &val); - if (ret < 0) + ret = kstrtoul_from_user(ubuf, count, 10, &val); + if (ret) return ret; local_irq_save(flags); |