summaryrefslogtreecommitdiff
path: root/bsd-core/drm_auth.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2008-09-26 15:37:21 +1000
committerDave Airlie <airlied@redhat.com>2008-09-30 14:13:49 +1000
commit972f6572652bc4a2f6c44c525e5e91f2becdb62a (patch)
tree60af3dc7e8a7c0f8bef7a3927dae161093b10dbe /bsd-core/drm_auth.c
parent89126bb58ec82511758bed36a28e698b721fb435 (diff)
parent2db8e0c8ef8c7a66460fceda129533b364f6418c (diff)
Merge remote branch 'origin/master' into modesetting-gem
Conflicts: libdrm/Makefile.am libdrm/dri_bufmgr.h linux-core/drm_irq.c linux-core/drm_sysfs.c linux-core/drm_ttm.c shared-core/i915_dma.c shared-core/i915_irq.c shared-core/nouveau_drv.h shared-core/radeon_cp.c
Diffstat (limited to 'bsd-core/drm_auth.c')
-rw-r--r--bsd-core/drm_auth.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/bsd-core/drm_auth.c b/bsd-core/drm_auth.c
index f3aafe44..b5fc5587 100644
--- a/bsd-core/drm_auth.c
+++ b/bsd-core/drm_auth.c
@@ -43,7 +43,7 @@ static int drm_hash_magic(drm_magic_t magic)
/**
* Returns the file private associated with the given magic number.
*/
-static drm_file_t *drm_find_file(struct drm_device *dev, drm_magic_t magic)
+static struct drm_file *drm_find_file(struct drm_device *dev, drm_magic_t magic)
{
drm_magic_entry_t *pt;
int hash = drm_hash_magic(magic);
@@ -63,7 +63,7 @@ static drm_file_t *drm_find_file(struct drm_device *dev, drm_magic_t magic)
* Inserts the given magic number into the hash table of used magic number
* lists.
*/
-static int drm_add_magic(struct drm_device *dev, drm_file_t *priv,
+static int drm_add_magic(struct drm_device *dev, struct drm_file *priv,
drm_magic_t magic)
{
int hash;
@@ -75,7 +75,8 @@ static int drm_add_magic(struct drm_device *dev, drm_file_t *priv,
hash = drm_hash_magic(magic);
entry = malloc(sizeof(*entry), M_DRM, M_ZERO | M_NOWAIT);
- if (!entry) return ENOMEM;
+ if (!entry)
+ return ENOMEM;
entry->magic = magic;
entry->priv = priv;
entry->next = NULL;
@@ -117,11 +118,11 @@ static int drm_remove_magic(struct drm_device *dev, drm_magic_t magic)
if (prev) {
prev->next = pt->next;
}
+ free(pt, M_DRM);
return 0;
}
}
- free(pt, M_DRM);
return EINVAL;
}
@@ -136,9 +137,9 @@ static int drm_remove_magic(struct drm_device *dev, drm_magic_t magic)
int drm_getmagic(struct drm_device *dev, void *data, struct drm_file *file_priv)
{
static drm_magic_t sequence = 0;
- drm_auth_t *auth = data;
+ struct drm_auth *auth = data;
- /* Find unique magic */
+ /* Find unique magic */
if (file_priv->magic) {
auth->magic = file_priv->magic;
} else {
@@ -167,8 +168,8 @@ int drm_getmagic(struct drm_device *dev, void *data, struct drm_file *file_priv)
int drm_authmagic(struct drm_device *dev, void *data,
struct drm_file *file_priv)
{
- drm_auth_t *auth = data;
- drm_file_t *priv;
+ struct drm_auth *auth = data;
+ struct drm_file *priv;
DRM_DEBUG("%u\n", auth->magic);