summaryrefslogtreecommitdiff
path: root/linux/i810_dma.c
diff options
context:
space:
mode:
Diffstat (limited to 'linux/i810_dma.c')
-rw-r--r--linux/i810_dma.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/linux/i810_dma.c b/linux/i810_dma.c
index 144ce113..eb5e192b 100644
--- a/linux/i810_dma.c
+++ b/linux/i810_dma.c
@@ -466,7 +466,7 @@ int i810_dma_init_compat(drm_i810_init_t *init, unsigned long arg)
{
/* Get v1.1 init data */
- if (copy_from_user(init, (drm_i810_pre12_init_t *)arg,
+ if (copy_from_user(init, (drm_i810_pre12_init_t __user *)arg,
sizeof(drm_i810_pre12_init_t))) {
return -EFAULT;
}
@@ -475,7 +475,7 @@ int i810_dma_init_compat(drm_i810_init_t *init, unsigned long arg)
/* This is a v1.2 client, just get the v1.2 init data */
DRM_INFO("Using POST v1.2 init.\n");
- if (copy_from_user(init, (drm_i810_init_t *)arg,
+ if (copy_from_user(init, (drm_i810_init_t __user *)arg,
sizeof(drm_i810_init_t))) {
return -EFAULT;
}
@@ -504,7 +504,7 @@ int i810_dma_init(struct inode *inode, struct file *filp,
int retcode = 0;
/* Get only the init func */
- if (copy_from_user(&init, (void *)arg, sizeof(drm_i810_init_func_t)))
+ if (copy_from_user(&init, (void __user *)arg, sizeof(drm_i810_init_func_t)))
return -EFAULT;
switch(init.func) {
@@ -528,7 +528,7 @@ int i810_dma_init(struct inode *inode, struct file *filp,
default:
case I810_INIT_DMA_1_4:
DRM_INFO("Using v1.4 init.\n");
- if (copy_from_user(&init, (drm_i810_init_t *)arg,
+ if (copy_from_user(&init, (drm_i810_init_t __user *)arg,
sizeof(drm_i810_init_t))) {
return -EFAULT;
}
@@ -851,12 +851,13 @@ static void i810_dma_dispatch_vertex(drm_device_t *dev,
if (buf_priv->currently_mapped == I810_BUF_MAPPED) {
unsigned int prim = (sarea_priv->vertex_prim & PR_MASK);
- DRM_PUT_USER_UNCHECKED((u32 *)buf_priv->virtual,
- (GFX_OP_PRIMITIVE | prim |
- ((used/4)-2)));
+ put_user((GFX_OP_PRIMITIVE | prim |
+ ((used/4)-2)),
+ (u32 __user *)buf_priv->virtual);
if (used & 4) {
- DRM_PUT_USER_UNCHECKED((u32 *)((u32)buf_priv->virtual + used), 0);
+ put_user(0,
+ (u32 __user *)((u32)buf_priv->virtual + used));
used += 4;
}
@@ -1062,7 +1063,7 @@ int i810_dma_vertex(struct inode *inode, struct file *filp,
dev_priv->sarea_priv;
drm_i810_vertex_t vertex;
- if (copy_from_user(&vertex, (drm_i810_vertex_t *)arg, sizeof(vertex)))
+ if (copy_from_user(&vertex, (drm_i810_vertex_t __user *)arg, sizeof(vertex)))
return -EFAULT;
if (!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) {
@@ -1097,7 +1098,7 @@ int i810_clear_bufs(struct inode *inode, struct file *filp,
drm_device_t *dev = priv->dev;
drm_i810_clear_t clear;
- if (copy_from_user(&clear, (drm_i810_clear_t *)arg, sizeof(clear)))
+ if (copy_from_user(&clear, (drm_i810_clear_t __user *)arg, sizeof(clear)))
return -EFAULT;
if (!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) {
@@ -1159,7 +1160,7 @@ int i810_getbuf(struct inode *inode, struct file *filp, unsigned int cmd,
drm_i810_sarea_t *sarea_priv = (drm_i810_sarea_t *)
dev_priv->sarea_priv;
- if (copy_from_user(&d, (drm_i810_dma_t *)arg, sizeof(d)))
+ if (copy_from_user(&d, (drm_i810_dma_t __user *)arg, sizeof(d)))
return -EFAULT;
if (!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) {
@@ -1174,7 +1175,7 @@ int i810_getbuf(struct inode *inode, struct file *filp, unsigned int cmd,
DRM_DEBUG("i810_dma: %d returning %d, granted = %d\n",
current->pid, retcode, d.granted);
- if (copy_to_user((drm_dma_t *)arg, &d, sizeof(d)))
+ if (copy_to_user((drm_dma_t __user *)arg, &d, sizeof(d)))
return -EFAULT;
sarea_priv->last_dispatch = (int) hw_status[5];
@@ -1272,7 +1273,7 @@ int i810_dma_mc(struct inode *inode, struct file *filp,
dev_priv->sarea_priv;
drm_i810_mc_t mc;
- if (copy_from_user(&mc, (drm_i810_mc_t *)arg, sizeof(mc)))
+ if (copy_from_user(&mc, (drm_i810_mc_t __user *)arg, sizeof(mc)))
return -EFAULT;
if (!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) {
@@ -1314,7 +1315,7 @@ int i810_ov0_info(struct inode *inode, struct file *filp,
data.offset = dev_priv->overlay_offset;
data.physical = dev_priv->overlay_physical;
- if (copy_to_user((drm_i810_overlay_t *)arg,&data,sizeof(data)))
+ if (copy_to_user((drm_i810_overlay_t __user *)arg,&data,sizeof(data)))
return -EFAULT;
return 0;
}