From patchwork Sun Feb 5 16:05:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wiles, Keith" X-Patchwork-Id: 20172 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 0396469C3; Sun, 5 Feb 2017 17:06:06 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 35FBE14EC for ; Sun, 5 Feb 2017 17:05:17 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP; 05 Feb 2017 08:05:16 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,338,1477983600"; d="scan'208";a="40040850" Received: from fshahid-mobl2.amr.corp.intel.com ([10.254.19.238]) by orsmga002.jf.intel.com with ESMTP; 05 Feb 2017 08:05:16 -0800 From: Keith Wiles To: dev@dpdk.org Cc: pascal.mazon@6wind.com, ferruh.yigit@intel.com Date: Sun, 5 Feb 2017 10:05:06 -0600 Message-Id: <20170205160509.88530-3-keith.wiles@intel.com> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20170205160509.88530-1-keith.wiles@intel.com> References: <20170205160509.88530-1-keith.wiles@intel.com> In-Reply-To: <20170202223330.39240-1-keith.wiles@intel.com> References: <20170202223330.39240-1-keith.wiles@intel.com> Subject: [dpdk-dev] [PATCH v2 3/6] net/tap: remove unused variable and minor cleanup X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Signed-off-by: Keith Wiles --- drivers/net/tap/rte_eth_tap.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c index 6d93eb7..61659bc 100644 --- a/drivers/net/tap/rte_eth_tap.c +++ b/drivers/net/tap/rte_eth_tap.c @@ -389,9 +389,7 @@ tap_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *tap_stats) tap_stats->q_ibytes[i] = pmd->rxq[i].stats.ibytes; rx_total += tap_stats->q_ipackets[i]; rx_bytes_total += tap_stats->q_ibytes[i]; - } - for (i = 0; i < imax; i++) { tap_stats->q_opackets[i] = pmd->txq[i].stats.opackets; tap_stats->q_errors[i] = pmd->txq[i].stats.errs; tap_stats->q_obytes[i] = pmd->txq[i].stats.obytes; @@ -416,9 +414,7 @@ tap_stats_reset(struct rte_eth_dev *dev) for (i = 0; i < pmd->nb_queues; i++) { pmd->rxq[i].stats.ipackets = 0; pmd->rxq[i].stats.ibytes = 0; - } - for (i = 0; i < pmd->nb_queues; i++) { pmd->txq[i].stats.opackets = 0; pmd->txq[i].stats.errs = 0; pmd->txq[i].stats.obytes = 0; @@ -633,11 +629,11 @@ static const struct eth_dev_ops ops = { }; static int -pmd_mac_address(int fd, struct rte_eth_dev *dev, struct ether_addr *addr) +pmd_mac_address(int fd, struct ether_addr *addr) { struct ifreq ifr; - if ((fd <= 0) || !dev || !addr) + if ((fd <= 0) || !addr) return -1; memset(&ifr, 0, sizeof(ifr)); @@ -726,7 +722,7 @@ eth_dev_tap_create(const char *name, char *tap_name) pmd->rxq[0].fd = fd; pmd->txq[0].fd = fd; - if (pmd_mac_address(fd, dev, &pmd->eth_addr) < 0) { + if (pmd_mac_address(fd, &pmd->eth_addr) < 0) { RTE_LOG(ERR, PMD, "Unable to get MAC address\n"); goto error_exit; }