Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp4950968ybe; Mon, 16 Sep 2019 23:24:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqz6dE+ilqbDYcca+y9Cnw+KHeNzM2qz0MrN969j79VZn1EN0GI4FophI6SEz0GSxJMYOPzy X-Received: by 2002:a50:8a21:: with SMTP id i30mr3013259edi.78.1568701467107; Mon, 16 Sep 2019 23:24:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568701467; cv=none; d=google.com; s=arc-20160816; b=Gk4HG5fU0JR4yseQYjRcH/eVieGTCVDEOART2gRxTtgxmWYA0Ch2qXFoNqncuWKhzE XQkFRliqGgqfSo7RC5oVBAuBjp+YPmGt06WC27GWFEWaivkLRRjIsO5z6tbnpaeQuZql winOU32SVh6WmqEMqUHxK3EELO52CTT5+AOJLV2zRrf/sD10iPCyssS/qzWnPjQkBKrm IAtzkScIscRSNBdmvgfmabBSmgx5UAPKJ2afTpEuoRG4YWriUiABXVHXW4sBLCSaQ7kL h4bbgVLurFzd57IMgg1JVwSS9RS9wUt7rQq9KhBg2Tl6gqz5ZhgSjJrsMLM84U3T2RNY upUw== 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=3sxSYLfbzulAgVeJ0Is1a2sfy/t0mpOhwffZAY40o0o=; b=a2bqDvbFgeYs9hBgr0u9akuH2K5hZNj6Ot+bD/SYIerqMcUlDOsQiVY6aoBMLd611k Wxobpys6YiIlBEY7jD9XcAZ6VEDmmJ2CYL2me9WfI0xDqhrgZ+kuaHt4IX3ZbGnEyNxp 3JqFOnDDI6BtjI1Own2J3EPS+Or6ZCd1hF831JPAqVdTczyQOK8MDSxYWPtb8keEU/7A 9LoAt0e27RnG5QX5JQfEB7X0dwmP5HTomqi2guwRB2H+EZkbobnC6hKE9IXRuAlwmHoK xbXIGj82b6V5MkrdsvIihn2jiawjGWcCyNFECFQABO0nonS7PnwOYssl1uotnr4tlYf1 4PsA== 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 m1si797165edb.433.2019.09.16.23.24.03; Mon, 16 Sep 2019 23:24:27 -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 S2403946AbfIPUoZ (ORCPT + 99 others); Mon, 16 Sep 2019 16:44:25 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:40294 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2403842AbfIPUoT (ORCPT ); Mon, 16 Sep 2019 16:44:19 -0400 Received: by mail-wm1-f65.google.com with SMTP id b24so687714wmj.5; Mon, 16 Sep 2019 13:44:16 -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=3sxSYLfbzulAgVeJ0Is1a2sfy/t0mpOhwffZAY40o0o=; b=eMKsVjJD86TT6IgqxLR6Yov40d+L5VLH7t4imYpR9nBnjVcAQE2fkID+DgR8n3eBn+ MT38tbOMS/7cXklWDqdBiVhqoWD17SWvXrDOVGlq4bznqNJJb5XeK8Eh46i2EEZIDsVG Rdo6+c/x56Gh5+TrvKWWlsFpoojiMn1b6Bxirymmw4SDW6Do3RliAJT7zyMgtQaAidja A3XM/KS2W1PLMrHTa76m8kRcVkocYrlK/TL+PFi2sTOTeej19VxM0HCuhrjl3A5eW4VX NnTXCUga7Jb93c/57Pp8YAd08yNWD/EZCDC6iYTycTnufCDZnAz1ToBPhmsZOnHZLtMC fCPQ== X-Gm-Message-State: APjAAAVq9h2QeiwQ3w82lSqQ5XYy8zjMLkjNEo9fK26AniC5A3MYC6Q/ qxZXHLgTZf5+rGvqx6mS/6w= X-Received: by 2002:a1c:dd0a:: with SMTP id u10mr667819wmg.100.1568666656316; Mon, 16 Sep 2019 13:44:16 -0700 (PDT) Received: from black.home (broadband-188-32-48-208.ip.moscow.rt.ru. [188.32.48.208]) by smtp.googlemail.com with ESMTPSA id x6sm231437wmf.38.2019.09.16.13.44.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Sep 2019 13:44:15 -0700 (PDT) From: Denis Efremov To: Bjorn Helgaas Cc: Denis Efremov , linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, Andrew Murray , linux-alpha@vger.kernel.org, Richard Henderson , Ivan Kokshaysky , Matt Turner Subject: [PATCH v3 08/26] alpha/PCI: Use PCI_STD_NUM_BARS Date: Mon, 16 Sep 2019 23:41:40 +0300 Message-Id: <20190916204158.6889-9-efremov@linux.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190916204158.6889-1-efremov@linux.com> References: <20190916204158.6889-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 Use define PCI_STD_NUM_BARS instead of PCI_ROM_RESOURCE for the number of PCI BARs. Cc: Richard Henderson Cc: Ivan Kokshaysky Cc: Matt Turner Signed-off-by: Denis Efremov --- arch/alpha/kernel/pci-sysfs.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/alpha/kernel/pci-sysfs.c b/arch/alpha/kernel/pci-sysfs.c index f94c732fedeb..0021580d79ad 100644 --- a/arch/alpha/kernel/pci-sysfs.c +++ b/arch/alpha/kernel/pci-sysfs.c @@ -71,10 +71,10 @@ static int pci_mmap_resource(struct kobject *kobj, struct pci_bus_region bar; int i; - for (i = 0; i < PCI_ROM_RESOURCE; i++) + for (i = 0; i < PCI_STD_NUM_BARS; i++) if (res == &pdev->resource[i]) break; - if (i >= PCI_ROM_RESOURCE) + if (i >= PCI_STD_NUM_BARS) return -ENODEV; if (res->flags & IORESOURCE_MEM && iomem_is_exclusive(res->start)) @@ -115,7 +115,7 @@ void pci_remove_resource_files(struct pci_dev *pdev) { int i; - for (i = 0; i < PCI_ROM_RESOURCE; i++) { + for (i = 0; i < PCI_STD_NUM_BARS; i++) { struct bin_attribute *res_attr; res_attr = pdev->res_attr[i]; @@ -232,7 +232,7 @@ int pci_create_resource_files(struct pci_dev *pdev) int retval; /* Expose the PCI resources from this device as files */ - for (i = 0; i < PCI_ROM_RESOURCE; i++) { + for (i = 0; i < PCI_STD_NUM_BARS; i++) { /* skip empty resources */ if (!pci_resource_len(pdev, i)) -- 2.21.0