diff mbox

[libdrm,03/24] radeon: remove unused functions

Message ID 1427904935-14387-4-git-send-email-emil.l.velikov@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Emil Velikov April 1, 2015, 4:15 p.m. UTC
Namely bof_load_file, bof_print, bof_object_get. Unused since their
introduction according to git log.

Cc: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
---
 radeon/bof.c | 53 -----------------------------------------------------
 radeon/bof.h |  3 ---
 2 files changed, 56 deletions(-)

Comments

Jerome Glisse April 1, 2015, 5:31 p.m. UTC | #1
On Wed, Apr 01, 2015 at 05:15:14PM +0100, Emil Velikov wrote:
> Namely bof_load_file, bof_print, bof_object_get. Unused since their
> introduction according to git log.
> 
> Cc: Jerome Glisse <jglisse@redhat.com>
> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>


NAK

I use all this in tools to debug lockup. Best course of action is to
exclude bof.h from being distributed. My tools static link and i just
point them to libdrm git tree.

Cheers,
Jérôme

> ---
>  radeon/bof.c | 53 -----------------------------------------------------
>  radeon/bof.h |  3 ---
>  2 files changed, 56 deletions(-)
> 
> diff --git a/radeon/bof.c b/radeon/bof.c
> index 0598cc6..6f3760a 100644
> --- a/radeon/bof.c
> +++ b/radeon/bof.c
> @@ -61,18 +61,6 @@ bof_t *bof_object(void)
>  	return object;
>  }
>  
> -bof_t *bof_object_get(bof_t *object, const char *keyname)
> -{
> -	unsigned i;
> -
> -	for (i = 0; i < object->array_size; i += 2) {
> -		if (!strcmp(object->array[i]->value, keyname)) {
> -			return object->array[i + 1];
> -		}
> -	}
> -	return NULL;
> -}
> -
>  int bof_object_set(bof_t *object, const char *keyname, bof_t *value)
>  {
>  	bof_t *key;
> @@ -271,11 +259,6 @@ static void bof_print_rec(bof_t *bof, int level, int entry)
>  	}
>  }
>  
> -void bof_print(bof_t *bof)
> -{
> -	bof_print_rec(bof, 0, 0);
> -}
> -
>  static int bof_read(bof_t *root, FILE *file, long end, int level)
>  {
>  	bof_t *bof = NULL;
> @@ -333,42 +316,6 @@ out_err:
>  	return -EINVAL;
>  }
>  
> -bof_t *bof_load_file(const char *filename)
> -{
> -	bof_t *root = bof_object();
> -	int r;
> -
> -	if (root == NULL) {
> -		fprintf(stderr, "%s failed to create root object\n", __func__);
> -		return NULL;
> -	}
> -	root->file = fopen(filename, "r");
> -	if (root->file == NULL)
> -		goto out_err;
> -	r = fseek(root->file, 0L, SEEK_SET);
> -	if (r) {
> -		fprintf(stderr, "%s failed to seek into file %s\n", __func__, filename);
> -		goto out_err;
> -	}
> -	root->offset = ftell(root->file);
> -	r = fread(&root->type, 4, 1, root->file);
> -	if (r != 1)
> -		goto out_err;
> -	r = fread(&root->size, 4, 1, root->file);
> -	if (r != 1)
> -		goto out_err;
> -	r = fread(&root->array_size, 4, 1, root->file);
> -	if (r != 1)
> -		goto out_err;
> -	r = bof_read(root, root->file, root->offset + root->size, 2);
> -	if (r)
> -		goto out_err;
> -	return root;
> -out_err:
> -	bof_decref(root);
> -	return NULL;
> -}
> -
>  void bof_incref(bof_t *bof)
>  {
>  	bof->refcount++;
> diff --git a/radeon/bof.h b/radeon/bof.h
> index cb829a1..8e952c1 100644
> --- a/radeon/bof.h
> +++ b/radeon/bof.h
> @@ -53,7 +53,6 @@ typedef struct bof {
>  
>  /* object */
>  extern bof_t *bof_object(void);
> -extern bof_t *bof_object_get(bof_t *object, const char *keyname);
>  extern int bof_object_set(bof_t *object, const char *keyname, bof_t *value);
>  /* array */
>  extern bof_t *bof_array(void);
> @@ -72,9 +71,7 @@ extern int32_t bof_int32_value(bof_t *bof);
>  /* common functions */
>  extern void bof_decref(bof_t *bof);
>  extern void bof_incref(bof_t *bof);
> -extern bof_t *bof_load_file(const char *filename);
>  extern int bof_dump_file(bof_t *bof, const char *filename);
> -extern void bof_print(bof_t *bof);
>  
>  static inline int bof_is_object(bof_t *bof){return (bof->type == BOF_TYPE_OBJECT);}
>  static inline int bof_is_blob(bof_t *bof){return (bof->type == BOF_TYPE_BLOB);}
> -- 
> 2.3.1
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
diff mbox

Patch

diff --git a/radeon/bof.c b/radeon/bof.c
index 0598cc6..6f3760a 100644
--- a/radeon/bof.c
+++ b/radeon/bof.c
@@ -61,18 +61,6 @@  bof_t *bof_object(void)
 	return object;
 }
 
-bof_t *bof_object_get(bof_t *object, const char *keyname)
-{
-	unsigned i;
-
-	for (i = 0; i < object->array_size; i += 2) {
-		if (!strcmp(object->array[i]->value, keyname)) {
-			return object->array[i + 1];
-		}
-	}
-	return NULL;
-}
-
 int bof_object_set(bof_t *object, const char *keyname, bof_t *value)
 {
 	bof_t *key;
@@ -271,11 +259,6 @@  static void bof_print_rec(bof_t *bof, int level, int entry)
 	}
 }
 
