Remove unused dev->map_count. We always iterate the maplist with
authorLeif Delgass <ldelgass@users.sourceforge.net>
Thu, 24 Apr 2003 16:55:22 +0000 (16:55 +0000)
committerLeif Delgass <ldelgass@users.sourceforge.net>
Thu, 24 Apr 2003 16:55:22 +0000 (16:55 +0000)
    list_for_each() and the count is not updated or used for stats.

linux-core/drmP.h
linux-core/drm_drv.c
linux-core/drm_ioctl.c
linux/drmP.h
linux/drm_drv.h
linux/drm_ioctl.h

index 08f4faa..a4751f3 100644 (file)
@@ -554,7 +554,6 @@ typedef struct drm_device {
 
                                /* Memory management */
        drm_map_list_t    *maplist;     /* Linked list of regions          */
-       int               map_count;    /* Number of mappable regions      */
 
        drm_map_t         **context_sareas;
        int               max_context;
index 88d27e1..4a15fae 100644 (file)
@@ -316,7 +316,6 @@ static int DRM(setup)( drm_device_t *dev )
        if(dev->maplist == NULL) return -ENOMEM;
        memset(dev->maplist, 0, sizeof(*dev->maplist));
        INIT_LIST_HEAD(&dev->maplist->head);
-       dev->map_count = 0;
 
        dev->vmalist = NULL;
        dev->sigdata.lock = dev->lock.hw_lock = NULL;
index 9b1069a..62d5a6e 100644 (file)
@@ -197,7 +197,7 @@ int DRM(getmap)( struct inode *inode, struct file *filp,
        idx = map.offset;
 
        down(&dev->struct_sem);
-       if (idx < 0 || idx >= dev->map_count) {
+       if (idx < 0) {
                up(&dev->struct_sem);
                return -EINVAL;
        }
index 08f4faa..a4751f3 100644 (file)
@@ -554,7 +554,6 @@ typedef struct drm_device {
 
                                /* Memory management */
        drm_map_list_t    *maplist;     /* Linked list of regions          */
-       int               map_count;    /* Number of mappable regions      */
 
        drm_map_t         **context_sareas;
        int               max_context;
index 88d27e1..4a15fae 100644 (file)
@@ -316,7 +316,6 @@ static int DRM(setup)( drm_device_t *dev )
        if(dev->maplist == NULL) return -ENOMEM;
        memset(dev->maplist, 0, sizeof(*dev->maplist));
        INIT_LIST_HEAD(&dev->maplist->head);
-       dev->map_count = 0;
 
        dev->vmalist = NULL;
        dev->sigdata.lock = dev->lock.hw_lock = NULL;
index 9b1069a..62d5a6e 100644 (file)
@@ -197,7 +197,7 @@ int DRM(getmap)( struct inode *inode, struct file *filp,
        idx = map.offset;
 
        down(&dev->struct_sem);
-       if (idx < 0 || idx >= dev->map_count) {
+       if (idx < 0) {
                up(&dev->struct_sem);
                return -EINVAL;
        }