[PATCH] drm: via: fix sparse warnings
authorAlexey Dobriyan <adobriyan@gmail.com>
Wed, 27 Jul 2005 18:43:56 +0000 (11:43 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Wed, 27 Jul 2005 23:25:54 +0000 (16:25 -0700)
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Dave Airlie <airlied@linux.ie>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/char/drm/via_dma.c
drivers/char/drm/via_drm.h
drivers/char/drm/via_ds.c
drivers/char/drm/via_ds.h
drivers/char/drm/via_map.c
drivers/char/drm/via_mm.c
drivers/char/drm/via_video.c

index 82f839451622d5994069152d5f08fcd9ed29adb9..4f60f7f4193dddeb4243fd0067426e103d451039 100644 (file)
@@ -231,7 +231,7 @@ int via_dma_init(DRM_IOCTL_ARGS)
        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) {
@@ -343,7 +343,7 @@ int via_cmdbuffer(DRM_IOCTL_ARGS)
 
        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);
@@ -386,7 +386,7 @@ int via_pci_cmdbuffer(DRM_IOCTL_ARGS)
 
        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,
@@ -701,7 +701,7 @@ via_cmdbuf_size(DRM_IOCTL_ARGS)
                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));
 
 
@@ -735,7 +735,7 @@ via_cmdbuf_size(DRM_IOCTL_ARGS)
        }
        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;
 }
index 4588c9bd181603a61de56d821a44941ec6b020dd..be346bb0a26a3a8fea0dcd434b69a07548560c4e 100644 (file)
@@ -158,7 +158,7 @@ typedef struct _drm_via_dma_init {
 } drm_via_dma_init_t;
 
 typedef struct _drm_via_cmdbuffer {
-       char *buf;
+       char __user *buf;
        unsigned long size;
 } drm_via_cmdbuffer_t;
 
index daf3df75a20e8b191391e796289866f0015d8f1f..5c71e089246c75a713146248a8c04e3f9d617bd3 100644 (file)
@@ -133,7 +133,7 @@ memHeap_t *via_mmInit(int ofs, int size)
        PMemBlock blocks;
 
        if (size <= 0)
-               return 0;
+               return NULL;
 
        blocks = (TMemBlock *) drm_calloc(1, sizeof(TMemBlock), DRM_MEM_DRIVER);
 
@@ -143,7 +143,7 @@ memHeap_t *via_mmInit(int ofs, int size)
                blocks->free = 1;
                return (memHeap_t *) blocks;
        } else
-               return 0;
+               return NULL;
 }
 
 static TMemBlock *SliceBlock(TMemBlock * p,
index be9c7f9f1aee73e1082385e5998f7013ff04419f..d2bb9f37ca38374f8b5519ad685b6bb4406bd5c4 100644 (file)
@@ -61,8 +61,8 @@ struct mem_block_t {
        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;
index 0be829b6ec6579917527bab8e125f07a8788ce0a..bb171139e73704e243daf317bdd8c1d6df9a332e 100644 (file)
@@ -95,7 +95,8 @@ int via_map_init(DRM_IOCTL_ARGS)
 
        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:
index c22712f44d42423f970a88c89fbb6f43d6909c33..13921f3c0ec26cc6b7abeb2a5d77c27c707ed05e 100644 (file)
@@ -76,7 +76,8 @@ int via_agp_init(DRM_IOCTL_ARGS)
 {
        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);
 
@@ -92,7 +93,7 @@ int via_fb_init(DRM_IOCTL_ARGS)
 {
        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);
 
@@ -193,19 +194,20 @@ int via_mem_alloc(DRM_IOCTL_ARGS)
 {
        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;
        }
@@ -289,7 +291,8 @@ int via_mem_free(DRM_IOCTL_ARGS)
 {
        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) {
 
index 37a61c67b2926abaa2254c8f6917e2a01fc44f27..1e2d444587bf03facd5ab29832a24c32a1317ef0 100644 (file)
@@ -76,7 +76,8 @@ via_decoder_futex(DRM_IOCTL_ARGS)
 
        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;