]> git.lttng.org Git - lttng-tools.git/commitdiff
sessiond: ust_app_ctx: use lttng::utils::container_of
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 22 Jul 2024 20:01:19 +0000 (20:01 +0000)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 30 Jul 2024 01:26:51 +0000 (01:26 +0000)
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 <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/ust-app.cpp

index e7f6952f7524ba550fd5df5b4838615a2795fa49..c1de875eb2aa8f649965f20b7afa90f0eb6805f2 100644 (file)
@@ -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) {
This page took 0.031386 seconds and 4 git commands to generate.