From 6523998ff3365d539141e15d94ad7bdd2768e275 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Mon, 22 Jul 2024 20:01:19 +0000 Subject: [PATCH] sessiond: ust_app_ctx: use lttng::utils::container_of MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit caa_container_of makes use of offsetof which is conditionally supported for non-POD types. Replace its use by lttng::utils::container_of. Change-Id: I9d3616ccccd15d94447456df415ead2b9b4ff2c3 Signed-off-by: Jérémie Galarneau --- src/bin/lttng-sessiond/ust-app.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/bin/lttng-sessiond/ust-app.cpp b/src/bin/lttng-sessiond/ust-app.cpp index e7f6952f7..c1de875eb 100644 --- a/src/bin/lttng-sessiond/ust-app.cpp +++ b/src/bin/lttng-sessiond/ust-app.cpp @@ -2824,14 +2824,11 @@ error: */ static int ht_match_ust_app_ctx(struct cds_lfht_node *node, const void *_key) { - struct ust_app_ctx *ctx; - const struct lttng_ust_context_attr *key; - LTTNG_ASSERT(node); LTTNG_ASSERT(_key); - ctx = caa_container_of(node, struct ust_app_ctx, node.node); - key = (lttng_ust_context_attr *) _key; + auto *ctx = lttng_ht_node_container_of(node, &ust_app_ctx::node); + const auto *key = (lttng_ust_context_attr *) _key; /* Context type */ if (ctx->ctx.ctx != key->ctx) { -- 2.34.1