diff mbox series

[v6,25/27] kernel-shark: Do not use the ARRAY_SIZE macro

Message ID 20201209134203.428068-26-y.karadz@gmail.com (mailing list archive)
State Superseded
Headers show
Series Start KernelShark v2 transformation | expand

Commit Message

Yordan Karadzhov Dec. 9, 2020, 1:42 p.m. UTC
This macro is no longer available in the trace-cmd public header.
Since it is used in only one place, we will just replace it with
the corresponding code.

Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
---
 src/libkshark-tepdata.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/src/libkshark-tepdata.c b/src/libkshark-tepdata.c
index 0b23912..5fc1eb8 100644
--- a/src/libkshark-tepdata.c
+++ b/src/libkshark-tepdata.c
@@ -1261,10 +1261,11 @@  const char *tep_plugin_names[] = {
  */
 int kshark_tep_handle_plugins(struct kshark_context *kshark_ctx, int sd)
 {
-	int i, n_tep_plugins = ARRAY_SIZE(tep_plugin_names);
 	struct kshark_plugin_list *plugin;
 	struct kshark_data_stream *stream;
+	int i, n_tep_plugins;
 
+	n_tep_plugins = (sizeof(tep_plugin_names) / sizeof((tep_plugin_names)[0]));
 	stream = kshark_get_data_stream(kshark_ctx, sd);
 	if (!stream)
 		return -EEXIST;