aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorAkinobu Mita <akinobu.mita@gmail.com>2008-06-09 19:44:30 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-06-14 12:17:59 -0400
commitcc0d9ff2c998410c7d4a99061a3ebdaa5c55ae9d (patch)
tree341a4cddcb7b1180d538a67002acc580611072ee /drivers/net
parenta9f853ddd352954815a023c4811629ed117df2f8 (diff)
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')
-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,
4561 size_t len, 4561 size_t len,
4562 loff_t *offset ) 4562 loff_t *offset )
4563{ 4563{
4564 loff_t pos = *offset; 4564 struct proc_data *priv = file->private_data;
4565 struct proc_data *priv = (struct proc_data*)file->private_data;
4566 4565
4567 if (!priv->rbuffer) 4566 if (!priv->rbuffer)
4568 return -EINVAL; 4567 return -EINVAL;
4569 4568
4570 if (pos < 0) 4569 return simple_read_from_buffer(buffer, len, offset, priv->rbuffer,
4571 return -EINVAL; 4570 priv->readlen);
4572 if (pos >= priv->readlen)
4573 return 0;
4574 if (len > priv->readlen - pos)
4575 len = priv->readlen - pos;
4576 if (copy_to_user(buffer, priv->rbuffer + pos, len))
4577 return -EFAULT;
4578 *offset = pos + len;
4579 return len;
4580} 4571}
4581 4572
4582/* 4573/*