summaryrefslogtreecommitdiff
path: root/ofproto/pinsched.c
diff options
context:
space:
mode:
authorDaniele Di Proietto <diproiettod@vmware.com>2016-04-06 18:53:59 -0700
committerDaniele Di Proietto <diproiettod@vmware.com>2016-04-26 23:28:59 -0700
commit4ec3d7c7578e827a543cc0989a6cd4c1a10ee291 (patch)
tree8d0960b44448bf6a84a4ad3e609af26685277a4f /ofproto/pinsched.c
parente0b9270136465f1c5379c274ca41081980bcd076 (diff)
downloadopenvswitch-4ec3d7c7578e827a543cc0989a6cd4c1a10ee291.tar.gz
hmap: Add HMAP_FOR_EACH_POP.
Makes popping each member of the hmap a bit easier. Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com> Acked-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'ofproto/pinsched.c')
-rw-r--r--ofproto/pinsched.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/ofproto/pinsched.c b/ofproto/pinsched.c
index 4b2dfd898..ee252f4f9 100644
--- a/ofproto/pinsched.c
+++ b/ofproto/pinsched.c
@@ -257,10 +257,9 @@ void
pinsched_destroy(struct pinsched *ps)
{
if (ps) {
- struct pinqueue *q, *next;
+ struct pinqueue *q;
- HMAP_FOR_EACH_SAFE (q, next, node, &ps->queues) {
- hmap_remove(&ps->queues, &q->node);
+ HMAP_FOR_EACH_POP (q, node, &ps->queues) {
ofpbuf_list_delete(&q->packets);
free(q);
}