From 5d21f1435f208a26dee82e16e3f28df43e5df318 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Mon, 27 Aug 2018 16:30:03 -0400 Subject: [PATCH] Clean-up: location lookup destroy can be type-agnostic MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérémie Galarneau --- src/common/userspace-probe.c | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/src/common/userspace-probe.c b/src/common/userspace-probe.c index 89066bf05..ac26a0c47 100644 --- a/src/common/userspace-probe.c +++ b/src/common/userspace-probe.c @@ -38,26 +38,7 @@ void lttng_userspace_probe_location_lookup_method_destroy( return; } - switch (lookup_method->type) { - case LTTNG_USERSPACE_PROBE_LOCATION_LOOKUP_METHOD_TYPE_FUNCTION_ELF: - { - struct lttng_userspace_probe_location_lookup_method_elf *elf_method = - container_of(lookup_method, - struct lttng_userspace_probe_location_lookup_method_elf, parent); - free(elf_method); - break; - } - case LTTNG_USERSPACE_PROBE_LOCATION_LOOKUP_METHOD_TYPE_TRACEPOINT_SDT: - { - struct lttng_userspace_probe_location_lookup_method_sdt *sdt_method = - container_of(lookup_method, - struct lttng_userspace_probe_location_lookup_method_sdt, parent); - free(sdt_method); - break; - } - default: - break; - } + free(lookup_method); } struct lttng_userspace_probe_location_lookup_method * -- 2.34.1