diff options
author | Dave Airlie <airlied@linux.ie> | 2007-03-19 08:46:39 +1100 |
---|---|---|
committer | Dave Airlie <airlied@linux.ie> | 2007-03-19 08:46:39 +1100 |
commit | c991f8e049d8f39cbbb74afb81097affdc110a29 (patch) | |
tree | 34d0303afee771e64f7cce0a3f6032cb138c7ef2 /linux-core | |
parent | a2e3bae8e23398b1db25ea79cf1086a1fa735946 (diff) |
cleanup ioctl expansion code
Diffstat (limited to 'linux-core')
-rw-r--r-- | linux-core/drm_drv.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/linux-core/drm_drv.c b/linux-core/drm_drv.c index fba59b9c..bfa39ab7 100644 --- a/linux-core/drm_drv.c +++ b/linux-core/drm_drv.c @@ -591,21 +591,20 @@ int drm_ioctl(struct inode *inode, struct file *filp, current->pid, cmd, nr, (long)old_encode_dev(priv->head->device), priv->authenticated); - if (nr >= DRIVER_IOCTL_COUNT && - (nr < DRM_COMMAND_BASE || nr >= DRM_COMMAND_END)) + if ((nr >= DRIVER_IOCTL_COUNT) && + ((nr < DRM_COMMAND_BASE) || (nr >= DRM_COMMAND_END))) goto err_i1; if ((nr >= DRM_COMMAND_BASE) && (nr < DRM_COMMAND_END) && (nr < DRM_COMMAND_BASE + dev->driver->num_ioctls)) ioctl = &dev->driver->ioctls[nr - DRM_COMMAND_BASE]; - else if (nr >= DRM_COMMAND_END || nr < DRM_COMMAND_BASE) + else if ((nr >= DRM_COMMAND_END) || (nr < DRM_COMMAND_BASE)) ioctl = &drm_ioctls[nr]; - else + else goto err_i1; - - func = ioctl->func; - if ((nr == DRM_IOCTL_NR(DRM_IOCTL_DMA)) && dev->driver->dma_ioctl) /* Local override? */ + /* is there a local override? */ + if ((nr == DRM_IOCTL_NR(DRM_IOCTL_DMA)) && dev->driver->dma_ioctl) func = dev->driver->dma_ioctl; if (!func) { |