From patchwork Sun Aug 11 15:08:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Denis Efremov (Oracle)" X-Patchwork-Id: 11088977 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 28196912 for ; Sun, 11 Aug 2019 15:10:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 144F126E47 for ; Sun, 11 Aug 2019 15:10:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 03AFA27DA4; Sun, 11 Aug 2019 15:10:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9EFB026E47 for ; Sun, 11 Aug 2019 15:10:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726460AbfHKPKA (ORCPT ); Sun, 11 Aug 2019 11:10:00 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:44248 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726453AbfHKPKA (ORCPT ); Sun, 11 Aug 2019 11:10:00 -0400 Received: by mail-wr1-f66.google.com with SMTP id p17so102482260wrf.11; Sun, 11 Aug 2019 08:09:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zQ5jk2zBiGOX8kvtlaUrE9zeV0LbnVUP8cNg6rY4+bo=; b=X8MLPsROl1dmqkBusutFm7dAVkU9qw4121R/flE0NuD6Bfbf6I1geFMYE3DRepY4Ej zbj4X8I7MykkboSV7SLg/EPY12Zhs4IQg0rP7jPjd+GEKX1ZFODvVeMqouk2ZblZBteK J7ys5upUVxEmqndx8yQhblqbJoo4//8gMYqxVenzQNc37QqBYIUsdT/+cCh7agXGzheW kI0/IFYe/QgQSUZOuS1fzFUO7vQ9RTQpa59F3UTN3gOtfIRULDKXo3eoZeVrrQDUmgS6 3KcJ2F/bpAhnfVVqvvMZGXJqBpmjC8IxI6OSuetGnbm2rloMQ44IdpJBgGNv/Ti/7b8k EgQw== X-Gm-Message-State: APjAAAWjVR76h022hcQnL4M5zWKqICLc0o7bP0SabSFo86dMsIcuLIIK nVxxtsfs7qRG6QxLYZS1c+c= X-Google-Smtp-Source: APXvYqwtpXMA/ATmIUzg8Uz0IIOf1hxCxO2YXWI/DXx6dbUrzIeJgQVBwEV3sqHRsytdBVNq6SVJRw== X-Received: by 2002:a5d:48cf:: with SMTP id p15mr37023414wrs.151.1565536198605; Sun, 11 Aug 2019 08:09:58 -0700 (PDT) Received: from localhost.localdomain (broadband-188-32-48-208.ip.moscow.rt.ru. [188.32.48.208]) by smtp.googlemail.com with ESMTPSA id y16sm227049408wrg.85.2019.08.11.08.09.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 11 Aug 2019 08:09:58 -0700 (PDT) From: Denis Efremov To: Bjorn Helgaas Cc: Denis Efremov , Giuseppe Cavallaro , Alexandre Torgue , netdev@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/7] PCI/net: Use PCI_STD_NUM_BARS in loops instead of PCI_STD_RESOURCE_END Date: Sun, 11 Aug 2019 18:08:00 +0300 Message-Id: <20190811150802.2418-5-efremov@linux.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190811150802.2418-1-efremov@linux.com> References: <20190811150802.2418-1-efremov@linux.com> MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch refactors the loop condition scheme from 'i <= PCI_STD_RESOURCE_END' to 'i < PCI_STD_NUM_BARS'. Signed-off-by: Denis Efremov --- drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c | 4 ++-- drivers/net/ethernet/synopsys/dwc-xlgmac-pci.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c index 86f9c07a38cf..cfe496cdd78b 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c @@ -258,7 +258,7 @@ static int stmmac_pci_probe(struct pci_dev *pdev, } /* Get the base address of device */ - for (i = 0; i <= PCI_STD_RESOURCE_END; i++) { + for (i = 0; i < PCI_STD_NUM_BARS; i++) { if (pci_resource_len(pdev, i) == 0) continue; ret = pcim_iomap_regions(pdev, BIT(i), pci_name(pdev)); @@ -296,7 +296,7 @@ static void stmmac_pci_remove(struct pci_dev *pdev) stmmac_dvr_remove(&pdev->dev); - for (i = 0; i <= PCI_STD_RESOURCE_END; i++) { + for (i = 0; i < PCI_STD_NUM_BARS; i++) { if (pci_resource_len(pdev, i) == 0) continue; pcim_iounmap_regions(pdev, BIT(i)); diff --git a/drivers/net/ethernet/synopsys/dwc-xlgmac-pci.c b/drivers/net/ethernet/synopsys/dwc-xlgmac-pci.c index 386bafe74c3f..fa8604d7b797 100644 --- a/drivers/net/ethernet/synopsys/dwc-xlgmac-pci.c +++ b/drivers/net/ethernet/synopsys/dwc-xlgmac-pci.c @@ -34,7 +34,7 @@ static int xlgmac_probe(struct pci_dev *pcidev, const struct pci_device_id *id) return ret; } - for (i = 0; i <= PCI_STD_RESOURCE_END; i++) { + for (i = 0; i < PCI_STD_NUM_BARS; i++) { if (pci_resource_len(pcidev, i) == 0) continue; ret = pcim_iomap_regions(pcidev, BIT(i), XLGMAC_DRV_NAME);