aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/drm
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2005-07-27 14:43:56 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-07-27 19:25:54 -0400
commitbbaf364103cee15c895e2086723d0ad9ef47ae99 (patch)
tree50ba44d1a55f00c2d328a6943acc4495337b7020 /drivers/char/drm
parentdb1de1595d03d3ddea3e0548b20decb0a32e4258 (diff)
[PATCH] drm: via: fix sparse warnings
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>
Diffstat (limited to 'drivers/char/drm')
-rw-r--r--drivers/char/drm/via_dma.c10
-rw-r--r--drivers/char/drm/via_drm.h2
-rw-r--r--drivers/char/drm/via_ds.c4
-rw-r--r--drivers/char/drm/via_ds.h4
-rw-r--r--drivers/char/drm/via_map.c3
-rw-r--r--drivers/char/drm/via_mm.c15
-rw-r--r--drivers/char/drm/via_video.c3
7 files changed, 23 insertions, 18 deletions
diff --git a/drivers/char/drm/via_dma.c b/drivers/char/drm/via_dma.c
index 82f839451622..4f60f7f4193d 100644
--- a/drivers/char/drm/via_dma.c
+++ b/drivers/char/drm/via_dma.c
@@ -231,7 +231,7 @@ int via_dma_init(DRM_IOCTL_ARGS)
231 drm_via_dma_init_t init; 231 drm_via_dma_init_t init;
232 int retcode = 0; 232 int retcode = 0;
233 233
234 DRM_COPY_FROM_USER_IOCTL(init, (drm_via_dma_init_t *) data, 234 DRM_COPY_FROM_USER_IOCTL(init, (drm_via_dma_init_t __user *) data,
235 sizeof(init)); 235 sizeof(init));
236 236
237 switch (init.func) { 237 switch (init.func) {
@@ -343,7 +343,7 @@ int via_cmdbuffer(DRM_IOCTL_ARGS)
343 343
344 LOCK_TEST_WITH_RETURN( dev, filp ); 344 LOCK_TEST_WITH_RETURN( dev, filp );
345 345
346 DRM_COPY_FROM_USER_IOCTL(cmdbuf, (drm_via_cmdbuffer_t *) data, 346 DRM_COPY_FROM_USER_IOCTL(cmdbuf, (drm_via_cmdbuffer_t __user *) data,
347 sizeof(cmdbuf)); 347 sizeof(cmdbuf));
348 348
349 DRM_DEBUG("via cmdbuffer, buf %p size %lu\n", cmdbuf.buf, cmdbuf.size); 349 DRM_DEBUG("via cmdbuffer, buf %p size %lu\n", cmdbuf.buf, cmdbuf.size);
@@ -386,7 +386,7 @@ int via_pci_cmdbuffer(DRM_IOCTL_ARGS)
386 386
387 LOCK_TEST_WITH_RETURN( dev, filp ); 387 LOCK_TEST_WITH_RETURN( dev, filp );
388 388
389 DRM_COPY_FROM_USER_IOCTL(cmdbuf, (drm_via_cmdbuffer_t *) data, 389 DRM_COPY_FROM_USER_IOCTL(cmdbuf, (drm_via_cmdbuffer_t __user *) data,
390 sizeof(cmdbuf)); 390 sizeof(cmdbuf));
391 391
392 DRM_DEBUG("via_pci_cmdbuffer, buf %p size %lu\n", cmdbuf.buf, 392 DRM_DEBUG("via_pci_cmdbuffer, buf %p size %lu\n", cmdbuf.buf,
@@ -701,7 +701,7 @@ via_cmdbuf_size(DRM_IOCTL_ARGS)
701 return DRM_ERR(EFAULT); 701 return DRM_ERR(EFAULT);
702 } 702 }
703 703
704 DRM_COPY_FROM_USER_IOCTL(d_siz, (drm_via_cmdbuf_size_t *) data, 704 DRM_COPY_FROM_USER_IOCTL(d_siz, (drm_via_cmdbuf_size_t __user *) data,
705 sizeof(d_siz)); 705 sizeof(d_siz));
706 706
707 707
@@ -735,7 +735,7 @@ via_cmdbuf_size(DRM_IOCTL_ARGS)
735 } 735 }
736 d_siz.size = tmp_size; 736 d_siz.size = tmp_size;
737 737
738 DRM_COPY_TO_USER_IOCTL((drm_via_cmdbuf_size_t *) data, d_siz, 738 DRM_COPY_TO_USER_IOCTL((drm_via_cmdbuf_size_t __user *) data, d_siz,
739 sizeof(d_siz)); 739 sizeof(d_siz));
740 return ret; 740 return ret;
741} 741}
diff --git a/drivers/char/drm/via_drm.h b/drivers/char/drm/via_drm.h
index 4588c9bd1816..be346bb0a26a 100644
--- a/drivers/char/drm/via_drm.h
+++ b/drivers/char/drm/via_drm.h
@@ -158,7 +158,7 @@ typedef struct _drm_via_dma_init {
158} drm_via_dma_init_t; 158} drm_via_dma_init_t;
159 159
160typedef struct _drm_via_cmdbuffer { 160typedef struct _drm_via_cmdbuffer {
161 char *buf; 161 char __user *buf;
162 unsigned long size; 162 unsigned long size;
163} drm_via_cmdbuffer_t; 163} drm_via_cmdbuffer_t;
164 164
diff --git a/drivers/char/drm/via_ds.c b/drivers/char/drm/via_ds.c
index daf3df75a20e..5c71e089246c 100644
--- a/drivers/char/drm/via_ds.c
+++ b/drivers/char/drm/via_ds.c
@@ -133,7 +133,7 @@ memHeap_t *via_mmInit(int ofs, int size)
133 PMemBlock blocks; 133 PMemBlock blocks;
134 134
135 if (size <= 0) 135 if (size <= 0)
136 return 0; 136 return NULL;
137 137
138 blocks = (TMemBlock *) drm_calloc(1, sizeof(TMemBlock), DRM_MEM_DRIVER); 138 blocks = (TMemBlock *) drm_calloc(1, sizeof(TMemBlock), DRM_MEM_DRIVER);
139 139
@@ -143,7 +143,7 @@ memHeap_t *via_mmInit(int ofs, int size)
143 blocks->free = 1; 143 blocks->free = 1;
144 return (memHeap_t *) blocks; 144 return (memHeap_t *) blocks;
145 } else 145 } else
146 return 0; 146 return NULL;
147} 147}
148 148
149static TMemBlock *SliceBlock(TMemBlock * p, 149static TMemBlock *SliceBlock(TMemBlock * p,
diff --git a/drivers/char/drm/via_ds.h b/drivers/char/drm/via_ds.h
index be9c7f9f1aee..d2bb9f37ca38 100644
--- a/drivers/char/drm/via_ds.h
+++ b/drivers/char/drm/via_ds.h
@@ -61,8 +61,8 @@ struct mem_block_t {
61 struct mem_block_t *heap; 61 struct mem_block_t *heap;
62 int ofs, size; 62 int ofs, size;
63 int align; 63 int align;
64 int free:1; 64 unsigned int free:1;
65 int reserved:1; 65 unsigned int reserved:1;
66}; 66};
67typedef struct mem_block_t TMemBlock; 67typedef struct mem_block_t TMemBlock;
68typedef struct mem_block_t *PMemBlock; 68typedef struct mem_block_t *PMemBlock;
diff --git a/drivers/char/drm/via_map.c b/drivers/char/drm/via_map.c
index 0be829b6ec65..bb171139e737 100644
--- a/drivers/char/drm/via_map.c
+++ b/drivers/char/drm/via_map.c
@@ -95,7 +95,8 @@ int via_map_init(DRM_IOCTL_ARGS)
95 95
96 DRM_DEBUG("%s\n", __FUNCTION__); 96 DRM_DEBUG("%s\n", __FUNCTION__);
97 97
98 DRM_COPY_FROM_USER_IOCTL(init, (drm_via_init_t *) data, sizeof(init)); 98 DRM_COPY_FROM_USER_IOCTL(init, (drm_via_init_t __user *) data,
99 sizeof(init));
99 100
100 switch (init.func) { 101 switch (init.func) {
101 case VIA_INIT_MAP: 102 case VIA_INIT_MAP:
diff --git a/drivers/char/drm/via_mm.c b/drivers/char/drm/via_mm.c
index c22712f44d42..13921f3c0ec2 100644
--- a/drivers/char/drm/via_mm.c
+++ b/drivers/char/drm/via_mm.c
@@ -76,7 +76,8 @@ int via_agp_init(DRM_IOCTL_ARGS)
76{ 76{
77 drm_via_agp_t agp; 77 drm_via_agp_t agp;
78 78
79 DRM_COPY_FROM_USER_IOCTL(agp, (drm_via_agp_t *) data, sizeof(agp)); 79 DRM_COPY_FROM_USER_IOCTL(agp, (drm_via_agp_t __user *) data,
80 sizeof(agp));
80 81
81 AgpHeap = via_mmInit(agp.offset, agp.size); 82 AgpHeap = via_mmInit(agp.offset, agp.size);
82 83
@@ -92,7 +93,7 @@ int via_fb_init(DRM_IOCTL_ARGS)
92{ 93{
93 drm_via_fb_t fb; 94 drm_via_fb_t fb;
94 95
95 DRM_COPY_FROM_USER_IOCTL(fb, (drm_via_fb_t *) data, sizeof(fb)); 96 DRM_COPY_FROM_USER_IOCTL(fb, (drm_via_fb_t __user *) data, sizeof(fb));
96 97
97 FBHeap = via_mmInit(fb.offset, fb.size); 98 FBHeap = via_mmInit(fb.offset, fb.size);
98 99
@@ -193,19 +194,20 @@ int via_mem_alloc(DRM_IOCTL_ARGS)
193{ 194{
194 drm_via_mem_t mem; 195 drm_via_mem_t mem;
195 196
196 DRM_COPY_FROM_USER_IOCTL(mem, (drm_via_mem_t *) data, sizeof(mem)); 197 DRM_COPY_FROM_USER_IOCTL(mem, (drm_via_mem_t __user *) data,
198 sizeof(mem));
197 199
198 switch (mem.type) { 200 switch (mem.type) {
199 case VIDEO: 201 case VIDEO:
200 if (via_fb_alloc(&mem) < 0) 202 if (via_fb_alloc(&mem) < 0)
201 return -EFAULT; 203 return -EFAULT;
202 DRM_COPY_TO_USER_IOCTL((drm_via_mem_t *) data, mem, 204 DRM_COPY_TO_USER_IOCTL((drm_via_mem_t __user *) data, mem,
203 sizeof(mem)); 205 sizeof(mem));
204 return 0; 206 return 0;
205 case AGP: 207 case AGP:
206 if (via_agp_alloc(&mem) < 0) 208 if (via_agp_alloc(&mem) < 0)
207 return -EFAULT; 209 return -EFAULT;
208 DRM_COPY_TO_USER_IOCTL((drm_via_mem_t *) data, mem, 210 DRM_COPY_TO_USER_IOCTL((drm_via_mem_t __user *) data, mem,
209 sizeof(mem)); 211 sizeof(mem));
210 return 0; 212 return 0;
211 } 213 }
@@ -289,7 +291,8 @@ int via_mem_free(DRM_IOCTL_ARGS)
289{ 291{
290 drm_via_mem_t mem; 292 drm_via_mem_t mem;
291 293
292 DRM_COPY_FROM_USER_IOCTL(mem, (drm_via_mem_t *) data, sizeof(mem)); 294 DRM_COPY_FROM_USER_IOCTL(mem, (drm_via_mem_t __user *) data,
295 sizeof(mem));
293 296
294 switch (mem.type) { 297 switch (mem.type) {
295 298
diff --git a/drivers/char/drm/via_video.c b/drivers/char/drm/via_video.c
index 37a61c67b292..1e2d444587bf 100644
--- a/drivers/char/drm/via_video.c
+++ b/drivers/char/drm/via_video.c
@@ -76,7 +76,8 @@ via_decoder_futex(DRM_IOCTL_ARGS)
76 76
77 DRM_DEBUG("%s\n", __FUNCTION__); 77 DRM_DEBUG("%s\n", __FUNCTION__);
78 78
79 DRM_COPY_FROM_USER_IOCTL(fx, (drm_via_futex_t *) data, sizeof(fx)); 79 DRM_COPY_FROM_USER_IOCTL(fx, (drm_via_futex_t __user *) data,
80 sizeof(fx));
80 81
81 if (fx.lock > VIA_NR_XVMC_LOCKS) 82 if (fx.lock > VIA_NR_XVMC_LOCKS)
82 return -EFAULT; 83 return -EFAULT;