]> git.hungrycats.org Git - linux/commitdiff
Add some missing NULL->0 and __user annotiations
authorDave Airlie <airlied@starflyer.(none)>
Sat, 28 Aug 2004 20:05:33 +0000 (06:05 +1000)
committerDave Airlie <airlied@starflyer.(none)>
Sat, 28 Aug 2004 20:05:33 +0000 (06:05 +1000)
Signed-off-by: Dave Airlie <airlied@linux.ie>
drivers/char/drm/i915_dma.c
drivers/char/drm/i915_mem.c
drivers/char/drm/sis_mm.c

index e1cefa706c458b18f98ead343c0d32d4a1f71bdb..6942d30a22352405279ece420c8d5975fd72644e 100644 (file)
@@ -429,7 +429,7 @@ static int i915_dispatch_batchbuffer(drm_device_t * dev,
                                     drm_i915_batchbuffer_t * batch)
 {
        drm_i915_private_t *dev_priv = dev->dev_private;
-       drm_clip_rect_t *boxes = batch->cliprects;
+       drm_clip_rect_t __user *boxes = batch->cliprects;
        int nbox = batch->num_cliprects;
        int i = 0, count;
        RING_LOCALS;
index 8f77c650d08bd17eac04babdcea8a94304f27561..42c1e35358667f89e7e24b7ef4df8730d454054c 100644 (file)
@@ -80,7 +80,7 @@ static struct mem_block *split_block(struct mem_block *p, int start, int size,
                        goto out;
                newblock->start = start;
                newblock->size = p->size - (start - p->start);
-               newblock->filp = 0;
+               newblock->filp = NULL;
                newblock->next = p->next;
                newblock->prev = p;
                p->next->prev = newblock;
@@ -96,7 +96,7 @@ static struct mem_block *split_block(struct mem_block *p, int start, int size,
                        goto out;
                newblock->start = start + size;
                newblock->size = p->size - size;
-               newblock->filp = 0;
+               newblock->filp = NULL;
                newblock->next = p->next;
                newblock->prev = p;
                p->next->prev = newblock;
@@ -118,7 +118,7 @@ static struct mem_block *alloc_block(struct mem_block *heap, int size,
 
        for (p = heap->next; p != heap; p = p->next) {
                int start = (p->start + mask) & ~mask;
-               if (p->filp == 0 && start + size <= p->start + p->size)
+               if (p->filp == NULL && start + size <= p->start + p->size)
                        return split_block(p, start, size, filp);
        }
 
@@ -138,12 +138,12 @@ static struct mem_block *find_block(struct mem_block *heap, int start)
 
 static void free_block(struct mem_block *p)
 {
-       p->filp = 0;
+       p->filp = NULL;
 
        /* Assumes a single contiguous range.  Needs a special filp in
         * 'heap' to stop it being subsumed.
         */
-       if (p->next->filp == 0) {
+       if (p->next->filp == NULL) {
                struct mem_block *q = p->next;
                p->size += q->size;
                p->next = q->next;
@@ -151,7 +151,7 @@ static void free_block(struct mem_block *p)
                DRM_FREE(q, sizeof(*q));
        }
 
-       if (p->prev->filp == 0) {
+       if (p->prev->filp == NULL) {
                struct mem_block *q = p->prev;
                q->size += p->size;
                q->next = p->next;
@@ -177,7 +177,7 @@ static int init_heap(struct mem_block **heap, int start, int size)
 
        blocks->start = start;
        blocks->size = size;
-       blocks->filp = 0;
+       blocks->filp = NULL;
        blocks->next = blocks->prev = *heap;
 
        memset(*heap, 0, sizeof(**heap));
@@ -197,7 +197,7 @@ void i915_mem_release(drm_device_t * dev, DRMFILE filp, struct mem_block *heap)
 
        for (p = heap->next; p != heap; p = p->next) {
                if (p->filp == filp) {
-                       p->filp = 0;
+                       p->filp = NULL;
                        mark_block(dev, p, 0);
                }
        }
@@ -206,7 +206,7 @@ void i915_mem_release(drm_device_t * dev, DRMFILE filp, struct mem_block *heap)
         * 'heap' to stop it being subsumed.
         */
        for (p = heap->next; p != heap; p = p->next) {
-               while (p->filp == 0 && p->next->filp == 0) {
+               while (p->filp == NULL && p->next->filp == NULL) {
                        struct mem_block *q = p->next;
                        p->size += q->size;
                        p->next = q->next;
index 5d29b40be70ab1c5d888db8d7a0e0207eaed7002..331b81fbf3152f6306e47a374871dfa6be30b537 100644 (file)
@@ -90,9 +90,10 @@ int sis_fb_alloc( DRM_IOCTL_ARGS )
 {
        drm_sis_mem_t fb;
        struct sis_memreq req;
+       drm_sis_mem_t __user *argp = (void __user *)data;
        int retval = 0;
 
-       DRM_COPY_FROM_USER_IOCTL(fb, (drm_sis_mem_t *)data, sizeof(fb));
+       DRM_COPY_FROM_USER_IOCTL(fb, argp, sizeof(fb));
 
        req.size = fb.size;
        sis_malloc(&req);
@@ -111,7 +112,7 @@ int sis_fb_alloc( DRM_IOCTL_ARGS )
                fb.free = 0;
        }
 
-       DRM_COPY_TO_USER_IOCTL((drm_sis_mem_t *)data, fb, sizeof(fb));
+       DRM_COPY_TO_USER_IOCTL(argp, fb, sizeof(fb));
 
        DRM_DEBUG("alloc fb, size = %d, offset = %d\n", fb.size, req.offset);
 
@@ -123,7 +124,7 @@ int sis_fb_free( DRM_IOCTL_ARGS )
        drm_sis_mem_t fb;
        int retval = 0;
 
-       DRM_COPY_FROM_USER_IOCTL(fb, (drm_sis_mem_t *)data, sizeof(fb));
+       DRM_COPY_FROM_USER_IOCTL(fb, (drm_sis_mem_t __user *)data, sizeof(fb));
 
        if (!fb.free)
                return DRM_ERR(EINVAL);