From: Jonathan Rajotte Date: Wed, 23 Sep 2020 18:34:59 +0000 (-0400) Subject: action: Mark parameter of lttng_action_get_type as const X-Git-Tag: v2.13.0-rc1~449 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=17182cfd13b6d35cf8c80d4f9ccf8d2bdd1a05f2;p=lttng-tools.git action: Mark parameter of lttng_action_get_type as const Remove lttng_action_get_type_const as it is no longer needed. Signed-off-by: Jonathan Rajotte Signed-off-by: Jérémie Galarneau Change-Id: I1525bc2c89eb37ab3e75d915c6ff50bd2a7f5d21 --- diff --git a/include/lttng/action/action-internal.h b/include/lttng/action/action-internal.h index 20faea697..9e43a34d0 100644 --- a/include/lttng/action/action-internal.h +++ b/include/lttng/action/action-internal.h @@ -61,10 +61,6 @@ LTTNG_HIDDEN ssize_t lttng_action_create_from_payload(struct lttng_payload_view *view, struct lttng_action **action); -LTTNG_HIDDEN -enum lttng_action_type lttng_action_get_type_const( - const struct lttng_action *action); - LTTNG_HIDDEN bool lttng_action_is_equal(const struct lttng_action *a, const struct lttng_action *b); diff --git a/include/lttng/action/action.h b/include/lttng/action/action.h index 1309f85bd..be7e397d0 100644 --- a/include/lttng/action/action.h +++ b/include/lttng/action/action.h @@ -38,7 +38,7 @@ enum lttng_action_status { * Returns the type of an action on success, LTTNG_ACTION_TYPE_UNKNOWN on error. */ extern enum lttng_action_type lttng_action_get_type( - struct lttng_action *action); + const struct lttng_action *action); /* * Destroy (frees) an action object. diff --git a/src/bin/lttng-sessiond/action-executor.c b/src/bin/lttng-sessiond/action-executor.c index 2e6e27a8c..fc7d03d70 100644 --- a/src/bin/lttng-sessiond/action-executor.c +++ b/src/bin/lttng-sessiond/action-executor.c @@ -104,7 +104,7 @@ static const char *action_type_names[] = { static const char *get_action_name(const struct lttng_action *action) { - return action_type_names[lttng_action_get_type_const(action)]; + return action_type_names[lttng_action_get_type(action)]; } /* Check if this trigger allowed to interect with a given session. */ @@ -486,7 +486,7 @@ static int action_executor_generic_handler(struct action_executor *executor, work_item->trigger, work_item->id); - return action_executors[lttng_action_get_type_const(action)]( + return action_executors[lttng_action_get_type(action)]( executor, work_item, action); } diff --git a/src/bin/lttng-sessiond/notification-thread-events.c b/src/bin/lttng-sessiond/notification-thread-events.c index 95101178f..e01a00538 100644 --- a/src/bin/lttng-sessiond/notification-thread-events.c +++ b/src/bin/lttng-sessiond/notification-thread-events.c @@ -2058,7 +2058,7 @@ bool is_trigger_action_notify(const struct lttng_trigger *trigger) enum lttng_action_type action_type; assert(action); - action_type = lttng_action_get_type_const(action); + action_type = lttng_action_get_type(action); if (action_type == LTTNG_ACTION_TYPE_NOTIFY) { is_notify = true; goto end; @@ -2074,7 +2074,7 @@ bool is_trigger_action_notify(const struct lttng_trigger *trigger) lttng_action_group_get_at_index( action, i); - action_type = lttng_action_get_type_const(inner_action); + action_type = lttng_action_get_type(inner_action); if (action_type == LTTNG_ACTION_TYPE_NOTIFY) { is_notify = true; goto end; diff --git a/src/common/actions/action.c b/src/common/actions/action.c index 11b3c5501..86628542b 100644 --- a/src/common/actions/action.c +++ b/src/common/actions/action.c @@ -38,18 +38,11 @@ const char *lttng_action_type_string(enum lttng_action_type action_type) } } -enum lttng_action_type lttng_action_get_type(struct lttng_action *action) +enum lttng_action_type lttng_action_get_type(const struct lttng_action *action) { return action ? action->type : LTTNG_ACTION_TYPE_UNKNOWN; } -LTTNG_HIDDEN -enum lttng_action_type lttng_action_get_type_const( - const struct lttng_action *action) -{ - return action->type; -} - LTTNG_HIDDEN void lttng_action_init( struct lttng_action *action, diff --git a/src/common/actions/group.c b/src/common/actions/group.c index f57207415..31c6f456e 100644 --- a/src/common/actions/group.c +++ b/src/common/actions/group.c @@ -16,7 +16,7 @@ #include #define IS_GROUP_ACTION(action) \ - (lttng_action_get_type_const(action) == LTTNG_ACTION_TYPE_GROUP) + (lttng_action_get_type(action) == LTTNG_ACTION_TYPE_GROUP) struct lttng_action_group { struct lttng_action parent; diff --git a/src/common/actions/rotate-session.c b/src/common/actions/rotate-session.c index 9255034da..a49287660 100644 --- a/src/common/actions/rotate-session.c +++ b/src/common/actions/rotate-session.c @@ -13,7 +13,7 @@ #include #define IS_ROTATE_SESSION_ACTION(action) \ - (lttng_action_get_type_const(action) == LTTNG_ACTION_TYPE_ROTATE_SESSION) + (lttng_action_get_type(action) == LTTNG_ACTION_TYPE_ROTATE_SESSION) struct lttng_action_rotate_session { struct lttng_action parent; diff --git a/src/common/actions/snapshot-session.c b/src/common/actions/snapshot-session.c index 667166770..ccf54dc77 100644 --- a/src/common/actions/snapshot-session.c +++ b/src/common/actions/snapshot-session.c @@ -19,7 +19,7 @@ #include #define IS_SNAPSHOT_SESSION_ACTION(action) \ - (lttng_action_get_type_const(action) == LTTNG_ACTION_TYPE_SNAPSHOT_SESSION) + (lttng_action_get_type(action) == LTTNG_ACTION_TYPE_SNAPSHOT_SESSION) struct lttng_action_snapshot_session { struct lttng_action parent; diff --git a/src/common/actions/start-session.c b/src/common/actions/start-session.c index eeb00a5da..f21aaaae9 100644 --- a/src/common/actions/start-session.c +++ b/src/common/actions/start-session.c @@ -13,7 +13,7 @@ #include #define IS_START_SESSION_ACTION(action) \ - (lttng_action_get_type_const(action) == LTTNG_ACTION_TYPE_START_SESSION) + (lttng_action_get_type(action) == LTTNG_ACTION_TYPE_START_SESSION) struct lttng_action_start_session { struct lttng_action parent; diff --git a/src/common/actions/stop-session.c b/src/common/actions/stop-session.c index 33077b676..5bd753f7c 100644 --- a/src/common/actions/stop-session.c +++ b/src/common/actions/stop-session.c @@ -13,7 +13,7 @@ #include #define IS_STOP_SESSION_ACTION(action) \ - (lttng_action_get_type_const(action) == LTTNG_ACTION_TYPE_STOP_SESSION) + (lttng_action_get_type(action) == LTTNG_ACTION_TYPE_STOP_SESSION) struct lttng_action_stop_session { struct lttng_action parent;