[PATCH 83/85] drivers: gpu: Mark functions as static and remove unused function in vmwgfx_resource.c

Rashika Kheria rashika.kheria at gmail.com
Mon Jan 6 08:49:19 PST 2014


Mark functions as static because they are not used outside the file
drm/vmwgfx/vmwgfx_resource.c. Also, remove unused function
vmw_user_dmabuf_reference() from drm/vmwgfx/vmwgfx_resource.c.

This eliminates the following warnings in drm/vmwgfx/vmwgfx_resource.c:
drivers/gpu/drm/vmwgfx/vmwgfx_resource.c:252:22: warning: no previous prototype for ‘vmw_resource_lookup’ [-Wmissing-prototypes]
drivers/gpu/drm/vmwgfx/vmwgfx_resource.c:456:5: warning: no previous prototype for ‘vmw_user_dmabuf_alloc’ [-Wmissing-prototypes]
drivers/gpu/drm/vmwgfx/vmwgfx_resource.c:593:5: warning: no previous prototype for ‘vmw_user_dmabuf_reference’ [-Wmissing-prototypes]
drivers/gpu/drm/vmwgfx/vmwgfx_resource.c:1145:5: warning: no previous prototype for ‘vmw_resource_do_evict’ [-Wmissing-prototypes]

Signed-off-by: Rashika Kheria <rashika.kheria at gmail.com>
Reviewed-by: Josh Triplett <josh at joshtriplett.org>
---
 drivers/gpu/drm/vmwgfx/vmwgfx_resource.c |   19 +++----------------
 1 file changed, 3 insertions(+), 16 deletions(-)

diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c b/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c
index 9b5ea2a..5fefc65 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c
@@ -249,7 +249,7 @@ void vmw_resource_activate(struct vmw_resource *res,
 	write_unlock(&dev_priv->resource_lock);
 }
 
-struct vmw_resource *vmw_resource_lookup(struct vmw_private *dev_priv,
+static struct vmw_resource *vmw_resource_lookup(struct vmw_private *dev_priv,
 					 struct idr *idr, int id)
 {
 	struct vmw_resource *res;
@@ -453,7 +453,7 @@ static void vmw_user_dmabuf_release(struct ttm_base_object **p_base)
  * @p_dma_buf: Pointer to where the refcounted struct vmw_dma_buffer pointer
  * should be assigned.
  */
-int vmw_user_dmabuf_alloc(struct vmw_private *dev_priv,
+static int vmw_user_dmabuf_alloc(struct vmw_private *dev_priv,
 			  struct ttm_object_file *tfile,
 			  uint32_t size,
 			  bool shareable,
@@ -590,19 +590,6 @@ int vmw_user_dmabuf_lookup(struct ttm_object_file *tfile,
 	return 0;
 }
 
-int vmw_user_dmabuf_reference(struct ttm_object_file *tfile,
-			      struct vmw_dma_buffer *dma_buf)
-{
-	struct vmw_user_dma_buffer *user_bo;
-
-	if (dma_buf->base.destroy != vmw_user_dmabuf_destroy)
-		return -EINVAL;
-
-	user_bo = container_of(dma_buf, struct vmw_user_dma_buffer, dma);
-	return ttm_ref_object_add(tfile, &user_bo->prime.base,
-				  TTM_REF_USAGE, NULL);
-}
-
 /*
  * Stream management
  */
@@ -1142,7 +1129,7 @@ vmw_resource_backoff_reservation(struct ttm_validate_buffer *val_buf)
  * @res:            The resource to evict.
  * @interruptible:  Whether to wait interruptible.
  */
-int vmw_resource_do_evict(struct vmw_resource *res, bool interruptible)
+static int vmw_resource_do_evict(struct vmw_resource *res, bool interruptible)
 {
 	struct ttm_validate_buffer val_buf;
 	const struct vmw_res_func *func = res->func;
-- 
1.7.9.5



More information about the dri-devel mailing list