summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/airo.c
diff options
context:
space:
mode:
authorAkinobu Mita <akinobu.mita@gmail.com>2008-06-09 16:44:30 -0700
committerJohn W. Linville <linville@tuxdriver.com>2008-06-14 12:17:59 -0400
commitcc0d9ff2c998410c7d4a99061a3ebdaa5c55ae9d (patch)
tree341a4cddcb7b1180d538a67002acc580611072ee /drivers/net/wireless/airo.c
parenta9f853ddd352954815a023c4811629ed117df2f8 (diff)
downloadlinux-cc0d9ff2c998410c7d4a99061a3ebdaa5c55ae9d.tar.bz2
airo: use simple_read_from_buffer()
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Cc: Dan Williams <dcbw@redhat.com> Cc: Michal Schmidt <mschmidt@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/airo.c')
-rw-r--r--drivers/net/wireless/airo.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
index 1e1446bf4b48..e30f8b79ea89 100644
--- a/drivers/net/wireless/airo.c
+++ b/drivers/net/wireless/airo.c
@@ -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,
+ priv->readlen);
}
/*