diff options
Diffstat (limited to 'linux/drm_scatter.h')
-rw-r--r-- | linux/drm_scatter.h | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/linux/drm_scatter.h b/linux/drm_scatter.h index 45a30fc3..4aaf89d4 100644 --- a/linux/drm_scatter.h +++ b/linux/drm_scatter.h @@ -67,6 +67,7 @@ int DRM(sg_alloc)( struct inode *inode, struct file *filp, { drm_file_t *priv = filp->private_data; drm_device_t *dev = priv->dev; + drm_scatter_gather_t __user *argp = (void __user *)arg; drm_scatter_gather_t request; drm_sg_mem_t *entry; unsigned long pages, i, j; @@ -76,9 +77,7 @@ int DRM(sg_alloc)( struct inode *inode, struct file *filp, if ( dev->sg ) return -EINVAL; - if ( copy_from_user( &request, - (drm_scatter_gather_t *)arg, - sizeof(request) ) ) + if ( copy_from_user( &request, argp, sizeof(request) ) ) return -EFAULT; entry = DRM(alloc)( sizeof(*entry), DRM_MEM_SGLISTS ); @@ -146,9 +145,7 @@ int DRM(sg_alloc)( struct inode *inode, struct file *filp, request.handle = entry->handle; - if ( copy_to_user( (drm_scatter_gather_t *)arg, - &request, - sizeof(request) ) ) { + if ( copy_to_user( argp, &request, sizeof(request) ) ) { DRM(sg_cleanup)( entry ); return -EFAULT; } @@ -211,7 +208,7 @@ int DRM(sg_free)( struct inode *inode, struct file *filp, drm_sg_mem_t *entry; if ( copy_from_user( &request, - (drm_scatter_gather_t *)arg, + (drm_scatter_gather_t __user *)arg, sizeof(request) ) ) return -EFAULT; |