On 2/25/22 13:07, Dumitru Ceara wrote:
On 2/16/22 15:27, Adrian Moreno wrote:
Rewrite hmap's loops using multi-variable helpers.

For SAFE loops, use the LONG version of the multi-variable macros to
keep backwards compatibility.

Signed-off-by: Adrian Moreno <amore...@redhat.com>
---

A couple tiny nits, with those addressed:

Acked-by: Dumitru Ceara <dce...@redhat.com>

diff --git a/lib/ovs-numa.h b/lib/ovs-numa.h
index ecc251a7f..83bd10cca 100644
--- a/lib/ovs-numa.h
+++ b/lib/ovs-numa.h
@@ -68,9 +68,9 @@ void ovs_numa_dump_destroy(struct ovs_numa_dump *);
  int ovs_numa_thread_setaffinity_core(unsigned core_id);
#define FOR_EACH_CORE_ON_DUMP(ITER, DUMP) \
-    HMAP_FOR_EACH((ITER), hmap_node, &(DUMP)->cores)
+    HMAP_FOR_EACH (ITER, hmap_node, &(DUMP)->cores)

Nit: kind of unrelated.


Well... yes and no :)

The internal iterator name is now determined by:

#define ITER_VAR(NAME) NAME ## __iterator__

if we pass (myvar), the variable declaration will fail because (myvar)__iterator__ is not a valid variable name. Parenthesis would be required if we supported arbitrary expressions as the first argument but macros won't really work in that case.

I can add a comment explaining this limitation to the macros in include/openvswitch/util.h. Or maybe you can think of a way to overcome this limitation?


#define FOR_EACH_NUMA_ON_DUMP(ITER, DUMP) \
-    HMAP_FOR_EACH((ITER), hmap_node, &(DUMP)->numas)
+    HMAP_FOR_EACH (ITER, hmap_node, &(DUMP)->numas)

Nit: here too.



Thanks
--
Adrián Moreno

_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to