diff options
author | Emil Velikov <emil.l.velikov@gmail.com> | 2015-08-07 16:40:45 +0100 |
---|---|---|
committer | Emil Velikov <emil.l.velikov@gmail.com> | 2015-08-13 17:43:19 +0100 |
commit | 5f0f6387a6abe9e20c94d99a1e59aa7fa231b17a (patch) | |
tree | 93d2541c992f6724b0c1b318d8c94cc12ffe4e72 | |
parent | bf4826430ab116fad0bded3aef7aa4f0ccc5c548 (diff) |
amdgpu/util_hash: hide private symbols from global namespace
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
-rw-r--r-- | amdgpu/util_hash.c | 29 | ||||
-rw-r--r-- | amdgpu/util_hash.h | 34 |
2 files changed, 36 insertions, 27 deletions
diff --git a/amdgpu/util_hash.c b/amdgpu/util_hash.c index b1e12c4c..7e590419 100644 --- a/amdgpu/util_hash.c +++ b/amdgpu/util_hash.c @@ -214,8 +214,8 @@ static struct util_node **util_hash_find_node(struct util_hash *hash, unsigned a return node; } -struct util_hash_iter util_hash_insert(struct util_hash *hash, - unsigned key, void *data) +drm_private struct util_hash_iter +util_hash_insert(struct util_hash *hash, unsigned key, void *data) { util_data_might_grow(hash->data.d); @@ -234,7 +234,7 @@ struct util_hash_iter util_hash_insert(struct util_hash *hash, } } -struct util_hash * util_hash_create(void) +drm_private struct util_hash *util_hash_create(void) { struct util_hash *hash = malloc(sizeof(struct util_hash)); if (!hash) @@ -257,7 +257,7 @@ struct util_hash * util_hash_create(void) return hash; } -void util_hash_delete(struct util_hash *hash) +drm_private void util_hash_delete(struct util_hash *hash) { struct util_node *e_for_x = (struct util_node *)(hash->data.d); struct util_node **bucket = (struct util_node **)(hash->data.d->buckets); @@ -275,22 +275,22 @@ void util_hash_delete(struct util_hash *hash) free(hash); } -struct util_hash_iter util_hash_find(struct util_hash *hash, - unsigned key) +drm_private struct util_hash_iter +util_hash_find(struct util_hash *hash, unsigned key) { struct util_node **nextNode = util_hash_find_node(hash, key); struct util_hash_iter iter = {hash, *nextNode}; return iter; } -unsigned util_hash_iter_key(struct util_hash_iter iter) +drm_private unsigned util_hash_iter_key(struct util_hash_iter iter) { if (!iter.node || iter.hash->data.e == iter.node) return 0; return iter.node->key; } -void * util_hash_iter_data(struct util_hash_iter iter) +drm_private void *util_hash_iter_data(struct util_hash_iter iter) { if (!iter.node || iter.hash->data.e == iter.node) return 0; @@ -327,21 +327,21 @@ static struct util_node *util_hash_data_next(struct util_node *node) return a.e; } -struct util_hash_iter util_hash_iter_next(struct util_hash_iter iter) +drm_private struct util_hash_iter +util_hash_iter_next(struct util_hash_iter iter) { struct util_hash_iter next = {iter.hash, util_hash_data_next(iter.node)}; return next; } -int util_hash_iter_is_null(struct util_hash_iter iter) +drm_private int util_hash_iter_is_null(struct util_hash_iter iter) { if (!iter.node || iter.node == iter.hash->data.e) return 1; return 0; } -void * util_hash_take(struct util_hash *hash, - unsigned akey) +drm_private void *util_hash_take(struct util_hash *hash, unsigned akey) { struct util_node **node = util_hash_find_node(hash, akey); if (*node != hash->data.e) { @@ -356,13 +356,14 @@ void * util_hash_take(struct util_hash *hash, return 0; } -struct util_hash_iter util_hash_first_node(struct util_hash *hash) +drm_private struct util_hash_iter util_hash_first_node(struct util_hash *hash) { struct util_hash_iter iter = {hash, util_data_first_node(hash->data.d)}; return iter; } -struct util_hash_iter util_hash_erase(struct util_hash *hash, struct util_hash_iter iter) +drm_private struct util_hash_iter +util_hash_erase(struct util_hash *hash, struct util_hash_iter iter) { struct util_hash_iter ret = iter; struct util_node *node = iter.node; diff --git a/amdgpu/util_hash.h b/amdgpu/util_hash.h index 8e0f9a26..01a4779b 100644 --- a/amdgpu/util_hash.h +++ b/amdgpu/util_hash.h @@ -44,8 +44,14 @@ #ifndef UTIL_HASH_H #define UTIL_HASH_H +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include <stdbool.h> +#include "libdrm_macros.h" + struct util_hash; struct util_node; @@ -55,8 +61,8 @@ struct util_hash_iter { }; -struct util_hash *util_hash_create(void); -void util_hash_delete(struct util_hash *hash); +drm_private struct util_hash *util_hash_create(void); +drm_private void util_hash_delete(struct util_hash *hash); /** @@ -65,8 +71,8 @@ void util_hash_delete(struct util_hash *hash); * in the collision list. * Function returns iterator pointing to the inserted item in the hash. */ -struct util_hash_iter util_hash_insert(struct util_hash *hash, unsigned key, - void *data); +drm_private struct util_hash_iter +util_hash_insert(struct util_hash *hash, unsigned key, void *data); /** * Removes the item pointed to by the current iterator from the hash. @@ -75,25 +81,27 @@ struct util_hash_iter util_hash_insert(struct util_hash *hash, unsigned key, * Function returns iterator pointing to the item after the removed one in * the hash. */ -struct util_hash_iter util_hash_erase(struct util_hash *hash, - struct util_hash_iter iter); +drm_private struct util_hash_iter +util_hash_erase(struct util_hash *hash, struct util_hash_iter iter); -void *util_hash_take(struct util_hash *hash, unsigned key); +drm_private void *util_hash_take(struct util_hash *hash, unsigned key); -struct util_hash_iter util_hash_first_node(struct util_hash *hash); +drm_private struct util_hash_iter util_hash_first_node(struct util_hash *hash); /** * Return an iterator pointing to the first entry in the collision list. */ -struct util_hash_iter util_hash_find(struct util_hash *hash, unsigned key); +drm_private struct util_hash_iter +util_hash_find(struct util_hash *hash, unsigned key); -int util_hash_iter_is_null(struct util_hash_iter iter); -unsigned util_hash_iter_key(struct util_hash_iter iter); -void *util_hash_iter_data(struct util_hash_iter iter); +drm_private int util_hash_iter_is_null(struct util_hash_iter iter); +drm_private unsigned util_hash_iter_key(struct util_hash_iter iter); +drm_private void *util_hash_iter_data(struct util_hash_iter iter); -struct util_hash_iter util_hash_iter_next(struct util_hash_iter iter); +drm_private struct util_hash_iter +util_hash_iter_next(struct util_hash_iter iter); #endif |