From c0c66aecd959ec1bfb895abdd8442e2faf1159a6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Tue, 26 Jan 2016 11:45:42 -0500 Subject: [PATCH] Remove superflous domain check in add_uctx_to_channel MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérémie Galarneau --- src/bin/lttng-sessiond/context.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/bin/lttng-sessiond/context.c b/src/bin/lttng-sessiond/context.c index be15cebd2..941ab2535 100644 --- a/src/bin/lttng-sessiond/context.c +++ b/src/bin/lttng-sessiond/context.c @@ -97,6 +97,7 @@ static int add_uctx_to_channel(struct ltt_ust_session *usess, assert(usess); assert(uchan); assert(ctx); + assert(domain == LTTNG_DOMAIN_UST); /* Check if context is duplicate */ cds_list_for_each_entry(uctx, &uchan->ctx_list, list) { @@ -113,15 +114,8 @@ static int add_uctx_to_channel(struct ltt_ust_session *usess, goto error; } - switch (domain) { - case LTTNG_DOMAIN_UST: - ret = ust_app_add_ctx_channel_glb(usess, uchan, uctx); - if (ret < 0) { - goto error; - } - break; - default: - ret = -ENOSYS; + ret = ust_app_add_ctx_channel_glb(usess, uchan, uctx); + if (ret < 0) { goto error; } -- 2.34.1