From: Jérémie Galarneau Date: Mon, 22 Jul 2024 19:10:37 +0000 (+0000) Subject: sessiond: buffer_reg_uid: use lttng::utils::container_of X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=f41c0b703f96b752f45850dd68ccf5ce244d8447;p=lttng-tools.git sessiond: buffer_reg_uid: 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: I96a42df9c82ad6b520d3b53a6445159bce692120 Signed-off-by: Jérémie Galarneau --- 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) {