From f41c0b703f96b752f45850dd68ccf5ce244d8447 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Mon, 22 Jul 2024 19:10:37 +0000 Subject: [PATCH] sessiond: buffer_reg_uid: 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: I96a42df9c82ad6b520d3b53a6445159bce692120 Signed-off-by: Jérémie Galarneau --- src/bin/lttng-sessiond/buffer-registry.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/bin/lttng-sessiond/buffer-registry.cpp b/src/bin/lttng-sessiond/buffer-registry.cpp index 9885ed6c8..bf1bd0a7c 100644 --- a/src/bin/lttng-sessiond/buffer-registry.cpp +++ b/src/bin/lttng-sessiond/buffer-registry.cpp @@ -39,15 +39,11 @@ static struct lttng_ht *buffer_registry_pid; */ static int ht_match_reg_uid(struct cds_lfht_node *node, const void *_key) { - struct buffer_reg_uid *reg; - const struct buffer_reg_uid *key; - LTTNG_ASSERT(node); LTTNG_ASSERT(_key); - reg = caa_container_of(node, struct buffer_reg_uid, node.node); - LTTNG_ASSERT(reg); - key = (buffer_reg_uid *) _key; + auto *reg = lttng_ht_node_container_of(node, &buffer_reg_uid::node); + const auto *key = (buffer_reg_uid *) _key; if (key->session_id != reg->session_id || key->bits_per_long != reg->bits_per_long || key->uid != reg->uid) { -- 2.34.1