summaryrefslogtreecommitdiff
path: root/ofproto/ofproto-dpif-xlate.c
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 /ofproto/ofproto-dpif-xlate.c
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 'ofproto/ofproto-dpif-xlate.c')
-rw-r--r--ofproto/ofproto-dpif-xlate.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c
index cc9c1c628..922e02e97 100644
--- a/ofproto/ofproto-dpif-xlate.c
+++ b/ofproto/ofproto-dpif-xlate.c
@@ -1282,7 +1282,7 @@ xlate_ofproto_set(struct ofproto_dpif *ofproto, const char *name,
static void
xlate_xbridge_remove(struct xlate_cfg *xcfg, struct xbridge *xbridge)
{
- struct xbundle *xbundle, *next_xbundle;
+ struct xbundle *xbundle;
struct xport *xport, *next_xport;
if (!xbridge) {
@@ -1293,7 +1293,7 @@ xlate_xbridge_remove(struct xlate_cfg *xcfg, struct xbridge *xbridge)
xlate_xport_remove(xcfg, xport);
}
- LIST_FOR_EACH_SAFE (xbundle, next_xbundle, list_node, &xbridge->xbundles) {
+ LIST_FOR_EACH_SAFE (xbundle, list_node, &xbridge->xbundles) {
xlate_xbundle_remove(xcfg, xbundle);
}