diff mbox series

[v3,1/5] libtracefs: Fix issues with tracefs_option_id()

Message ID 20210408140024.13093-2-y.karadz@gmail.com (mailing list archive)
State Superseded
Headers show
Series Refactor the APIs for tracing options | expand

Commit Message

Yordan Karadzhov April 8, 2021, 2 p.m. UTC
Few mistakes have been made when introducing this API function.
First of all, its declaration is missing from the header file.
In addition to this the argument type is missing "const".

Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
---
 include/tracefs.h   | 1 +
 src/tracefs-tools.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/include/tracefs.h b/include/tracefs.h
index 70b7ebe..d3db8b5 100644
--- a/include/tracefs.h
+++ b/include/tracefs.h
@@ -145,6 +145,7 @@  bool tracefs_option_is_enabled(struct tracefs_instance *instance, enum tracefs_o
 int tracefs_option_enable(struct tracefs_instance *instance, enum tracefs_option_id id);
 int tracefs_option_diasble(struct tracefs_instance *instance, enum tracefs_option_id id);
 const char *tracefs_option_name(enum tracefs_option_id id);
+enum tracefs_option_id tracefs_option_id(const char *name);
 
 /*
  * RESET	- Reset on opening filter file (O_TRUNC)
diff --git a/src/tracefs-tools.c b/src/tracefs-tools.c
index d48062c..f409def 100644
--- a/src/tracefs-tools.c
+++ b/src/tracefs-tools.c
@@ -192,7 +192,7 @@  const char *tracefs_option_name(enum tracefs_option_id id)
  * Returns trace option ID or TRACEFS_OPTION_INVALID in case of an error or
  * unknown option name.
  */
-enum tracefs_option_id tracefs_option_id(char *name)
+enum tracefs_option_id tracefs_option_id(const char *name)
 {
 	int i;