X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=kernel%2Fconfigs.c;h=e84d3f9c6c7ba87218df59577462fc2523c0b6f9;hb=905d77cd95e856b8e0b2d099fb70b9b8ccb7337e;hp=8fa1fb28f8a79b895d6438a2485466d2ac8efda1;hpb=11c302c14d8ddc47504bd3b650bc9e8da7c717b7;p=mv-sheeva.git diff --git a/kernel/configs.c b/kernel/configs.c index 8fa1fb28f8a..e84d3f9c6c7 100644 --- a/kernel/configs.c +++ b/kernel/configs.c @@ -61,18 +61,9 @@ 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 const struct file_operations ikconfig_file_ops = {