[PATCH 1/2] libtracefs: Move tracefs_list_free() to tracefs-utils.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "Steven Rostedt (VMware)" <rostedt@xxxxxxxxxxx>

The tracefs_list_free() function is more a helper utility, and it is
better placed in tracefs-utils.c than tracefs-events.c

Signed-off-by: Steven Rostedt (VMware) <rostedt@xxxxxxxxxxx>
---
 src/tracefs-events.c | 20 --------------------
 src/tracefs-utils.c  | 20 ++++++++++++++++++++
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/src/tracefs-events.c b/src/tracefs-events.c
index 568bfe60be3b..77f4624776e2 100644
--- a/src/tracefs-events.c
+++ b/src/tracefs-events.c
@@ -284,26 +284,6 @@ __hidden char *trace_append_file(const char *dir, const char *name)
 	return ret < 0 ? NULL : file;
 }
 
-/**
- * tracefs_list_free - free list if strings, returned by APIs
- *			tracefs_event_systems()
- *			tracefs_system_events()
- *
- *@list pointer to a list of strings, the last one must be NULL
- */
-void tracefs_list_free(char **list)
-{
-	int i;
-
-	if (!list)
-		return;
-
-	for (i = 0; list[i]; i++)
-		free(list[i]);
-
-	free(list);
-}
-
 /**
  * tracefs_event_systems - return list of systems for tracing
  * @tracing_dir: directory holding the "events" directory
diff --git a/src/tracefs-utils.c b/src/tracefs-utils.c
index a8dd7fc35a00..b29131ecf0c5 100644
--- a/src/tracefs-utils.c
+++ b/src/tracefs-utils.c
@@ -364,3 +364,23 @@ int tracefs_error_clear(struct tracefs_instance *instance)
 {
 	return tracefs_instance_file_clear(instance, ERROR_LOG);
 }
+
+/**
+ * tracefs_list_free - free list if strings, returned by APIs
+ *			tracefs_event_systems()
+ *			tracefs_system_events()
+ *
+ *@list pointer to a list of strings, the last one must be NULL
+ */
+void tracefs_list_free(char **list)
+{
+	int i;
+
+	if (!list)
+		return;
+
+	for (i = 0; list[i]; i++)
+		free(list[i]);
+
+	free(list);
+}
-- 
2.30.2




[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux