X-Git-Url: http://ftp.safe.ca/?a=blobdiff_plain;f=kernel%2Fconfigs.c;h=e84d3f9c6c7ba87218df59577462fc2523c0b6f9;hb=87d43dd48d6e68095be85c4e5f991fd7c89c052e;hp=009e1ebdcb88e57b62d64daafb4be1be9468a514;hpb=f4b09ebc8baa51ec8394c4173e3de9d62b2cc97a;p=safe%2Fjmp%2Flinux-2.6 diff --git a/kernel/configs.c b/kernel/configs.c index 009e1eb..e84d3f9 100644 --- a/kernel/configs.c +++ b/kernel/configs.c @@ -23,7 +23,6 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include #include #include #include @@ -62,21 +61,12 @@ static ssize_t ikconfig_read_current(struct file *file, char __user *buf, size_t len, loff_t * offset) { - loff_t pos = *offset; - ssize_t count; - - if (pos >= kernel_config_data_size) - return 0; - - count = min(len, (size_t)(kernel_config_data_size - pos)); - if (copy_to_user(buf, kernel_config_data + MAGIC_SIZE + pos, count)) - return -EFAULT; - - *offset += count; - return count; + return simple_read_from_buffer(buf, len, offset, + kernel_config_data + MAGIC_SIZE, + kernel_config_data_size); } -static struct file_operations ikconfig_file_ops = { +static const struct file_operations ikconfig_file_ops = { .owner = THIS_MODULE, .read = ikconfig_read_current, };