From patchwork Fri Aug 7 16:44:56 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 6971531 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B995D9F46B for ; Fri, 7 Aug 2015 16:41:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BC9FB2041D for ; Fri, 7 Aug 2015 16:41:04 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id A861F20389 for ; Fri, 7 Aug 2015 16:41:03 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C88307A1A6; Fri, 7 Aug 2015 09:41:02 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wi0-f182.google.com (mail-wi0-f182.google.com [209.85.212.182]) by gabe.freedesktop.org (Postfix) with ESMTPS id 527B37A197 for ; Fri, 7 Aug 2015 09:41:01 -0700 (PDT) Received: by wibhh20 with SMTP id hh20so73001506wib.0 for ; Fri, 07 Aug 2015 09:41:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=YigrtRsvJ0dgOkeRw8znP44mL1NFwHiMBLnwmkVFi8s=; b=hQBP/iLcnggQPFDkYGTGIqHWyE8j1AnMNsHD8VP/CdWM+OKJsktZa5x6889xuaxIFh nPr+YcXOAnzwb+HxMAgOdvx/zWxyhIUPKolXMxb92E0AYQuqunZm2ECaApyJYsx5nJEB EUncJ+sQC9lFn6+yyEHPTVdonVGgO2I7JDN/8ylA6QUEiyBNfvtFuhc+IcQ+4Wul5jCv MllKyMLD41y0FBTtsMR6yJwq44k++elgq9Vl6BcV0tKXpx1CP1UpiozKm9pbsBS05SQV xfCFCb9e8W3H5d9Nglreyr0oStOvC1NrS34wwFQNZg3JWmwRHKWL7tH78NmlzjivlyZd /Muw== X-Received: by 10.194.203.138 with SMTP id kq10mr17606822wjc.124.1438965659970; Fri, 07 Aug 2015 09:40:59 -0700 (PDT) Received: from arch-x220.localdomain (genkt-049-238.t-mobile.co.uk. [149.254.49.238]) by smtp.gmail.com with ESMTPSA id lg8sm4528960wic.12.2015.08.07.09.40.58 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 07 Aug 2015 09:40:59 -0700 (PDT) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH libdrm 2/9] amdgpu/util_hash: hide private symbols from global namespace Date: Fri, 7 Aug 2015 17:44:56 +0100 Message-Id: <1438965903-6342-3-git-send-email-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1438965903-6342-1-git-send-email-emil.l.velikov@gmail.com> References: <1438965903-6342-1-git-send-email-emil.l.velikov@gmail.com> Cc: Alex Deucher , Emil Velikov X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Emil Velikov --- amdgpu/util_hash.c | 29 +++++++++++++++-------------- 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 b1e12c4..7e59041 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 8e0f9a2..01a4779 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 +#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