From patchwork Wed Jan 24 10: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: 125631 Delivered-To: patch@linaro.org Received: by 10.46.66.141 with SMTP id h13csp307620ljf; Wed, 24 Jan 2018 02:01:24 -0800 (PST) X-Google-Smtp-Source: AH8x226J3iFBIo2wVg7gSwryCQjldslK54Soal5V11JhKA53K/burnGuwgdT8nhQcUStnvYwVPiT X-Received: by 10.237.38.71 with SMTP id z65mr8270032qtc.248.1516788083984; Wed, 24 Jan 2018 02:01:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516788083; cv=none; d=google.com; s=arc-20160816; b=b0t8d2LRDFUgPjZee0SoCTJT15AzOXRd/35AHQ+Lm1IhEjZnLh2Zs6LhoeOJjbMwQ4 N7GhUXur/S3oNeIom+L5VJ7/AjIEUbb0jVMEukybGzgT/R6XVjZyhCthEdhTAX+vKUyG 6qeej8xTRvA6/XTbik6lf2vcB0HXhhMSB3G97wQZKcxd3u78boAPjCf6dFLPNKjte0me 7ZZV+XyZt5ui9HsSqhxQXM+59KEsisMScKVmWa5T7wNg76ZGkDurKdypv+BwHG6Vpopa i9V5zOthJu0HRZPeQiXCp4YA/ebuYGxZaqehbNpUrsJUNxaKlcB1WgHoIUgzLWgKbE00 rfMw== 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=KrzHtS2Bh5klJ2vCwt10lRRGZdc4NnOHt5KULg+Gujc=; b=grVWhfmzLewJFLPJQ+CDpSpCvDfc2q1vHQ94Brub2vX7LfRk0Nso0TOsbkJerOw8S3 ZzoGgQzYDQw/1gcVeU1nwxqxeb9+tCA8laFeI1n4rwLnFjePnIPJOA6noOpRj1lfYib5 SXCkc/2JufoNVyPC2t9ZfVTet0hGJRqjTxkovn3HyBmDVemg0I0DFQyynBRbjZRhdAWD f1QlbtADcXXZPhEHclQrvG5j6XdzxNGFYCBR2LI3rggdrzM6CsUpbVV/JId/XtuuUZea mI1m7lM7DxYFXKv38MxJKAx2gNcO6I5pOShMqzNSGPHtoJXkQab3M2MQzkYlXE/svAvP 72Tw== 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 f95si929753qkh.117.2018.01.24.02.01.23; Wed, 24 Jan 2018 02:01:23 -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 A30B2617AB; Wed, 24 Jan 2018 10:01:23 +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 29116617D0; Wed, 24 Jan 2018 10:00:40 +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 0A6BC617D0; Wed, 24 Jan 2018 10:00:35 +0000 (UTC) Received: from forward104p.mail.yandex.net (forward104p.mail.yandex.net [77.88.28.107]) by lists.linaro.org (Postfix) with ESMTPS id 8411360C4C for ; Wed, 24 Jan 2018 10:00:27 +0000 (UTC) Received: from mxback5j.mail.yandex.net (mxback5j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10e]) by forward104p.mail.yandex.net (Yandex) with ESMTP id D0C37184838 for ; Wed, 24 Jan 2018 13:00:25 +0300 (MSK) Received: from smtp2p.mail.yandex.net (smtp2p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:7]) by mxback5j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id WFPk4fp02C-0P3W7IPX; Wed, 24 Jan 2018 13:00:25 +0300 Received: by smtp2p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 8PEj4kSoa2-0J9SHhqD; Wed, 24 Jan 2018 13:00:19 +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: Wed, 24 Jan 2018 13:00:10 +0300 Message-Id: <1516788011-7656-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516788011-7656-1-git-send-email-odpbot@yandex.ru> References: <1516788011-7656-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 408 Subject: [lng-odp] [PATCH CATERPILLAR v3 1/2] 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: 1d0d3e4b1cef1a8f746bbc2df65526e82a1cfca9 **/ 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)