aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/drm/drm_auth.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/drm/drm_auth.c')
-rw-r--r--drivers/char/drm/drm_auth.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/drivers/char/drm/drm_auth.c b/drivers/char/drm/drm_auth.c
index c7b19d35bcd6..7f777da872cd 100644
--- a/drivers/char/drm/drm_auth.c
+++ b/drivers/char/drm/drm_auth.c
@@ -45,15 +45,15 @@
45 * the one with matching magic number, while holding the drm_device::struct_mutex 45 * the one with matching magic number, while holding the drm_device::struct_mutex
46 * lock. 46 * lock.
47 */ 47 */
48static drm_file_t *drm_find_file(drm_device_t * dev, drm_magic_t magic) 48static struct drm_file *drm_find_file(struct drm_device * dev, drm_magic_t magic)
49{ 49{
50 drm_file_t *retval = NULL; 50 struct drm_file *retval = NULL;
51 drm_magic_entry_t *pt; 51 struct drm_magic_entry *pt;
52 drm_hash_item_t *hash; 52 struct drm_hash_item *hash;
53 53
54 mutex_lock(&dev->struct_mutex); 54 mutex_lock(&dev->struct_mutex);
55 if (!drm_ht_find_item(&dev->magiclist, (unsigned long)magic, &hash)) { 55 if (!drm_ht_find_item(&dev->magiclist, (unsigned long)magic, &hash)) {
56 pt = drm_hash_entry(hash, drm_magic_entry_t, hash_item); 56 pt = drm_hash_entry(hash, struct drm_magic_entry, hash_item);
57 retval = pt->priv; 57 retval = pt->priv;
58 } 58 }
59 mutex_unlock(&dev->struct_mutex); 59 mutex_unlock(&dev->struct_mutex);
@@ -71,10 +71,10 @@ static drm_file_t *drm_find_file(drm_device_t * dev, drm_magic_t magic)
71 * associated the magic number hash key in drm_device::magiclist, while holding 71 * associated the magic number hash key in drm_device::magiclist, while holding
72 * the drm_device::struct_mutex lock. 72 * the drm_device::struct_mutex lock.
73 */ 73 */
74static int drm_add_magic(drm_device_t * dev, drm_file_t * priv, 74static int drm_add_magic(struct drm_device * dev, struct drm_file * priv,
75 drm_magic_t magic) 75 drm_magic_t magic)
76{ 76{
77 drm_magic_entry_t *entry; 77 struct drm_magic_entry *entry;
78 78
79 DRM_DEBUG("%d\n", magic); 79 DRM_DEBUG("%d\n", magic);
80 80
@@ -102,10 +102,10 @@ static int drm_add_magic(drm_device_t * dev, drm_file_t * priv,
102 * Searches and unlinks the entry in drm_device::magiclist with the magic 102 * Searches and unlinks the entry in drm_device::magiclist with the magic
103 * number hash key, while holding the drm_device::struct_mutex lock. 103 * number hash key, while holding the drm_device::struct_mutex lock.
104 */ 104 */
105static int drm_remove_magic(drm_device_t * dev, drm_magic_t magic) 105static int drm_remove_magic(struct drm_device * dev, drm_magic_t magic)
106{ 106{
107 drm_magic_entry_t *pt; 107 struct drm_magic_entry *pt;
108 drm_hash_item_t *hash; 108 struct drm_hash_item *hash;
109 109
110 DRM_DEBUG("%d\n", magic); 110 DRM_DEBUG("%d\n", magic);
111 111
@@ -114,7 +114,7 @@ static int drm_remove_magic(drm_device_t * dev, drm_magic_t magic)
114 mutex_unlock(&dev->struct_mutex); 114 mutex_unlock(&dev->struct_mutex);
115 return -EINVAL; 115 return -EINVAL;
116 } 116 }
117 pt = drm_hash_entry(hash, drm_magic_entry_t, hash_item); 117 pt = drm_hash_entry(hash, struct drm_magic_entry, hash_item);
118 drm_ht_remove_item(&dev->magiclist, hash); 118 drm_ht_remove_item(&dev->magiclist, hash);
119 list_del(&pt->head); 119 list_del(&pt->head);
120 mutex_unlock(&dev->struct_mutex); 120 mutex_unlock(&dev->struct_mutex);
@@ -142,9 +142,9 @@ int drm_getmagic(struct inode *inode, struct file *filp,
142{ 142{
143 static drm_magic_t sequence = 0; 143 static drm_magic_t sequence = 0;
144 static DEFINE_SPINLOCK(lock); 144 static DEFINE_SPINLOCK(lock);
145 drm_file_t *priv = filp->private_data; 145 struct drm_file *priv = filp->private_data;
146 drm_device_t *dev = priv->head->dev; 146 struct drm_device *dev = priv->head->dev;
147 drm_auth_t auth; 147 struct drm_auth auth;
148 148
149 /* Find unique magic */ 149 /* Find unique magic */
150 if (priv->magic) { 150 if (priv->magic) {
@@ -162,7 +162,7 @@ int drm_getmagic(struct inode *inode, struct file *filp,
162 } 162 }
163 163
164 DRM_DEBUG("%u\n", auth.magic); 164 DRM_DEBUG("%u\n", auth.magic);
165 if (copy_to_user((drm_auth_t __user *) arg, &auth, sizeof(auth))) 165 if (copy_to_user((struct drm_auth __user *) arg, &auth, sizeof(auth)))
166 return -EFAULT; 166 return -EFAULT;
167 return 0; 167 return 0;
168} 168}
@@ -181,12 +181,12 @@ int drm_getmagic(struct inode *inode, struct file *filp,
181int drm_authmagic(struct inode *inode, struct file *filp, 181int drm_authmagic(struct inode *inode, struct file *filp,
182 unsigned int cmd, unsigned long arg) 182 unsigned int cmd, unsigned long arg)
183{ 183{
184 drm_file_t *priv = filp->private_data; 184 struct drm_file *priv = filp->private_data;
185 drm_device_t *dev = priv->head->dev; 185 struct drm_device *dev = priv->head->dev;
186 drm_auth_t auth; 186 struct drm_auth auth;
187 drm_file_t *file; 187 struct drm_file *file;
188 188
189 if (copy_from_user(&auth, (drm_auth_t __user *) arg, sizeof(auth))) 189 if (copy_from_user(&auth, (struct drm_auth __user *) arg, sizeof(auth)))
190 return -EFAULT; 190 return -EFAULT;
191 DRM_DEBUG("%u\n", auth.magic); 191 DRM_DEBUG("%u\n", auth.magic);
192 if ((file = drm_find_file(dev, auth.magic))) { 192 if ((file = drm_find_file(dev, auth.magic))) {