diff options
author | Adrian Moreno <amorenoz@redhat.com> | 2022-03-23 12:56:14 +0100 |
---|---|---|
committer | Ilya Maximets <i.maximets@ovn.org> | 2022-03-30 16:59:02 +0200 |
commit | e9bf5bffb020e3dca4104118e15c69242bc12e33 (patch) | |
tree | 01e35216faf311d3313c6f20464dc884c2dc1f81 /ofproto/connmgr.c | |
parent | d4566085edf50033087652f35f92b9b77cbec70f (diff) | |
download | openvswitch-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 'ofproto/connmgr.c')
-rw-r--r-- | ofproto/connmgr.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ofproto/connmgr.c b/ofproto/connmgr.c index fa8f6cd0e..5666d7283 100644 --- a/ofproto/connmgr.c +++ b/ofproto/connmgr.c @@ -351,8 +351,8 @@ connmgr_run(struct connmgr *mgr, } } - struct ofconn *ofconn, *next_ofconn; - LIST_FOR_EACH_SAFE (ofconn, next_ofconn, connmgr_node, &mgr->conns) { + struct ofconn *ofconn; + LIST_FOR_EACH_SAFE (ofconn, connmgr_node, &mgr->conns) { ofconn_run(ofconn, handle_openflow); } ofmonitor_run(mgr); @@ -1953,8 +1953,8 @@ static void ofservice_close_all(struct ofservice *ofservice) OVS_REQUIRES(ofproto_mutex) { - struct ofconn *ofconn, *next; - LIST_FOR_EACH_SAFE (ofconn, next, ofservice_node, &ofservice->conns) { + struct ofconn *ofconn; + LIST_FOR_EACH_SAFE (ofconn, ofservice_node, &ofservice->conns) { ofconn_destroy(ofconn); } } |