From: Mathieu Desnoyers Date: Mon, 3 Jul 2023 15:20:27 +0000 (-0400) Subject: rculfhash: Use caa_container_of_check_null in cds_lfht_entry X-Git-Tag: v0.13.4~16 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=f469420bf77f07598747b78cc73404f1751ae2f0;p=userspace-rcu.git rculfhash: Use caa_container_of_check_null in cds_lfht_entry Use caa_container_of_check_null in cds_lfht_entry to allow removing caa_unqual_scalar_typeof, which requires C11. Signed-off-by: Mathieu Desnoyers Change-Id: Ifd8b05e666b8f1618a823b96a934a2357edb6b36 --- diff --git a/include/urcu/rculfhash.h b/include/urcu/rculfhash.h index 284dab0..56c1b13 100644 --- a/include/urcu/rculfhash.h +++ b/include/urcu/rculfhash.h @@ -535,10 +535,7 @@ void cds_lfht_resize(struct cds_lfht *ht, unsigned long new_size); node = cds_lfht_iter_get_node(iter)) #define cds_lfht_entry(ptr, type, member) \ - ({ \ - caa_unqual_scalar_typeof(ptr) ___ptr = (ptr); \ - ___ptr ? caa_container_of(___ptr, type, member) : NULL; \ - }) + caa_container_of_check_null(ptr, type, member) #define cds_lfht_for_each_entry(ht, iter, pos, member) \ for (cds_lfht_first(ht, iter), \