drm: move "struct drm_magic_entry" to drm_auth.c
authorDavid Herrmann <dh.herrmann@gmail.com>
Fri, 29 Aug 2014 10:12:30 +0000 (12:12 +0200)
committerDave Airlie <airlied@redhat.com>
Wed, 10 Sep 2014 07:39:50 +0000 (17:39 +1000)
In drm_release(), we currently call drm_remove_magic() if the drm_file
has a drm-magic attached. Therefore, once drm_master_release() is called,
the magic-list _must_ be empty.

By dropping the no-op cleanup, we can move "struct drm_magic_entry" to
drm_auth.c and avoid exposing it to all of DRM.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Reviewed-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/drm_auth.c
drivers/gpu/drm/drm_drv.c
include/drm/drmP.h

index 3cedae12b3c1f845084894cd4c8f2fe819cb1070..708a2044c6313bfba4183c33495167a8a04859ab 100644 (file)
 
 #include <drm/drmP.h>
 
+struct drm_magic_entry {
+       struct list_head head;
+       struct drm_hash_item hash_item;
+       struct drm_file *priv;
+};
+
 /**
  * Find the file with the given magic number.
  *
index b1587e2e10fc79aceca1f37546e3e2da9f39035b..66456698447ea84dd663cd22b3e5daf9435b7c7c 100644 (file)
@@ -133,7 +133,6 @@ EXPORT_SYMBOL(drm_master_get);
 static void drm_master_destroy(struct kref *kref)
 {
        struct drm_master *master = container_of(kref, struct drm_master, refcount);
-       struct drm_magic_entry *pt, *next;
        struct drm_device *dev = master->minor->dev;
        struct drm_map_list *r_list, *list_temp;
 
@@ -154,12 +153,6 @@ static void drm_master_destroy(struct kref *kref)
                master->unique_len = 0;
        }
 
-       list_for_each_entry_safe(pt, next, &master->magicfree, head) {
-               list_del(&pt->head);
-               drm_ht_remove_item(&master->magiclist, &pt->hash_item);
-               kfree(pt);
-       }
-
        drm_ht_remove(&master->magiclist);
 
        mutex_unlock(&dev->struct_mutex);
index 11c3575345812b258665e66de69c7ff4365182a7..0fdd813821cd74ebc450512dc1728c36fd5cba89 100644 (file)
@@ -290,12 +290,6 @@ struct drm_ioctl_desc {
 #define DRM_IOCTL_DEF_DRV(ioctl, _func, _flags)                        \
        [DRM_IOCTL_NR(DRM_##ioctl)] = {.cmd = DRM_##ioctl, .func = _func, .flags = _flags, .cmd_drv = DRM_IOCTL_##ioctl, .name = #ioctl}
 
-struct drm_magic_entry {
-       struct list_head head;
-       struct drm_hash_item hash_item;
-       struct drm_file *priv;
-};
-
 /**
  * DMA buffer.
  */