drm: fixup whitespace and style for Linux kernel import
parent
35066b51ef
commit
248d1a32a2
|
@ -36,8 +36,7 @@
|
|||
#include "drm_hashtab.h"
|
||||
#include <linux/hash.h>
|
||||
|
||||
int
|
||||
drm_ht_create(drm_open_hash_t *ht, unsigned int order)
|
||||
int drm_ht_create(drm_open_hash_t *ht, unsigned int order)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
|
@ -55,8 +54,7 @@ drm_ht_create(drm_open_hash_t *ht, unsigned int order)
|
|||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
drm_ht_verbose_list(drm_open_hash_t *ht, unsigned long key)
|
||||
void drm_ht_verbose_list(drm_open_hash_t *ht, unsigned long key)
|
||||
{
|
||||
drm_hash_item_t *entry;
|
||||
struct hlist_head *h_list;
|
||||
|
@ -73,8 +71,8 @@ drm_ht_verbose_list(drm_open_hash_t *ht, unsigned long key)
|
|||
}
|
||||
}
|
||||
|
||||
static struct hlist_node
|
||||
*drm_ht_find_key(drm_open_hash_t *ht, unsigned long key)
|
||||
static struct hlist_node *drm_ht_find_key(drm_open_hash_t *ht,
|
||||
unsigned long key)
|
||||
{
|
||||
drm_hash_item_t *entry;
|
||||
struct hlist_head *h_list;
|
||||
|
@ -94,8 +92,7 @@ static struct hlist_node
|
|||
}
|
||||
|
||||
|
||||
int
|
||||
drm_ht_insert_item(drm_open_hash_t *ht, drm_hash_item_t *item)
|
||||
int drm_ht_insert_item(drm_open_hash_t *ht, drm_hash_item_t *item)
|
||||
{
|
||||
drm_hash_item_t *entry;
|
||||
struct hlist_head *h_list;
|
||||
|
@ -123,11 +120,10 @@ drm_ht_insert_item(drm_open_hash_t *ht, drm_hash_item_t *item)
|
|||
}
|
||||
|
||||
/*
|
||||
* Just insert an item and return any "bits" bit key that hasn't been used before.
|
||||
* Just insert an item and return any "bits" bit key that hasn't been
|
||||
* used before.
|
||||
*/
|
||||
|
||||
int
|
||||
drm_ht_just_insert_please(drm_open_hash_t *ht, drm_hash_item_t *item,
|
||||
int drm_ht_just_insert_please(drm_open_hash_t *ht, drm_hash_item_t *item,
|
||||
unsigned long seed, int bits, int shift,
|
||||
unsigned long add)
|
||||
{
|
||||
|
@ -137,7 +133,7 @@ drm_ht_just_insert_please(drm_open_hash_t *ht, drm_hash_item_t *item,
|
|||
|
||||
unshifted_key = hash_long(seed, bits);
|
||||
first = unshifted_key;
|
||||
do{
|
||||
do {
|
||||
item->key = (unshifted_key << shift) + add;
|
||||
ret = drm_ht_insert_item(ht, item);
|
||||
if (ret)
|
||||
|
@ -151,8 +147,8 @@ drm_ht_just_insert_please(drm_open_hash_t *ht, drm_hash_item_t *item,
|
|||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
drm_ht_find_item(drm_open_hash_t *ht, unsigned long key, drm_hash_item_t **item)
|
||||
int drm_ht_find_item(drm_open_hash_t *ht, unsigned long key,
|
||||
drm_hash_item_t **item)
|
||||
{
|
||||
struct hlist_node *list;
|
||||
|
||||
|
@ -164,8 +160,7 @@ drm_ht_find_item(drm_open_hash_t *ht, unsigned long key, drm_hash_item_t **item)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
drm_ht_remove_key(drm_open_hash_t *ht, unsigned long key)
|
||||
int drm_ht_remove_key(drm_open_hash_t *ht, unsigned long key)
|
||||
{
|
||||
struct hlist_node *list;
|
||||
|
||||
|
@ -178,8 +173,7 @@ drm_ht_remove_key(drm_open_hash_t *ht, unsigned long key)
|
|||
return -1;
|
||||
}
|
||||
|
||||
int
|
||||
drm_ht_remove_item(drm_open_hash_t *ht, drm_hash_item_t *item)
|
||||
int drm_ht_remove_item(drm_open_hash_t *ht, drm_hash_item_t *item)
|
||||
{
|
||||
hlist_del_init(&item->head);
|
||||
ht->fill--;
|
||||
|
|
|
@ -77,9 +77,9 @@ drm_sman_init(drm_sman_t * sman, unsigned int num_managers,
|
|||
goto out;
|
||||
|
||||
drm_ht_remove(&sman->owner_hash_tab);
|
||||
out1:
|
||||
out1:
|
||||
drm_free(sman->mm, num_managers * sizeof(*sman->mm), DRM_MEM_MM);
|
||||
out:
|
||||
out:
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -163,8 +163,8 @@ drm_sman_set_manager(drm_sman_t * sman, unsigned int manager,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static drm_owner_item_t
|
||||
* drm_sman_get_owner_item(drm_sman_t * sman, unsigned long owner)
|
||||
static drm_owner_item_t *drm_sman_get_owner_item(drm_sman_t * sman,
|
||||
unsigned long owner)
|
||||
{
|
||||
int ret;
|
||||
drm_hash_item_t *owner_hash_item;
|
||||
|
@ -188,13 +188,13 @@ static drm_owner_item_t
|
|||
list_add_tail(&owner_item->sman_list, &sman->owner_items);
|
||||
return owner_item;
|
||||
|
||||
out1:
|
||||
out1:
|
||||
drm_free(owner_item, sizeof(*owner_item), DRM_MEM_MM);
|
||||
out:
|
||||
out:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
drm_memblock_item_t *drm_sman_alloc(drm_sman_t * sman, unsigned int manager,
|
||||
drm_memblock_item_t *drm_sman_alloc(drm_sman_t *sman, unsigned int manager,
|
||||
unsigned long size, unsigned alignment,
|
||||
unsigned long owner)
|
||||
{
|
||||
|
@ -234,11 +234,11 @@ drm_memblock_item_t *drm_sman_alloc(drm_sman_t * sman, unsigned int manager,
|
|||
|
||||
return memblock;
|
||||
|
||||
out2:
|
||||
out2:
|
||||
drm_ht_remove_item(&sman->user_hash_tab, &memblock->user_hash);
|
||||
out1:
|
||||
out1:
|
||||
drm_free(memblock, sizeof(*memblock), DRM_MEM_MM);
|
||||
out:
|
||||
out:
|
||||
sman_mm->free(sman_mm->private, tmp);
|
||||
|
||||
return NULL;
|
||||
|
@ -246,7 +246,7 @@ drm_memblock_item_t *drm_sman_alloc(drm_sman_t * sman, unsigned int manager,
|
|||
|
||||
EXPORT_SYMBOL(drm_sman_alloc);
|
||||
|
||||
static void drm_sman_free(drm_memblock_item_t * item)
|
||||
static void drm_sman_free(drm_memblock_item_t *item)
|
||||
{
|
||||
drm_sman_t *sman = item->sman;
|
||||
|
||||
|
@ -256,7 +256,7 @@ static void drm_sman_free(drm_memblock_item_t * item)
|
|||
drm_free(item, sizeof(*item), DRM_MEM_MM);
|
||||
}
|
||||
|
||||
int drm_sman_free_key(drm_sman_t * sman, unsigned int key)
|
||||
int drm_sman_free_key(drm_sman_t *sman, unsigned int key)
|
||||
{
|
||||
drm_hash_item_t *hash_item;
|
||||
drm_memblock_item_t *memblock_item;
|
||||
|
@ -271,15 +271,15 @@ int drm_sman_free_key(drm_sman_t * sman, unsigned int key)
|
|||
|
||||
EXPORT_SYMBOL(drm_sman_free_key);
|
||||
|
||||
static void
|
||||
drm_sman_remove_owner(drm_sman_t * sman, drm_owner_item_t * owner_item)
|
||||
static void drm_sman_remove_owner(drm_sman_t *sman,
|
||||
drm_owner_item_t *owner_item)
|
||||
{
|
||||
list_del(&owner_item->sman_list);
|
||||
drm_ht_remove_item(&sman->owner_hash_tab, &owner_item->owner_hash);
|
||||
drm_free(owner_item, sizeof(*owner_item), DRM_MEM_MM);
|
||||
}
|
||||
|
||||
int drm_sman_owner_clean(drm_sman_t * sman, unsigned long owner)
|
||||
int drm_sman_owner_clean(drm_sman_t *sman, unsigned long owner)
|
||||
{
|
||||
|
||||
drm_hash_item_t *hash_item;
|
||||
|
@ -300,8 +300,8 @@ int drm_sman_owner_clean(drm_sman_t * sman, unsigned long owner)
|
|||
|
||||
EXPORT_SYMBOL(drm_sman_owner_clean);
|
||||
|
||||
static void
|
||||
drm_sman_do_owner_cleanup(drm_sman_t * sman, drm_owner_item_t * owner_item)
|
||||
static void drm_sman_do_owner_cleanup(drm_sman_t *sman,
|
||||
drm_owner_item_t *owner_item)
|
||||
{
|
||||
drm_memblock_item_t *entry, *next;
|
||||
|
||||
|
@ -312,7 +312,7 @@ drm_sman_do_owner_cleanup(drm_sman_t * sman, drm_owner_item_t * owner_item)
|
|||
drm_sman_remove_owner(sman, owner_item);
|
||||
}
|
||||
|
||||
void drm_sman_owner_cleanup(drm_sman_t * sman, unsigned long owner)
|
||||
void drm_sman_owner_cleanup(drm_sman_t *sman, unsigned long owner)
|
||||
{
|
||||
|
||||
drm_hash_item_t *hash_item;
|
||||
|
@ -329,7 +329,7 @@ void drm_sman_owner_cleanup(drm_sman_t * sman, unsigned long owner)
|
|||
|
||||
EXPORT_SYMBOL(drm_sman_owner_cleanup);
|
||||
|
||||
void drm_sman_cleanup(drm_sman_t * sman)
|
||||
void drm_sman_cleanup(drm_sman_t *sman)
|
||||
{
|
||||
drm_owner_item_t *entry, *next;
|
||||
unsigned int i;
|
||||
|
|
Loading…
Reference in New Issue