From patchwork Wed Feb 28 08:00:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Pettit X-Patchwork-Id: 878985 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ovn.org Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zrp4K4LY6z9s0q for ; Wed, 28 Feb 2018 19:04:17 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 77435EF3; Wed, 28 Feb 2018 08:02:00 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id E3C6EC9F for ; Wed, 28 Feb 2018 08:01:55 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 71F01151 for ; Wed, 28 Feb 2018 08:01:55 +0000 (UTC) X-Originating-IP: 98.234.50.139 Received: from localhost.localdomain (unknown [98.234.50.139]) (Authenticated sender: jpettit@ovn.org) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id CB93841C097 for ; Wed, 28 Feb 2018 09:01:53 +0100 (CET) From: Justin Pettit To: dev@openvswitch.org Date: Wed, 28 Feb 2018 00:00:59 -0800 Message-Id: <1519804863-73126-5-git-send-email-jpettit@ovn.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519804863-73126-1-git-send-email-jpettit@ovn.org> References: <1519804863-73126-1-git-send-email-jpettit@ovn.org> X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [shadow 4/8] Don't shadow iterator values. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org Signed-off-by: Justin Pettit --- 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)));