drm_via_dma_init_t init;
int retcode = 0;
- DRM_COPY_FROM_USER_IOCTL(init, (drm_via_dma_init_t *) data,
+ DRM_COPY_FROM_USER_IOCTL(init, (drm_via_dma_init_t __user *) data,
sizeof(init));
switch (init.func) {
LOCK_TEST_WITH_RETURN( dev, filp );
- DRM_COPY_FROM_USER_IOCTL(cmdbuf, (drm_via_cmdbuffer_t *) data,
+ DRM_COPY_FROM_USER_IOCTL(cmdbuf, (drm_via_cmdbuffer_t __user *) data,
sizeof(cmdbuf));
DRM_DEBUG("via cmdbuffer, buf %p size %lu\n", cmdbuf.buf, cmdbuf.size);
LOCK_TEST_WITH_RETURN( dev, filp );
- DRM_COPY_FROM_USER_IOCTL(cmdbuf, (drm_via_cmdbuffer_t *) data,
+ DRM_COPY_FROM_USER_IOCTL(cmdbuf, (drm_via_cmdbuffer_t __user *) data,
sizeof(cmdbuf));
DRM_DEBUG("via_pci_cmdbuffer, buf %p size %lu\n", cmdbuf.buf,
return DRM_ERR(EFAULT);
}
- DRM_COPY_FROM_USER_IOCTL(d_siz, (drm_via_cmdbuf_size_t *) data,
+ DRM_COPY_FROM_USER_IOCTL(d_siz, (drm_via_cmdbuf_size_t __user *) data,
sizeof(d_siz));
}
d_siz.size = tmp_size;
- DRM_COPY_TO_USER_IOCTL((drm_via_cmdbuf_size_t *) data, d_siz,
+ DRM_COPY_TO_USER_IOCTL((drm_via_cmdbuf_size_t __user *) data, d_siz,
sizeof(d_siz));
return ret;
}
} drm_via_dma_init_t;
typedef struct _drm_via_cmdbuffer {
- char *buf;
+ char __user *buf;
unsigned long size;
} drm_via_cmdbuffer_t;
PMemBlock blocks;
if (size <= 0)
- return 0;
+ return NULL;
blocks = (TMemBlock *) drm_calloc(1, sizeof(TMemBlock), DRM_MEM_DRIVER);
blocks->free = 1;
return (memHeap_t *) blocks;
} else
- return 0;
+ return NULL;
}
static TMemBlock *SliceBlock(TMemBlock * p,
struct mem_block_t *heap;
int ofs, size;
int align;
- int free:1;
- int reserved:1;
+ unsigned int free:1;
+ unsigned int reserved:1;
};
typedef struct mem_block_t TMemBlock;
typedef struct mem_block_t *PMemBlock;
DRM_DEBUG("%s\n", __FUNCTION__);
- DRM_COPY_FROM_USER_IOCTL(init, (drm_via_init_t *) data, sizeof(init));
+ DRM_COPY_FROM_USER_IOCTL(init, (drm_via_init_t __user *) data,
+ sizeof(init));
switch (init.func) {
case VIA_INIT_MAP:
{
drm_via_agp_t agp;
- DRM_COPY_FROM_USER_IOCTL(agp, (drm_via_agp_t *) data, sizeof(agp));
+ DRM_COPY_FROM_USER_IOCTL(agp, (drm_via_agp_t __user *) data,
+ sizeof(agp));
AgpHeap = via_mmInit(agp.offset, agp.size);
{
drm_via_fb_t fb;
- DRM_COPY_FROM_USER_IOCTL(fb, (drm_via_fb_t *) data, sizeof(fb));
+ DRM_COPY_FROM_USER_IOCTL(fb, (drm_via_fb_t __user *) data, sizeof(fb));
FBHeap = via_mmInit(fb.offset, fb.size);
{
drm_via_mem_t mem;
- DRM_COPY_FROM_USER_IOCTL(mem, (drm_via_mem_t *) data, sizeof(mem));
+ DRM_COPY_FROM_USER_IOCTL(mem, (drm_via_mem_t __user *) data,
+ sizeof(mem));
switch (mem.type) {
case VIDEO:
if (via_fb_alloc(&mem) < 0)
return -EFAULT;
- DRM_COPY_TO_USER_IOCTL((drm_via_mem_t *) data, mem,
+ DRM_COPY_TO_USER_IOCTL((drm_via_mem_t __user *) data, mem,
sizeof(mem));
return 0;
case AGP:
if (via_agp_alloc(&mem) < 0)
return -EFAULT;
- DRM_COPY_TO_USER_IOCTL((drm_via_mem_t *) data, mem,
+ DRM_COPY_TO_USER_IOCTL((drm_via_mem_t __user *) data, mem,
sizeof(mem));
return 0;
}
{
drm_via_mem_t mem;
- DRM_COPY_FROM_USER_IOCTL(mem, (drm_via_mem_t *) data, sizeof(mem));
+ DRM_COPY_FROM_USER_IOCTL(mem, (drm_via_mem_t __user *) data,
+ sizeof(mem));
switch (mem.type) {
DRM_DEBUG("%s\n", __FUNCTION__);
- DRM_COPY_FROM_USER_IOCTL(fx, (drm_via_futex_t *) data, sizeof(fx));
+ DRM_COPY_FROM_USER_IOCTL(fx, (drm_via_futex_t __user *) data,
+ sizeof(fx));
if (fx.lock > VIA_NR_XVMC_LOCKS)
return -EFAULT;