Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2755735ybl; Sun, 11 Aug 2019 08:11:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqwwZ6zuebNOxF1G/yHE6utYGCbn6XSsR34q5ZPLTF1bbhhSduau3yQZ9jJGcw2qOttRXAir X-Received: by 2002:a65:49cc:: with SMTP id t12mr24632188pgs.83.1565536291734; Sun, 11 Aug 2019 08:11:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565536291; cv=none; d=google.com; s=arc-20160816; b=SLNjxipNrNdqTshfmp08HZ5BoGy5HCY7QaPnd/zb4phNtLK7DRzGTT095mgJKAWiWq dasRvED2oOYz2AlN561YevnBwCAeJ9A0wBkNFV6+CzFp2S6cfTfB8FDY89dv7Q0M2+w7 AFFhi3A0/cMPrX9RrqEEDj8+rOYeKulMNqq8iW/AGhOKYgYlpwb1g/5iK44nWd9wxtHL WpUM2akA8T7v4pE+tqhKIFxsR+To2foxuiS3cMz1wBO5TjiFQZTfZuMPtSxTBq5i+UVU hEIURj+ldNwfimA6C7wqUV9o653/CwmFOocJcIgRCmu7Dgz/E+8GqpuVmsUvYjLGvS+8 hxxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=zQ5jk2zBiGOX8kvtlaUrE9zeV0LbnVUP8cNg6rY4+bo=; b=BD1GQLzpMDgDkYhwrnumgdQOfGaJCAj+8LDjLRNy1NuYPT0pacBL3s2olkikqK8db8 8jH0vHzrgM0qdCOm1DtC+c3Unfe/XUs+yGLes4x5LB6gcIe2qjAzvmVSaHEVrHmbxCUs n+rNMi8Ypsq7EBYbMQKhKSo/SHSflytzmPuTa+99lPj9S0Yf7PvwygETRSFrKD7sRNEq 265WJF82yKjptx28BegZX4trrGct9qWbJAWe4O2R5pnl5VpBa9teZod+OGW8Hf1Cmy4t wkHK7JomgRIQDolbyjNj/SPi1z3uMhTKDmwDhZQ5U4PaMDIUXrXCH4e1IY+HkZ0Fv+ph YOfg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q199si58990789pfq.112.2019.08.11.08.11.16; Sun, 11 Aug 2019 08:11:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726684AbfHKPKB (ORCPT + 99 others); Sun, 11 Aug 2019 11:10:01 -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-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 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); -- 2.21.0