diff mbox series

[2/3] tests: Fix the usage for pdbg_target_path()

Message ID 20200217003624.10741-3-amitay@ozlabs.org
State Accepted
Headers show
Series miscellaneous patches | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch warning Failed to apply on branch master (8b4611b5d8e7e2279fe4aa80c892fcfe10aa398d)
snowpatch_ozlabs/apply_patch fail Failed to apply to any branch

Commit Message

Amitay Isaacs Feb. 17, 2020, 12:36 a.m. UTC
Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
---
 src/tests/libpdbg_dtree_test.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Comments

Alistair Popple March 4, 2020, 4:11 a.m. UTC | #1
Reviewed-by: Alistair Popple <alistair@popple.id.au>

On Monday, 17 February 2020 11:36:23 AM AEDT Amitay Isaacs wrote:
> Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
> ---
>  src/tests/libpdbg_dtree_test.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/src/tests/libpdbg_dtree_test.c b/src/tests/libpdbg_dtree_test.c
> index d3c4a89..318a347 100644
> --- a/src/tests/libpdbg_dtree_test.c
> +++ b/src/tests/libpdbg_dtree_test.c
> @@ -32,7 +32,6 @@ static void print_tree(struct pdbg_target *target, bool
> system, int level) {
>  	struct pdbg_target *child;
>  	const char *name;
> -	char *path;
>  	int i;
> 
>  	for (i=0; i<level; i++)
> @@ -41,9 +40,7 @@ static void print_tree(struct pdbg_target *target, bool
> system, int level) name = pdbg_target_dn_name(target);
>  	if (!name || name[0] == '\0')
>  		name = "/";
> -	path = pdbg_target_path(target);
> -	printf("%s (%s)\n", name, path);
> -	free(path);
> +	printf("%s (%s)\n", name, pdbg_target_path(target));
> 
>  	for_each_child(target, child, system)
>  		print_tree(child, system, level+1);
diff mbox series

Patch

diff --git a/src/tests/libpdbg_dtree_test.c b/src/tests/libpdbg_dtree_test.c
index d3c4a89..318a347 100644
--- a/src/tests/libpdbg_dtree_test.c
+++ b/src/tests/libpdbg_dtree_test.c
@@ -32,7 +32,6 @@  static void print_tree(struct pdbg_target *target, bool system, int level)
 {
 	struct pdbg_target *child;
 	const char *name;
-	char *path;
 	int i;
 
 	for (i=0; i<level; i++)
@@ -41,9 +40,7 @@  static void print_tree(struct pdbg_target *target, bool system, int level)
 	name = pdbg_target_dn_name(target);
 	if (!name || name[0] == '\0')
 		name = "/";
-	path = pdbg_target_path(target);
-	printf("%s (%s)\n", name, path);
-	free(path);
+	printf("%s (%s)\n", name, pdbg_target_path(target));
 
 	for_each_child(target, child, system)
 		print_tree(child, system, level+1);