Commit 7dcd6234 authored by Dave Airlie's avatar Dave Airlie

Merge starflyer.(none):/foo/airlied/bitkeeper/linux-2.5

into starflyer.(none):/foo/airlied/bitkeeper/drm-latest
parents 26815161 4b5d2381
...@@ -516,7 +516,7 @@ int drm_ioctl( struct inode *inode, struct file *filp, ...@@ -516,7 +516,7 @@ int drm_ioctl( struct inode *inode, struct file *filp,
if (nr < DRIVER_IOCTL_COUNT) if (nr < DRIVER_IOCTL_COUNT)
ioctl = &drm_ioctls[nr]; ioctl = &drm_ioctls[nr];
else if ((nr >= DRM_COMMAND_BASE) || (nr < DRM_COMMAND_BASE + dev->driver->num_ioctls)) else if ((nr >= DRM_COMMAND_BASE) && (nr < DRM_COMMAND_BASE + dev->driver->num_ioctls))
ioctl = &dev->driver->ioctls[nr - DRM_COMMAND_BASE]; ioctl = &dev->driver->ioctls[nr - DRM_COMMAND_BASE];
else else
goto err_i1; goto err_i1;
......
...@@ -96,9 +96,6 @@ static __inline__ int mtrr_del (int reg, unsigned long base, ...@@ -96,9 +96,6 @@ static __inline__ int mtrr_del (int reg, unsigned long base,
__copy_to_user(arg1, arg2, arg3) __copy_to_user(arg1, arg2, arg3)
#define DRM_GET_USER_UNCHECKED(val, uaddr) \ #define DRM_GET_USER_UNCHECKED(val, uaddr) \
__get_user(val, uaddr) __get_user(val, uaddr)
#define DRM_PUT_USER_UNCHECKED(uaddr, val) \
__put_user(val, uaddr)
#define DRM_GET_PRIV_WITH_RETURN(_priv, _filp) _priv = _filp->private_data #define DRM_GET_PRIV_WITH_RETURN(_priv, _filp) _priv = _filp->private_data
......
...@@ -1027,25 +1027,27 @@ do { \ ...@@ -1027,25 +1027,27 @@ do { \
} while (0) } while (0)
#define OUT_RING_USER_TABLE( tab, sz ) do { \ #define OUT_RING_TABLE( tab, sz ) do { \
int _size = (sz); \ int _size = (sz); \
int __user *_tab = (tab); \ int *_tab = (int *)(tab); \
\ \
if (write + _size > mask) { \ if (write + _size > mask) { \
int i = (mask+1) - write; \ int _i = (mask+1) - write; \
if (DRM_COPY_FROM_USER_UNCHECKED( (int *)(ring+write), \ _size -= _i; \
_tab, i*4 )) \ while (_i > 0 ) { \
return DRM_ERR(EFAULT); \ *(int *)(ring + write) = *_tab++; \
write++; \
_i--; \
} \
write = 0; \ write = 0; \
_size -= i; \ _tab += _i; \
_tab += i; \
} \ } \
\ \
if (_size && DRM_COPY_FROM_USER_UNCHECKED( (int *)(ring+write), \ while (_size > 0) { \
_tab, _size*4 )) \ *(ring + write) = *_tab++; \
return DRM_ERR(EFAULT); \ write++; \
\ _size--; \
write += _size; \ } \
write &= mask; \ write &= mask; \
} while (0) } while (0)
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment