Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp693427ybl; Fri, 16 Aug 2019 02:27:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqxD8n33uSjVctkrsaTeG7Mmc+4BZarIpUI5jjRCWO0iK8XUMW9By1ZqSikaG4ip7ljwa6av X-Received: by 2002:a63:40a:: with SMTP id 10mr7041619pge.317.1565947643311; Fri, 16 Aug 2019 02:27:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565947643; cv=none; d=google.com; s=arc-20160816; b=MSo4bLcLjVRm7THUWaJvxZfqvVrX+nHMeHXY4Gebk16oiOMEYCoXeVxrRxA9fvlxEe M68gju7hzTZoDOxMM6Mw0B7APb3YAxwubKEO0ayh3TU4KAd8hrQtTZl67/lJsBhDd5ID D6JJXUz7e27DH07o3y9MTFmcFwLdSGPMVMJ6GA2UPpLOyXmQbyEjmBPQL22QPLHePu9X I1kQmvpvRVc4lKrJsL/+qjMAZnasvN9KdVD7HVx+uOBhWF8RBuQaQIL+roawWrvBahmu HrsnvsZAFlUiu+2HkpG4ckI+W6t6uF0nCBCwU42v88DvFn0824n4b6foVgHFN/XTUbmN zaUA== 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=zu/6tv2CuG9JSQuI18kICycXFKyLsNIBW3plqogVCew=; b=HxCJrjVVW54MqDhCAF9NeUIAq8AkB1bbS1rpMnJMjFCYMRFmSDcDAj6GhmpVQQJvLD A2AhkpBY2yEcAAuzDuKKkzLM/j1B5r33v1nhdyH52ii5WRgXfbE+ORAm60mWwCq/65Aj MnHUnQ5vW/gRW2hmUs7HjGajRGe5/y1RKUlMsPSKPW7FK/WQAWZqmbftdAt3Ot6exSuc TIXl9hCMqim94tZwKgHryGCR7oPawombwq7PIU9vKAEJbuktI321yiEvfwdkEeNexTW9 5qvXM6ATgtveXBu6O+ssvaKPxKY0JqkGjhNYmD1vyJexkj3LFVZjxSsQ6/hE4qQ0t2Q/ KG3g== 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 y186si3471231pgd.440.2019.08.16.02.27.05; Fri, 16 Aug 2019 02:27:23 -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 S1727172AbfHPJ0S (ORCPT + 99 others); Fri, 16 Aug 2019 05:26:18 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:37679 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727141AbfHPJ0R (ORCPT ); Fri, 16 Aug 2019 05:26:17 -0400 Received: by mail-wm1-f65.google.com with SMTP id z23so3519587wmf.2; Fri, 16 Aug 2019 02:26:15 -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=zu/6tv2CuG9JSQuI18kICycXFKyLsNIBW3plqogVCew=; b=PXLHyB6ISITixXWc1WLZQ7AynlA3Qlu5U64S3tCJe+EBXEkFPMPkHj3F4VPewv8t0O gbKYi9983RHiTcEVeZg2GCNPgHVBByg/KUI1xeFx+2uG0Rl7ZScsbFuHAS16QCzuhxDR ca8thiwKld6yjNiNwQTwTzvXKUG13W8Mg1f/K/19YL17iz3PEWo1u5IX/QZNeEsKI/8K DnVhIurYjV27PCDIysVEQdiOfmpryAMno+ySd8AJSYtfXKetCWMpYD53UCDaPJLZ2XbU e71E3bpoworFdqbJerD1OD9Ga0p5pT4EmEGbxaI7P39xP5vjO0nRy+053IL3FQCYbvTB +1AA== X-Gm-Message-State: APjAAAXl+xuJSi5OkCf2DAoO7JypMnMJvSJ7JgCELVFgA1iyO9zP/845 SiItgP+O5LWiZ5nZkr9yTkQ= X-Received: by 2002:a1c:5a56:: with SMTP id o83mr6219308wmb.103.1565947574930; Fri, 16 Aug 2019 02:26:14 -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 q20sm16521138wrc.79.2019.08.16.02.26.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Aug 2019 02:26:14 -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 v2 04/10] stmmac: pci: Loop using PCI_STD_NUM_BARS Date: Fri, 16 Aug 2019 12:24:31 +0300 Message-Id: <20190816092437.31846-5-efremov@linux.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190816092437.31846-1-efremov@linux.com> References: <20190816092437.31846-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 Refactor loops to use 'i < PCI_STD_NUM_BARS' instead of 'i <= PCI_STD_RESOURCE_END'. Signed-off-by: Denis Efremov --- drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 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)); -- 2.21.0