summaryrefslogtreecommitdiff
path: root/ofproto/ofproto-dpif-ipfix.c
diff options
context:
space:
mode:
authorAdrian Moreno <amorenoz@redhat.com>2022-03-23 12:56:17 +0100
committerIlya Maximets <i.maximets@ovn.org>2022-03-30 16:59:02 +0200
commit9e56549c2bba79e644de2d3876b363553175210c (patch)
treebf0bf39f86c3e63eda7171f727a6ca3dcc69922b /ofproto/ofproto-dpif-ipfix.c
parent860e69a8c3d6994dc000b37d682bd16cd2925bef (diff)
downloadopenvswitch-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 'ofproto/ofproto-dpif-ipfix.c')
-rw-r--r--ofproto/ofproto-dpif-ipfix.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ofproto/ofproto-dpif-ipfix.c b/ofproto/ofproto-dpif-ipfix.c
index ff4b6339a..fc927fe86 100644
--- a/ofproto/ofproto-dpif-ipfix.c
+++ b/ofproto/ofproto-dpif-ipfix.c
@@ -1078,7 +1078,7 @@ dpif_ipfix_set_options(
{
int i;
struct ofproto_ipfix_flow_exporter_options *options;
- struct dpif_ipfix_flow_exporter_map_node *node, *next;
+ struct dpif_ipfix_flow_exporter_map_node *node;
ovs_mutex_lock(&mutex);
dpif_ipfix_bridge_exporter_set_options(&di->bridge_exporter,
@@ -1103,7 +1103,7 @@ dpif_ipfix_set_options(
}
/* Remove dropped flow exporters, if any needs to be removed. */
- HMAP_FOR_EACH_SAFE (node, next, node, &di->flow_exporter_map) {
+ HMAP_FOR_EACH_SAFE (node, node, &di->flow_exporter_map) {
/* This is slow but doesn't take any extra memory, and
* this table is not supposed to contain many rows anyway. */
options = (struct ofproto_ipfix_flow_exporter_options *)
@@ -1215,7 +1215,7 @@ static void
dpif_ipfix_clear(struct dpif_ipfix *di) OVS_REQUIRES(mutex)
{
struct dpif_ipfix_flow_exporter_map_node *exp_node;
- struct dpif_ipfix_port *dip, *next;
+ struct dpif_ipfix_port *dip;
dpif_ipfix_bridge_exporter_clear(&di->bridge_exporter);
@@ -1224,7 +1224,7 @@ dpif_ipfix_clear(struct dpif_ipfix *di) OVS_REQUIRES(mutex)
free(exp_node);
}
- HMAP_FOR_EACH_SAFE (dip, next, hmap_node, &di->ports) {
+ HMAP_FOR_EACH_SAFE (dip, hmap_node, &di->ports) {
dpif_ipfix_del_port__(di, dip);
}
}