Commit 6904d3d0 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Al Viro

powerpc/spufs: stop using access_ok

Just use the proper non __-prefixed get/put_user variants where that is
not done yet.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJeremy Kerr <jk@ozlabs.org>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 88413a6b
......@@ -590,17 +590,12 @@ static ssize_t spufs_mbox_read(struct file *file, char __user *buf,
size_t len, loff_t *pos)
{
struct spu_context *ctx = file->private_data;
u32 mbox_data, __user *udata;
u32 mbox_data, __user *udata = (void __user *)buf;
ssize_t count;
if (len < 4)
return -EINVAL;
if (!access_ok(buf, len))
return -EFAULT;
udata = (void __user *)buf;
count = spu_acquire(ctx);
if (count)
return count;
......@@ -616,7 +611,7 @@ static ssize_t spufs_mbox_read(struct file *file, char __user *buf,
* but still need to return the data we have
* read successfully so far.
*/
ret = __put_user(mbox_data, udata);
ret = put_user(mbox_data, udata);
if (ret) {
if (!count)
count = -EFAULT;
......@@ -698,17 +693,12 @@ static ssize_t spufs_ibox_read(struct file *file, char __user *buf,
size_t len, loff_t *pos)
{
struct spu_context *ctx = file->private_data;
u32 ibox_data, __user *udata;
u32 ibox_data, __user *udata = (void __user *)buf;
ssize_t count;
if (len < 4)
return -EINVAL;
if (!access_ok(buf, len))
return -EFAULT;
udata = (void __user *)buf;
count = spu_acquire(ctx);
if (count)
goto out;
......@@ -727,7 +717,7 @@ static ssize_t spufs_ibox_read(struct file *file, char __user *buf,
}
/* if we can't write at all, return -EFAULT */
count = __put_user(ibox_data, udata);
count = put_user(ibox_data, udata);
if (count)
goto out_unlock;
......@@ -741,7 +731,7 @@ static ssize_t spufs_ibox_read(struct file *file, char __user *buf,
* but still need to return the data we have
* read successfully so far.
*/
ret = __put_user(ibox_data, udata);
ret = put_user(ibox_data, udata);
if (ret)
break;
}
......@@ -836,17 +826,13 @@ static ssize_t spufs_wbox_write(struct file *file, const char __user *buf,
size_t len, loff_t *pos)
{
struct spu_context *ctx = file->private_data;
u32 wbox_data, __user *udata;
u32 wbox_data, __user *udata = (void __user *)buf;
ssize_t count;
if (len < 4)
return -EINVAL;
udata = (void __user *)buf;
if (!access_ok(buf, len))
return -EFAULT;
if (__get_user(wbox_data, udata))
if (get_user(wbox_data, udata))
return -EFAULT;
count = spu_acquire(ctx);
......@@ -873,7 +859,7 @@ static ssize_t spufs_wbox_write(struct file *file, const char __user *buf,
/* write as much as possible */
for (count = 4, udata++; (count + 4) <= len; count += 4, udata++) {
int ret;
ret = __get_user(wbox_data, udata);
ret = get_user(wbox_data, udata);
if (ret)
break;
......@@ -1982,9 +1968,6 @@ static ssize_t spufs_mbox_info_read(struct file *file, char __user *buf,
u32 stat, data;
int ret;
if (!access_ok(buf, len))
return -EFAULT;
ret = spu_acquire_saved(ctx);
if (ret)
return ret;
......@@ -2028,9 +2011,6 @@ static ssize_t spufs_ibox_info_read(struct file *file, char __user *buf,
u32 stat, data;
int ret;
if (!access_ok(buf, len))
return -EFAULT;
ret = spu_acquire_saved(ctx);
if (ret)
return ret;
......@@ -2082,9 +2062,6 @@ static ssize_t spufs_wbox_info_read(struct file *file, char __user *buf,
u32 data[ARRAY_SIZE(ctx->csa.spu_mailbox_data)];
int ret, count;
if (!access_ok(buf, len))
return -EFAULT;
ret = spu_acquire_saved(ctx);
if (ret)
return ret;
......@@ -2143,9 +2120,6 @@ static ssize_t spufs_dma_info_read(struct file *file, char __user *buf,
struct spu_dma_info info;
int ret;
if (!access_ok(buf, len))
return -EFAULT;
ret = spu_acquire_saved(ctx);
if (ret)
return ret;
......
Markdown is supported
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