This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / drivers / char / drm / drm_context.h
index d8000cf..79b200e 100644 (file)
@@ -214,11 +214,12 @@ int DRM(getsareactx)(struct inode *inode, struct file *filp,
 {
        drm_file_t      *priv   = filp->private_data;
        drm_device_t    *dev    = priv->dev;
-       drm_ctx_priv_map_t __user *argp = (void __user *)arg;
        drm_ctx_priv_map_t request;
        drm_map_t *map;
 
-       if (copy_from_user(&request, argp, sizeof(request)))
+       if (copy_from_user(&request,
+                          (drm_ctx_priv_map_t *)arg,
+                          sizeof(request)))
                return -EFAULT;
 
        down(&dev->struct_sem);
@@ -231,7 +232,7 @@ int DRM(getsareactx)(struct inode *inode, struct file *filp,
        up(&dev->struct_sem);
 
        request.handle = map->handle;
-       if (copy_to_user(argp, &request, sizeof(request)))
+       if (copy_to_user((drm_ctx_priv_map_t *)arg, &request, sizeof(request)))
                return -EFAULT;
        return 0;
 }
@@ -259,7 +260,7 @@ int DRM(setsareactx)(struct inode *inode, struct file *filp,
        struct list_head *list;
 
        if (copy_from_user(&request,
-                          (drm_ctx_priv_map_t __user *)arg,
+                          (drm_ctx_priv_map_t *)arg,
                           sizeof(request)))
                return -EFAULT;
 
@@ -362,11 +363,10 @@ int DRM(resctx)( struct inode *inode, struct file *filp,
                 unsigned int cmd, unsigned long arg )
 {
        drm_ctx_res_t res;
-       drm_ctx_t __user *argp = (void __user *)arg;
        drm_ctx_t ctx;
        int i;
 
-       if ( copy_from_user( &res, argp, sizeof(res) ) )
+       if ( copy_from_user( &res, (drm_ctx_res_t *)arg, sizeof(res) ) )
                return -EFAULT;
 
        if ( res.count >= DRM_RESERVED_CONTEXTS ) {
@@ -380,7 +380,7 @@ int DRM(resctx)( struct inode *inode, struct file *filp,
        }
        res.count = DRM_RESERVED_CONTEXTS;
 
-       if ( copy_to_user( argp, &res, sizeof(res) ) )
+       if ( copy_to_user( (drm_ctx_res_t *)arg, &res, sizeof(res) ) )
                return -EFAULT;
        return 0;
 }
@@ -402,10 +402,9 @@ int DRM(addctx)( struct inode *inode, struct file *filp,
        drm_file_t *priv = filp->private_data;
        drm_device_t *dev = priv->dev;
        drm_ctx_list_t * ctx_entry;
-       drm_ctx_t __user *argp = (void __user *)arg;
        drm_ctx_t ctx;
 
-       if ( copy_from_user( &ctx, argp, sizeof(ctx) ) )
+       if ( copy_from_user( &ctx, (drm_ctx_t *)arg, sizeof(ctx) ) )
                return -EFAULT;
 
        ctx.handle = DRM(ctxbitmap_next)( dev );
@@ -438,7 +437,7 @@ int DRM(addctx)( struct inode *inode, struct file *filp,
        ++dev->ctx_count;
        up( &dev->ctxlist_sem );
 
-       if ( copy_to_user( argp, &ctx, sizeof(ctx) ) )
+       if ( copy_to_user( (drm_ctx_t *)arg, &ctx, sizeof(ctx) ) )
                return -EFAULT;
        return 0;
 }
@@ -462,16 +461,15 @@ int DRM(modctx)( struct inode *inode, struct file *filp,
 int DRM(getctx)( struct inode *inode, struct file *filp,
                 unsigned int cmd, unsigned long arg )
 {
-       drm_ctx_t __user *argp = (void __user *)arg;
        drm_ctx_t ctx;
 
-       if ( copy_from_user( &ctx, argp, sizeof(ctx) ) )
+       if ( copy_from_user( &ctx, (drm_ctx_t*)arg, sizeof(ctx) ) )
                return -EFAULT;
 
        /* This is 0, because we don't handle any context flags */
        ctx.flags = 0;
 
-       if ( copy_to_user( argp, &ctx, sizeof(ctx) ) )
+       if ( copy_to_user( (drm_ctx_t*)arg, &ctx, sizeof(ctx) ) )
                return -EFAULT;
        return 0;
 }
@@ -494,7 +492,7 @@ int DRM(switchctx)( struct inode *inode, struct file *filp,
        drm_device_t *dev = priv->dev;
        drm_ctx_t ctx;
 
-       if ( copy_from_user( &ctx, (drm_ctx_t __user *)arg, sizeof(ctx) ) )
+       if ( copy_from_user( &ctx, (drm_ctx_t *)arg, sizeof(ctx) ) )
                return -EFAULT;
 
        DRM_DEBUG( "%d\n", ctx.handle );
@@ -519,7 +517,7 @@ int DRM(newctx)( struct inode *inode, struct file *filp,
        drm_device_t *dev = priv->dev;
        drm_ctx_t ctx;
 
-       if ( copy_from_user( &ctx, (drm_ctx_t __user *)arg, sizeof(ctx) ) )
+       if ( copy_from_user( &ctx, (drm_ctx_t *)arg, sizeof(ctx) ) )
                return -EFAULT;
 
        DRM_DEBUG( "%d\n", ctx.handle );
@@ -546,7 +544,7 @@ int DRM(rmctx)( struct inode *inode, struct file *filp,
        drm_device_t *dev = priv->dev;
        drm_ctx_t ctx;
 
-       if ( copy_from_user( &ctx, (drm_ctx_t __user *)arg, sizeof(ctx) ) )
+       if ( copy_from_user( &ctx, (drm_ctx_t *)arg, sizeof(ctx) ) )
                return -EFAULT;
 
        DRM_DEBUG( "%d\n", ctx.handle );