From c85155116e7fa4e72e69150ce666acf78f4147a1 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Thu, 2 Nov 2023 12:06:46 -0400 Subject: [PATCH] lib: remove unused parameters in internal component creation functions I noticed that these 3 functions didn't use the `class` parameter, remove it. Change-Id: I34b798dfbd8b1e54e7ddf633b61d6d205c0132cb Signed-off-by: Simon Marchi Reviewed-on: https://review.lttng.org/c/babeltrace/+/10408 Reviewed-by: Philippe Proulx Tested-by: jenkins --- src/lib/graph/component-filter.c | 3 +-- src/lib/graph/component-filter.h | 3 +-- src/lib/graph/component-sink.c | 3 +-- src/lib/graph/component-sink.h | 3 +-- src/lib/graph/component-source.c | 3 +-- src/lib/graph/component-source.h | 3 +-- src/lib/graph/component.c | 5 ++--- 7 files changed, 8 insertions(+), 15 deletions(-) diff --git a/src/lib/graph/component-filter.c b/src/lib/graph/component-filter.c index db8dfc4c..507ef2b5 100644 --- a/src/lib/graph/component-filter.c +++ b/src/lib/graph/component-filter.c @@ -26,8 +26,7 @@ void bt_component_filter_destroy( { } -struct bt_component *bt_component_filter_create( - const struct bt_component_class *class __attribute__((unused))) +struct bt_component *bt_component_filter_create(void) { struct bt_component_filter *filter = NULL; diff --git a/src/lib/graph/component-filter.h b/src/lib/graph/component-filter.h index 1c43d0c5..4d90d5c9 100644 --- a/src/lib/graph/component-filter.h +++ b/src/lib/graph/component-filter.h @@ -18,8 +18,7 @@ struct bt_component_filter { struct bt_component parent; }; -struct bt_component *bt_component_filter_create( - const struct bt_component_class *class); +struct bt_component *bt_component_filter_create(void); void bt_component_filter_destroy(struct bt_component *component); diff --git a/src/lib/graph/component-sink.c b/src/lib/graph/component-sink.c index 4f087dda..adbc2699 100644 --- a/src/lib/graph/component-sink.c +++ b/src/lib/graph/component-sink.c @@ -26,8 +26,7 @@ void bt_component_sink_destroy( { } -struct bt_component *bt_component_sink_create( - const struct bt_component_class *class __attribute__((unused))) +struct bt_component *bt_component_sink_create(void) { struct bt_component_sink *sink = NULL; diff --git a/src/lib/graph/component-sink.h b/src/lib/graph/component-sink.h index c2ee1026..59181549 100644 --- a/src/lib/graph/component-sink.h +++ b/src/lib/graph/component-sink.h @@ -22,8 +22,7 @@ struct bt_component_sink { bool graph_is_configured_method_called; }; -struct bt_component *bt_component_sink_create( - const struct bt_component_class *class); +struct bt_component *bt_component_sink_create(void); void bt_component_sink_destroy(struct bt_component *component); diff --git a/src/lib/graph/component-source.c b/src/lib/graph/component-source.c index caeb1e0b..1007f478 100644 --- a/src/lib/graph/component-source.c +++ b/src/lib/graph/component-source.c @@ -26,8 +26,7 @@ void bt_component_source_destroy( { } -struct bt_component *bt_component_source_create( - const struct bt_component_class *class __attribute__((unused))) +struct bt_component *bt_component_source_create(void) { struct bt_component_source *source = NULL; diff --git a/src/lib/graph/component-source.h b/src/lib/graph/component-source.h index bcade78a..e6d7a643 100644 --- a/src/lib/graph/component-source.h +++ b/src/lib/graph/component-source.h @@ -17,8 +17,7 @@ struct bt_component_source { struct bt_component parent; }; -struct bt_component *bt_component_source_create( - const struct bt_component_class *class); +struct bt_component *bt_component_source_create(void); void bt_component_source_destroy(struct bt_component *component); diff --git a/src/lib/graph/component.c b/src/lib/graph/component.c index b5f4d28d..e5584b0f 100644 --- a/src/lib/graph/component.c +++ b/src/lib/graph/component.c @@ -34,8 +34,7 @@ #include "lib/func-status.h" static -struct bt_component * (* const component_create_funcs[])( - const struct bt_component_class *) = { +struct bt_component * (* const component_create_funcs[])(void) = { [BT_COMPONENT_CLASS_TYPE_SOURCE] = bt_component_source_create, [BT_COMPONENT_CLASS_TYPE_SINK] = bt_component_sink_create, [BT_COMPONENT_CLASS_TYPE_FILTER] = bt_component_filter_create, @@ -317,7 +316,7 @@ int bt_component_create(struct bt_component_class *component_class, BT_LIB_LOGI("Creating empty component from component class: %![cc-]+C, " "comp-name=\"%s\", log-level=%s", component_class, name, bt_common_logging_level_string(log_level)); - component = component_create_funcs[type](component_class); + component = component_create_funcs[type](); if (!component) { BT_LIB_LOGE_APPEND_CAUSE( "Cannot create specific component object."); -- 2.34.1