X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fchar%2Fdrm%2Fdrm_drv.h;h=389fc7ef2b567ca3ea30962a91a12edd19f4c5dd;hb=9bf4aaab3e101692164d49b7ca357651eb691cb6;hp=4e67b7bd451a84bca6fca4af972dd34277fc487a;hpb=9213980e6a70d8473e0ffd4b39ab5b6caaba9ff5;p=linux-2.6.git diff --git a/drivers/char/drm/drm_drv.h b/drivers/char/drm/drm_drv.h index 4e67b7bd4..389fc7ef2 100644 --- a/drivers/char/drm/drm_drv.h +++ b/drivers/char/drm/drm_drv.h @@ -243,7 +243,7 @@ static drm_ioctl_desc_t DRM(ioctls)[] = { [DRM_IOCTL_NR(DRM_IOCTL_SG_FREE)] = { DRM(sg_free), 1, 1 }, #endif -#if __HAVE_VBL_IRQ +#ifdef __HAVE_VBL_IRQ [DRM_IOCTL_NR(DRM_IOCTL_WAIT_VBLANK)] = { DRM(wait_vblank), 0, 0 }, #endif @@ -532,7 +532,7 @@ static int DRM(takedown)( drm_device_t *dev ) #endif if ( dev->lock.hw_lock ) { dev->sigdata.lock = dev->lock.hw_lock = NULL; /* SHM removed */ - dev->lock.filp = 0; + dev->lock.filp = NULL; wake_up_interruptible( &dev->lock.lock_queue ); } up( &dev->struct_sem ); @@ -741,12 +741,11 @@ module_exit( drm_cleanup ); int DRM(version)( struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg ) { + drm_version_t __user *argp = (void __user *)arg; drm_version_t version; int len; - if ( copy_from_user( &version, - (drm_version_t *)arg, - sizeof(version) ) ) + if ( copy_from_user( &version, argp, sizeof(version) ) ) return -EFAULT; #define DRM_COPY( name, value ) \ @@ -766,9 +765,7 @@ int DRM(version)( struct inode *inode, struct file *filp, DRM_COPY( version.date, DRIVER_DATE ); DRM_COPY( version.desc, DRIVER_DESC ); - if ( copy_to_user( (drm_version_t *)arg, - &version, - sizeof(version) ) ) + if ( copy_to_user( argp, &version, sizeof(version) ) ) return -EFAULT; return 0; } @@ -1048,7 +1045,7 @@ int DRM(lock)( struct inode *inode, struct file *filp, ++priv->lock_count; - if ( copy_from_user( &lock, (drm_lock_t *)arg, sizeof(lock) ) ) + if ( copy_from_user( &lock, (drm_lock_t __user *)arg, sizeof(lock) ) ) return -EFAULT; if ( lock.context == DRM_KERNEL_CONTEXT ) { @@ -1161,7 +1158,7 @@ int DRM(unlock)( struct inode *inode, struct file *filp, drm_device_t *dev = priv->dev; drm_lock_t lock; - if ( copy_from_user( &lock, (drm_lock_t *)arg, sizeof(lock) ) ) + if ( copy_from_user( &lock, (drm_lock_t __user *)arg, sizeof(lock) ) ) return -EFAULT; if ( lock.context == DRM_KERNEL_CONTEXT ) { @@ -1181,7 +1178,7 @@ int DRM(unlock)( struct inode *inode, struct file *filp, * agent to request it then we should just be able to * take it immediately and not eat the ioctl. */ - dev->lock.filp = 0; + dev->lock.filp = NULL; { __volatile__ unsigned int *plock = &dev->lock.hw_lock->lock; unsigned int old, new, prev, ctx;