summaryrefslogtreecommitdiff
path: root/vtep
diff options
context:
space:
mode:
authorAdrian Moreno <amorenoz@redhat.com>2022-03-23 12:56:14 +0100
committerIlya Maximets <i.maximets@ovn.org>2022-03-30 16:59:02 +0200
commite9bf5bffb020e3dca4104118e15c69242bc12e33 (patch)
tree01e35216faf311d3313c6f20464dc884c2dc1f81 /vtep
parentd4566085edf50033087652f35f92b9b77cbec70f (diff)
downloadopenvswitch-e9bf5bffb020e3dca4104118e15c69242bc12e33.tar.gz
list: use short version of safe loops if possible.
Using the 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. 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.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/vtep/vtep-ctl.c b/vtep/vtep-ctl.c
index ab552457d..3465d899b 100644
--- a/vtep/vtep-ctl.c
+++ b/vtep/vtep-ctl.c
@@ -808,9 +808,9 @@ vtep_ctl_context_invalidate_cache(struct ctl_context *ctx)
SHASH_FOR_EACH_SAFE (node2, next_node2, &ls->mcast_local) {
struct vtep_ctl_mcast_mac *mcast_mac = node2->data;
- struct vtep_ctl_ploc *ploc, *next_ploc;
+ struct vtep_ctl_ploc *ploc;
- LIST_FOR_EACH_SAFE (ploc, next_ploc, locators_node,
+ LIST_FOR_EACH_SAFE (ploc, locators_node,
&mcast_mac->locators) {
free(ploc);
}
@@ -820,9 +820,9 @@ vtep_ctl_context_invalidate_cache(struct ctl_context *ctx)
SHASH_FOR_EACH_SAFE (node2, next_node2, &ls->mcast_remote) {
struct vtep_ctl_mcast_mac *mcast_mac = node2->data;
- struct vtep_ctl_ploc *ploc, *next_ploc;
+ struct vtep_ctl_ploc *ploc;
- LIST_FOR_EACH_SAFE (ploc, next_ploc, locators_node,
+ LIST_FOR_EACH_SAFE (ploc, locators_node,
&mcast_mac->locators) {
free(ploc);
}
@@ -1229,9 +1229,9 @@ del_port(struct vtep_ctl_context *vtepctl_ctx, struct vtep_ctl_port *port)
static void
del_pswitch(struct vtep_ctl_context *vtepctl_ctx, struct vtep_ctl_pswitch *ps)
{
- struct vtep_ctl_port *port, *next_port;
+ struct vtep_ctl_port *port;
- LIST_FOR_EACH_SAFE (port, next_port, ports_node, &ps->ports) {
+ LIST_FOR_EACH_SAFE (port, ports_node, &ps->ports) {
del_port(vtepctl_ctx, port);
}