-void bof_print(bof_t *bof)
-{
-	bof_print_rec(bof, 0, 0);
-}
-
 static int bof_read(bof_t *root, FILE *file, long end, int level)
 {
 	bof_t *bof = NULL;
@@ -333,42 +316,6 @@  out_err:
 	return -EINVAL;
 }
 
-bof_t *bof_load_file(const char *filename)
-{
-	bof_t *root = bof_object();
-	int r;
-
-	if (root == NULL) {
-		fprintf(stderr, "%s failed to create root object\n", __func__);
-		return NULL;
-	}
-	root->file = fopen(filename, "r");
-	if (root->file == NULL)
-		goto out_err;
-	r = fseek(root->file, 0L, SEEK_SET);
-	if (r) {
-		fprintf(stderr, "%s failed to seek into file %s\n", __func__, filename);
-		goto out_err;
-	}
-	root->offset = ftell(root->file);
-	r = fread(&root->type, 4, 1, root->file);
-	if (r != 1)
-		goto out_err;
-	r = fread(&root->size, 4, 1, root->file);
-	if (r != 1)
-		goto out_err;
-	r = fread(&root->array_size, 4, 1, root->file);
-	if (r != 1)
-		goto out_err;
-	r = bof_read(root, root->file, root->offset + root->size, 2);
-	if (r)
-		goto out_err;
-	return root;
-out_err:
-	bof_decref(root);
-	return NULL;
-}
-
 void bof_incref(bof_t *bof)
 {
 	bof->refcount++;
diff --git a/radeon/bof.h b/radeon/bof.h
index cb829a1..8e952c1 100644
--- a/radeon/bof.h
+++ b/radeon/bof.h
@@ -53,7 +53,6 @@  typedef struct bof {
 
 /* object */
 extern bof_t *bof_object(void);
-extern bof_t *bof_object_get(bof_t *object, const char *keyname);
 extern int bof_object_set(bof_t *object, const char *keyname, bof_t *value);
 /* array */
 extern bof_t *bof_array(void);
@@ -72,9 +71,7 @@  extern int32_t bof_int32_value(bof_t *bof);
 /* common functions */
 extern void bof_decref(bof_t *bof);
 extern void bof_incref(bof_t *bof);
-extern bof_t *bof_load_file(const char *filename);
 extern int bof_dump_file(bof_t *bof, const char *filename);
-extern void bof_print(bof_t *bof);
 
 static inline int bof_is_object(bof_t *bof){return (bof->type == BOF_TYPE_OBJECT);}
 static inline int bof_is_blob(bof_t *bof){return (bof->type == BOF_TYPE_BLOB);}