[ovs-dev] [shadow 4/8] Don't shadow iterator values.

Justin Pettit jpettit at ovn.org
Wed Feb 28 08:00:59 UTC 2018


Signed-off-by: Justin Pettit <jpettit at ovn.org>
---
 lib/dpif-netdev.c | 4 ++--
 lib/nx-match.c    | 5 ++---
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index c0959050d47c..b07fc6b8b327 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -3536,7 +3536,7 @@ rxq_scheduling(struct dp_netdev *dp, bool pinned) OVS_REQUIRES(dp->port_mutex)
     struct rr_numa_list rr;
     struct rr_numa *non_local_numa = NULL;
     struct dp_netdev_rxq ** rxqs = NULL;
-    int i, n_rxqs = 0;
+    int n_rxqs = 0;
     struct rr_numa *numa = NULL;
     int numa_id;
 
@@ -3589,7 +3589,7 @@ rxq_scheduling(struct dp_netdev *dp, bool pinned) OVS_REQUIRES(dp->port_mutex)
 
     rr_numa_list_populate(dp, &rr);
     /* Assign the sorted queues to pmds in round robin. */
-    for (i = 0; i < n_rxqs; i++) {
+    for (int i = 0; i < n_rxqs; i++) {
         numa_id = netdev_get_numa_id(rxqs[i]->port->netdev);
         numa = rr_numa_list_lookup(&rr, numa_id);
         if (!numa) {
diff --git a/lib/nx-match.c b/lib/nx-match.c
index 005c4a6ac09d..a8edb2e9d245 100644
--- a/lib/nx-match.c
+++ b/lib/nx-match.c
@@ -1025,7 +1025,6 @@ nx_put_raw(struct ofpbuf *b, enum ofp_version oxm, const struct match *match,
     ovs_be16 dl_type = get_dl_type(flow);
     ovs_be32 spi_mask;
     int match_len;
-    int i;
 
     BUILD_ASSERT_DECL(FLOW_WC_SEQ == 40);
 
@@ -1182,12 +1181,12 @@ nx_put_raw(struct ofpbuf *b, enum ofp_version oxm, const struct match *match,
 
     /* Registers. */
     if (oxm < OFP15_VERSION) {
-        for (i = 0; i < FLOW_N_REGS; i++) {
+        for (int i = 0; i < FLOW_N_REGS; i++) {
             nxm_put_32m(&ctx, MFF_REG0 + i, oxm,
                         htonl(flow->regs[i]), htonl(match->wc.masks.regs[i]));
         }
     } else {
-        for (i = 0; i < FLOW_N_XREGS; i++) {
+        for (int i = 0; i < FLOW_N_XREGS; i++) {
             nxm_put_64m(&ctx, MFF_XREG0 + i, oxm,
                         htonll(flow_get_xreg(flow, i)),
                         htonll(flow_get_xreg(&match->wc.masks, i)));
-- 
2.7.4



More information about the dev mailing list