From: Jérémie Galarneau Date: Mon, 22 Jul 2024 20:01:19 +0000 (+0000) Subject: sessiond: ust_app_ctx: use lttng::utils::container_of X-Git-Url: http://git.lttng.org./?a=commitdiff_plain;h=6523998ff3365d539141e15d94ad7bdd2768e275;p=lttng-tools.git sessiond: ust_app_ctx: use lttng::utils::container_of 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 --- 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) {