Commit cc0d9ff2 authored by Akinobu Mita's avatar Akinobu Mita Committed by John W. Linville
Browse files

airo: use simple_read_from_buffer()

Signed-off-by: default avatarAkinobu Mita <>
Cc: Dan Williams <>
Cc: Michal Schmidt <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarJohn W. Linville <>
parent a9f853dd
......@@ -4561,22 +4561,13 @@ static ssize_t proc_read( struct file *file,
size_t len,
loff_t *offset )
loff_t pos = *offset;
struct proc_data *priv = (struct proc_data*)file->private_data;
struct proc_data *priv = file->private_data;
if (!priv->rbuffer)
return -EINVAL;
if (pos < 0)
return -EINVAL;
if (pos >= priv->readlen)
return 0;
if (len > priv->readlen - pos)
len = priv->readlen - pos;
if (copy_to_user(buffer, priv->rbuffer + pos, len))
return -EFAULT;
*offset = pos + len;
return len;
return simple_read_from_buffer(buffer, len, offset, priv->rbuffer,
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment