diff options
author | Akinobu Mita <akinobu.mita@gmail.com> | 2007-05-09 05:33:33 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-09 15:30:49 -0400 |
commit | 85badbdf5120d246ce2bb3f1a7689a805f9c9006 (patch) | |
tree | 0c406f24c1533dc8dcaf322751b05e7b8bcd5d23 /kernel/configs.c | |
parent | 92f4c701aad794de9e4cf7341d0a486aed027c46 (diff) |
use simple_read_from_buffer in kernel/
Cleanup using simple_read_from_buffer() for /dev/cpuset/tasks and
/proc/config.gz.
Cc: Paul Jackson <pj@sgi.com>
Cc: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/configs.c')
-rw-r--r-- | kernel/configs.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/kernel/configs.c b/kernel/configs.c index 8fa1fb28f8a7..e84d3f9c6c7b 100644 --- a/kernel/configs.c +++ b/kernel/configs.c | |||
@@ -61,18 +61,9 @@ static ssize_t | |||
61 | ikconfig_read_current(struct file *file, char __user *buf, | 61 | ikconfig_read_current(struct file *file, char __user *buf, |
62 | size_t len, loff_t * offset) | 62 | size_t len, loff_t * offset) |
63 | { | 63 | { |
64 | loff_t pos = *offset; | 64 | return simple_read_from_buffer(buf, len, offset, |
65 | ssize_t count; | 65 | kernel_config_data + MAGIC_SIZE, |
66 | 66 | kernel_config_data_size); | |
67 | if (pos >= kernel_config_data_size) | ||
68 | return 0; | ||
69 | |||
70 | count = min(len, (size_t)(kernel_config_data_size - pos)); | ||
71 | if (copy_to_user(buf, kernel_config_data + MAGIC_SIZE + pos, count)) | ||
72 | return -EFAULT; | ||
73 | |||
74 | *offset += count; | ||
75 | return count; | ||
76 | } | 67 | } |
77 | 68 | ||
78 | static const struct file_operations ikconfig_file_ops = { | 69 | static const struct file_operations ikconfig_file_ops = { |