diff mbox series

[23/34] kernelshark: Fix 'const' type qualifier on return type has no effect

Message ID 20240114171723.14092-24-dev@benjarobin.fr (mailing list archive)
State Accepted
Commit a09ccd33a260e87df62625e0a7bdc3f5b5d91ba3
Headers show
Series Fix kernelshark issues introduced by the migration to Qt6 | expand

Commit Message

Benjamin ROBIN Jan. 14, 2024, 5:17 p.m. UTC
Also fix clang build, which allow to execute Clang-Tidy and Clazy

Signed-off-by: Benjamin ROBIN <dev@benjarobin.fr>
---
 src/libkshark-tepdata.c | 12 ++++++------
 src/libkshark.h         | 20 ++++++++++----------
 tests/test-input.c      |  4 ++--
 tests/test-input_ctrl.c |  4 ++--
 4 files changed, 20 insertions(+), 20 deletions(-)
diff mbox series

Patch

diff --git a/src/libkshark-tepdata.c b/src/libkshark-tepdata.c
index b780957..2d0fcb0 100644
--- a/src/libkshark-tepdata.c
+++ b/src/libkshark-tepdata.c
@@ -634,8 +634,8 @@  ssize_t kshark_load_tep_records(struct kshark_context *kshark_ctx, int sd,
 	return -ENOMEM;
 }
 
-static const int tepdata_get_event_id(struct kshark_data_stream *stream,
-				      const struct kshark_entry *entry)
+static int tepdata_get_event_id(struct kshark_data_stream *stream,
+				const struct kshark_entry *entry)
 {
 	int event_id = KS_EMPTY_BIN;
 	struct tep_record *record;
@@ -727,8 +727,8 @@  static char *tepdata_get_event_name(struct kshark_data_stream *stream,
 	return buffer;
 }
 
-static const int tepdata_get_pid(struct kshark_data_stream *stream,
-				 const struct kshark_entry *entry)
+static int tepdata_get_pid(struct kshark_data_stream *stream,
+			   const struct kshark_entry *entry)
 {
 	struct tep_record *record;
 	int pid = KS_EMPTY_BIN;
@@ -1054,8 +1054,8 @@  static char *tepdata_dump_entry(struct kshark_data_stream *stream,
 	return entry_str;
 }
 
-static const int tepdata_find_event_id(struct kshark_data_stream *stream,
-				       const char *event_name)
+static int tepdata_find_event_id(struct kshark_data_stream *stream,
+				 const char *event_name)
 {
 	struct tep_event *event;
 	char *buffer, *system, *name;
diff --git a/src/libkshark.h b/src/libkshark.h
index 1514f33..97d3227 100644
--- a/src/libkshark.h
+++ b/src/libkshark.h
@@ -142,8 +142,8 @@  typedef char *(*stream_get_str_func) (struct kshark_data_stream *,
 				      const struct kshark_entry *);
 
 /** A function type to be used by the method interface of the data stream. */
-typedef const int (*stream_get_int_func) (struct kshark_data_stream *,
-					  const struct kshark_entry *);
+typedef int (*stream_get_int_func) (struct kshark_data_stream *,
+				    const struct kshark_entry *);
 
 /** A function type to be used by the method interface of the data stream. */
 typedef int (*stream_find_id_func) (struct kshark_data_stream *,
@@ -176,16 +176,16 @@  typedef kshark_event_field_format
 			    const char *);
 
 /** A function type to be used by the method interface of the data stream. */
-typedef const int (*stream_read_event_field) (struct kshark_data_stream *,
-					      const struct kshark_entry *,
-					      const char *,
-					      int64_t *);
+typedef int (*stream_read_event_field) (struct kshark_data_stream *,
+					const struct kshark_entry *,
+					const char *,
+					int64_t *);
 
 /** A function type to be used by the method interface of the data stream. */
-typedef const int (*stream_read_record_field) (struct kshark_data_stream *,
-					       void *,
-					       const char *,
-					       int64_t *);
+typedef int (*stream_read_record_field) (struct kshark_data_stream *,
+					 void *,
+					 const char *,
+					 int64_t *);
 
 struct kshark_context;
 
diff --git a/tests/test-input.c b/tests/test-input.c
index 31620b9..c6a5fa2 100644
--- a/tests/test-input.c
+++ b/tests/test-input.c
@@ -69,8 +69,8 @@  bool KSHARK_INPUT_CHECK(const char *file, char **format)
 	return false;
 }
 
-static const int get_pid(struct kshark_data_stream *stream,
-			 const struct kshark_entry *entry)
+static int get_pid(struct kshark_data_stream *stream,
+		   const struct kshark_entry *entry)
 {
 	return entry->pid;
 }
diff --git a/tests/test-input_ctrl.c b/tests/test-input_ctrl.c
index 3dcc92e..77abab1 100644
--- a/tests/test-input_ctrl.c
+++ b/tests/test-input_ctrl.c
@@ -71,8 +71,8 @@  bool KSHARK_INPUT_CHECK(const char *file, char **format)
 	return false;
 }
 
-static const int get_pid(struct kshark_data_stream *stream,
-			 const struct kshark_entry *entry)
+static int get_pid(struct kshark_data_stream *stream,
+		   const struct kshark_entry *entry)
 {
 	return entry->pid;
 }