From: Mathieu Desnoyers Date: Fri, 5 Nov 2021 19:22:04 +0000 (-0400) Subject: Refactoring: lttng_event_enabler_create_tracepoint_events_if_missing: break loop... X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=58969906d4ac3481e88d2fcfc3590d99eb3719ed;p=lttng-modules.git Refactoring: lttng_event_enabler_create_tracepoint_events_if_missing: break loop if found Signed-off-by: Mathieu Desnoyers Change-Id: I17aa51cbfc7e6d70837c16621897c3f928467a8a --- diff --git a/src/lttng-events.c b/src/lttng-events.c index d3532b3d..1bfa4943 100644 --- a/src/lttng-events.c +++ b/src/lttng-events.c @@ -2079,7 +2079,7 @@ void lttng_event_enabler_create_tracepoint_events_if_missing(struct lttng_event_ */ list_for_each_entry(probe_desc, probe_list, head) { for (i = 0; i < probe_desc->nr_events; i++) { - int found = 0; + bool found = false; struct hlist_head *head; struct lttng_kernel_event_common *event; struct lttng_kernel_event_common_private *event_priv; @@ -2093,8 +2093,10 @@ void lttng_event_enabler_create_tracepoint_events_if_missing(struct lttng_event_ */ head = utils_borrow_hash_table_bucket(events_ht->table, LTTNG_EVENT_HT_SIZE, desc->event_name); lttng_hlist_for_each_entry(event_priv, head, hlist_node) { - if (lttng_event_enabler_desc_match_event(event_enabler, desc, event_priv->pub)) - found = 1; + if (lttng_event_enabler_desc_match_event(event_enabler, desc, event_priv->pub)) { + found = true; + break; + } } if (found) continue;