From patchwork Thu Jan 25 08:00:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 125774 Delivered-To: patch@linaro.org Received: by 10.46.66.141 with SMTP id h13csp944662ljf; Thu, 25 Jan 2018 00:03:11 -0800 (PST) X-Google-Smtp-Source: AH8x227mCLpXboF2/6l3iyaTFv1g+Re+NUSj+mAXS3+H6Vcvy6EC7zfUDn8dqBsXatXVAwVgHW/Z X-Received: by 10.200.42.233 with SMTP id c38mr15756697qta.310.1516867390989; Thu, 25 Jan 2018 00:03:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516867390; cv=none; d=google.com; s=arc-20160816; b=k+6ZLj3f2SkJ72fJhMlFaYtErTqCI0K57CtRiluQb1EqRPlNAm2FYUgL5OtMYVGZii jirTu6YCxu6tmd07Ovj8L0ZkBXLBMPULQg9eLlww/ZJFeUdfRiISBTwZvFSbImiB0tPf g6E+BcMEAvkQZ+pfYjJ1Yk39gJ7HqJ65I6EqNPzfu02Xvqy6kBrI+4CeYtvkbsKdZxxS gQOrfGgtVK/9oG4/Kf5EtQM5ZVpAidv44QgAQ7X+aX9YkGWE8x4sk8BvDvj3uklzbXcr gNx7fLyaG9mklUCJFa+KdZdQV01+5GBQ92Y3Dh4i4q7d55UFRV3N4lqpUTVAzUpXTsA8 fZ8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=zuYapr8E4b0RorqcSrCB9IfezC/g96NIeEM22yNQrcU=; b=0uJIadOWGwEo21FGbS0i0bzi4y/xwfHKHwV/97aQPsHUnNP/BXqof4e+JtbkBQfrpQ lqLxtPpum89ZbVeRMNTBm9MPJamxuoyWaU4/nclD/A7dyXAJRYpbScqfc3Nj/F4/isbG v8PSa1TRES5DYwgCNHPFyJu6KfuSoJP4V1IKMSCOucNasd3Xp9gWIp4f+zn4kBBqkVPM 7rdgRzCcLASX2VHIKWvkm9Swxgh3jhSFOYv+9x990TzaMtK5DpT2s3+eeVQq1HC4SHsY RmgcvvJ4/49MqyH/KJFil1O0pQiSrWA1QGNAI71UbTZNmN8bE6FfTdWbDkV5k4+hzmG7 j+MQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id t30si1095454qtg.184.2018.01.25.00.03.10; Thu, 25 Jan 2018 00:03:10 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 946E161767; Thu, 25 Jan 2018 08:03:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2 autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 5860A6176C; Thu, 25 Jan 2018 08:00:53 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 6A38661796; Thu, 25 Jan 2018 08:00:41 +0000 (UTC) Received: from forward100j.mail.yandex.net (forward100j.mail.yandex.net [5.45.198.240]) by lists.linaro.org (Postfix) with ESMTPS id 25B33607E0 for ; Thu, 25 Jan 2018 08:00:18 +0000 (UTC) Received: from mxback5g.mail.yandex.net (mxback5g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:166]) by forward100j.mail.yandex.net (Yandex) with ESMTP id 548885D84E40 for ; Thu, 25 Jan 2018 11:00:15 +0300 (MSK) Received: from smtp3o.mail.yandex.net (smtp3o.mail.yandex.net [2a02:6b8:0:1a2d::27]) by mxback5g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id tv334LhkBF-0FMqA3hT; Thu, 25 Jan 2018 11:00:15 +0300 Received: by smtp3o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id HyRzbFHzjS-0E9mGa6v; Thu, 25 Jan 2018 11:00:14 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Thu, 25 Jan 2018 11:00:10 +0300 Message-Id: <1516867212-18991-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516867212-18991-1-git-send-email-odpbot@yandex.ru> References: <1516867212-18991-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 408 Subject: [lng-odp] [PATCH CATERPILLAR v4 1/3] linux-gen: pktio: coding style fixup X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Mykyta Iziumtsev Declare iterator variable used in "for" loop in containing scope instead of "for" scope itself. Although it's valid C99 syntax and "for" loop defines own scope it is still preferred to not use it in OpenDataPlane code. Signed-off-by: Mykyta Iziumtsev --- /** Email created from pull request 408 (MykytaI:caterpillar_mdev_e1000e) ** https://github.com/Linaro/odp/pull/408 ** Patch: https://github.com/Linaro/odp/pull/408.patch ** Base sha: f87bb5146fb25f7cd62246500cb4f7e625375654 ** Merge commit sha: 9ab7ecd5f9b053b699caa643dd1de3bbe19c850d **/ platform/linux-generic/pktio/mdev/cxgb4.c | 6 ++++-- platform/linux-generic/pktio/mdev/i40e.c | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/platform/linux-generic/pktio/mdev/cxgb4.c b/platform/linux-generic/pktio/mdev/cxgb4.c index f09835d9f..5c55d87a4 100644 --- a/platform/linux-generic/pktio/mdev/cxgb4.c +++ b/platform/linux-generic/pktio/mdev/cxgb4.c @@ -509,20 +509,22 @@ static int cxgb4_open(odp_pktio_t id ODP_UNUSED, static int cxgb4_close(pktio_entry_t *pktio_entry) { + uint16_t i; + pktio_ops_cxgb4_data_t *pkt_cxgb4 = pktio_entry->s.ops_data; ODP_DBG("%s: close %s\n", MODULE_NAME, pkt_cxgb4->mdev.if_name); mdev_device_destroy(&pkt_cxgb4->mdev); - for (uint16_t i = 0; i < pkt_cxgb4->capa.max_input_queues; i++) { + for (i = 0; i < pkt_cxgb4->capa.max_input_queues; i++) { cxgb4_rx_queue_t *rxq = &pkt_cxgb4->rx_queues[i]; if (rxq->rx_data.size) mdev_dma_area_free(&pkt_cxgb4->mdev, &rxq->rx_data); } - for (uint16_t i = 0; i < pkt_cxgb4->capa.max_output_queues; i++) { + for (i = 0; i < pkt_cxgb4->capa.max_output_queues; i++) { cxgb4_tx_queue_t *txq = &pkt_cxgb4->tx_queues[i]; if (txq->tx_data.size) diff --git a/platform/linux-generic/pktio/mdev/i40e.c b/platform/linux-generic/pktio/mdev/i40e.c index 6f3b71712..f2be2bcf3 100644 --- a/platform/linux-generic/pktio/mdev/i40e.c +++ b/platform/linux-generic/pktio/mdev/i40e.c @@ -344,20 +344,22 @@ static int i40e_open(odp_pktio_t id ODP_UNUSED, static int i40e_close(pktio_entry_t *pktio_entry) { + uint16_t i; + pktio_ops_i40e_data_t *pkt_i40e = pktio_entry->s.ops_data; ODP_DBG("%s: close %s\n", MODULE_NAME, pkt_i40e->mdev.if_name); mdev_device_destroy(&pkt_i40e->mdev); - for (uint16_t i = 0; i < pkt_i40e->capa.max_input_queues; i++) { + for (i = 0; i < pkt_i40e->capa.max_input_queues; i++) { i40e_rx_queue_t *rxq = &pkt_i40e->rx_queues[i]; if (rxq->rx_data.size) mdev_dma_area_free(&pkt_i40e->mdev, &rxq->rx_data); } - for (uint16_t i = 0; i < pkt_i40e->capa.max_output_queues; i++) { + for (i = 0; i < pkt_i40e->capa.max_output_queues; i++) { i40e_tx_queue_t *txq = &pkt_i40e->tx_queues[i]; if (txq->tx_data.size)