diff mbox series

[v6,1/2] trace-cmd split: Remove const to (struct handle_list).name

Message ID 20240222165418.2153026-1-pierre.gondois@arm.com (mailing list archive)
State Accepted
Commit 08c32816684461f464f738cd8f5773bc14af66db
Headers show
Series [v6,1/2] trace-cmd split: Remove const to (struct handle_list).name | expand

Commit Message

Pierre Gondois Feb. 22, 2024, 4:54 p.m. UTC
(struct handle_list).name was unnecessarily made const in:
commit caa9eda091d6 ("trace-cmd split: Store instances in local list")

Remove it.
Also fix bad indentation.

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
---

Notes:
    v6:
    - New patch: Remove unnecessary const for (struct handle_list).name

 tracecmd/trace-split.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Steven Rostedt Feb. 22, 2024, 5 p.m. UTC | #1
On Thu, 22 Feb 2024 17:54:17 +0100
Pierre Gondois <pierre.gondois@arm.com> wrote:

> (struct handle_list).name was unnecessarily made const in:
> commit caa9eda091d6 ("trace-cmd split: Store instances in local list")
> 
> Remove it.
> Also fix bad indentation.
> 
> Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>

I figured I was guilty of that as well ;-)

Some of the code was probably copied and pasted from places that actually
needed it to be const.

-- Steve
diff mbox series

Patch

diff --git a/tracecmd/trace-split.c b/tracecmd/trace-split.c
index 2c311b3d..cb6242d8 100644
--- a/tracecmd/trace-split.c
+++ b/tracecmd/trace-split.c
@@ -53,9 +53,9 @@  struct cpu_data {
 
 struct handle_list {
 	struct list_head		list;
-	const char			*name;
+	char				*name;
 	int				index;
-	struct tracecmd_input 		*handle;
+	struct tracecmd_input		*handle;
 
 	/* Identify the top instance in the input trace. */
 	bool				was_top_instance;
@@ -114,7 +114,7 @@  static void free_handles(struct list_head *list)
 	while (!list_empty(list)) {
 		item = container_of(list->next, struct handle_list, list);
 		list_del(&item->list);
-		free((char *)item->name);
+		free(item->name);
 		tracecmd_close(item->handle);
 		free(item);
 	}