Merge branch 'dmapool' of git://git.kernel.org/pub/scm/linux/kernel/git/willy/misc
[sfrench/cifs-2.6.git] / kernel / configs.c
index f9e31974f4addf262cee19d1049f6b1fd55bc47e..e84d3f9c6c7ba87218df59577462fc2523c0b6f9 100644 (file)
@@ -61,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,
 };