Merge git://git.linux-xtensa.org/kernel/xtensa-feed
[linux-drm-fsl-dcu.git] / kernel / cpuset.c
index 88b416dfbc7231d95a97ea36ad36da0798bbbf8e..f57854b0892275d901e9e1b7b8f2e4784adcc37a 100644 (file)
@@ -1772,12 +1772,7 @@ static ssize_t cpuset_tasks_read(struct file *file, char __user *buf,
 {
        struct ctr_struct *ctr = file->private_data;
 
-       if (*ppos + nbytes > ctr->bufsz)
-               nbytes = ctr->bufsz - *ppos;
-       if (copy_to_user(buf, ctr->buf + *ppos, nbytes))
-               return -EFAULT;
-       *ppos += nbytes;
-       return nbytes;
+       return simple_read_from_buffer(buf, nbytes, ppos, ctr->buf, ctr->bufsz);
 }
 
 static int cpuset_tasks_release(struct inode *unused_inode, struct file *file)