diff options
author | Adrian Moreno <amorenoz@redhat.com> | 2022-03-23 12:56:17 +0100 |
---|---|---|
committer | Ilya Maximets <i.maximets@ovn.org> | 2022-03-30 16:59:02 +0200 |
commit | 9e56549c2bba79e644de2d3876b363553175210c (patch) | |
tree | bf0bf39f86c3e63eda7171f727a6ca3dcc69922b /vtep | |
parent | 860e69a8c3d6994dc000b37d682bd16cd2925bef (diff) | |
download | openvswitch-9e56549c2bba79e644de2d3876b363553175210c.tar.gz |
hmap: use short version of safe loops if possible.
Using SHORT version of the *_SAFE loops makes the code cleaner and less
error prone. So, use the SHORT version and remove the extra variable
when possible for hmap and all its derived types.
In order to be able to use both long and short versions without changing
the name of the macro for all the clients, overload the existing name
and select the appropriate version depending on the number of arguments.
Acked-by: Dumitru Ceara <dceara@redhat.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Adrian Moreno <amorenoz@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Diffstat (limited to 'vtep')
-rw-r--r-- | vtep/vtep-ctl.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/vtep/vtep-ctl.c b/vtep/vtep-ctl.c index 3465d899b..99c4adcd5 100644 --- a/vtep/vtep-ctl.c +++ b/vtep/vtep-ctl.c @@ -801,12 +801,12 @@ vtep_ctl_context_invalidate_cache(struct ctl_context *ctx) SHASH_FOR_EACH (node, &vtepctl_ctx->lswitches) { struct vtep_ctl_lswitch *ls = node->data; - struct shash_node *node2, *next_node2; + struct shash_node *node2; shash_destroy(&ls->ucast_local); shash_destroy(&ls->ucast_remote); - SHASH_FOR_EACH_SAFE (node2, next_node2, &ls->mcast_local) { + SHASH_FOR_EACH_SAFE (node2, &ls->mcast_local) { struct vtep_ctl_mcast_mac *mcast_mac = node2->data; struct vtep_ctl_ploc *ploc; @@ -818,7 +818,7 @@ vtep_ctl_context_invalidate_cache(struct ctl_context *ctx) } shash_destroy(&ls->mcast_local); - SHASH_FOR_EACH_SAFE (node2, next_node2, &ls->mcast_remote) { + SHASH_FOR_EACH_SAFE (node2, &ls->mcast_remote) { struct vtep_ctl_mcast_mac *mcast_mac = node2->data; struct vtep_ctl_ploc *ploc; |