Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2755314ybl; Sun, 11 Aug 2019 08:11:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqwXJQYwkN+xGgUFoGRN7usswk6KTTctycW//5S0ndk6ovHrRHdLYX7Wy4tb66Eh8gogfaxv X-Received: by 2002:a63:c1c:: with SMTP id b28mr26479378pgl.354.1565536264986; Sun, 11 Aug 2019 08:11:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565536264; cv=none; d=google.com; s=arc-20160816; b=Mrh6Ts970uuMXH8yRcTqYHQucgfMXFKZLvdsVvEU+looQz3cDJBQxlVoQpQJ5jNQAx 2UmJL5Je8cpY/HMGlWm2mhDqKDOO83uIMq6iuHCi/KHIAIIrrJecCEAKuU7vDFfyBKSO QYSfOin0IRpefCoRDxR7sP6JK81DVIByZmJ3LOlWX2efeBWcNI5W0gpjWpjGmm7DVkoj lRE/ZT0EsAXpd67YH7pcbOqvnl2kJTewLXze/8DhAnK+yScwtRqXgpNbMynxpxjsD3cb pQ8wYChQg5SwFFA5O6NAzjg9AL4yyluXfMuN6/KStns5ySP1oDRWFjyuLS322dZoWY2w j+Lw== 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 :message-id:date:subject:cc:to:from; bh=eztnnIti2zE7e0S0pjOphceDUSBj3rZYDgwaHLj9EiY=; b=D3/eACQ2ur82JgPeCn+l56/R8i9DbK+o0M5JvzHED8pj+BgkBg8en9srguehBRRi/0 5pR49JFhxryN1RGAf0IxmGN/eQHbGjjzUVQRZ4oZLxkOZ1cegUKm70fmii4wEAcggRld Ei05btneX1a2TV9Jbue57ibYt2+x7JUUc7x7Qou4YMQo+e3vHIIWi+oIeUK+2hRyfpqU jxlBIiSydOxWhpw9nyWhdk2gkO5eFoSir1X4J+3NmmYXxzt5Sjtc1k3xiOk3Dx09qqmY ZlADe7J1U5IUCYQtNAbTMLrrEahYpQ/aa+dm36HL+qCv+Z7UVL3avBTdscrdn20FkwEr rYdA== 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 t23si9385974pjw.56.2019.08.11.08.10.14; Sun, 11 Aug 2019 08:11:04 -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 S1726551AbfHKPIY (ORCPT + 99 others); Sun, 11 Aug 2019 11:08:24 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:40989 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726424AbfHKPIY (ORCPT ); Sun, 11 Aug 2019 11:08:24 -0400 Received: by mail-wr1-f66.google.com with SMTP id j16so228138wrr.8; Sun, 11 Aug 2019 08:08:22 -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:mime-version :content-transfer-encoding; bh=eztnnIti2zE7e0S0pjOphceDUSBj3rZYDgwaHLj9EiY=; b=V/20Cr/g1JzzFMSiYPMIXDrE7vJuebZ6OIFlW1U11OtVN3DT5FToE5wVKS1ws8iKOH WcIgrjZU4zTU5oz1AnTVOdulUBt9dIN8Cj5+TBOMeCIrj929yKajdN0N+4MYPa5AfbFm levHVHwFJRgjK5IabrVzUk5XxYIsDgRPeSln8lZB/Ks2TvUuCS9TTBLYWmhQHknPn8wH T5iZ64b7oO6QigHUpZX0HQBdUEBk/Ocg76JNMlIodm2leBrchKTNQC5hDPESYL2ie7OL 3p0P4y+a5Bjy4esl/NoBx+AfU4N21bpPiR1sdy/EozhnSxv29/jGHmVk7U8nJFIV05LB UY7Q== X-Gm-Message-State: APjAAAXM1nfD4XVH6N/OuyCUTkE4hJ9TEKdbHqMa+GzD4dqoc1rWQE1+ RGGLqrpNCbEQGMeSHDKKiK0= X-Received: by 2002:a05:6000:10c9:: with SMTP id b9mr22781411wrx.11.1565536101466; Sun, 11 Aug 2019 08:08:21 -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.08.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 11 Aug 2019 08:08:20 -0700 (PDT) From: Denis Efremov To: Bjorn Helgaas Cc: Denis Efremov , Sebastian Ott , Gerald Schaefer , "H. Peter Anvin" , Giuseppe Cavallaro , Alexandre Torgue , Matt Porter , Alexandre Bounine , Peter Jones , Bartlomiej Zolnierkiewicz , Cornelia Huck , Alex Williamson , kvm@vger.kernel.org, linux-fbdev@vger.kernel.org, netdev@vger.kernel.org, x86@kernel.org, linux-s390@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 0/7] Add definition for the number of standard PCI BARs Date: Sun, 11 Aug 2019 18:07:55 +0300 Message-Id: <20190811150802.2418-1-efremov@linux.com> X-Mailer: git-send-email 2.21.0 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 Code that iterates over all standard PCI BARs typically uses PCI_STD_RESOURCE_END, but this is error-prone because it requires "i <= PCI_STD_RESOURCE_END" rather than something like "i < PCI_STD_NUM_BARS". We could add such a definition and use it the same way PCI_SRIOV_NUM_BARS is used. There is already the definition PCI_BAR_COUNT for s390 only. Thus, this patchset introduces it globally. The patch is splitted into 7 parts for different drivers/subsystems for easy readability. Denis Efremov (7): PCI: Add define for the number of standard PCI BARs s390/pci: Replace PCI_BAR_COUNT with PCI_STD_NUM_BARS x86/PCI: Use PCI_STD_NUM_BARS in loops instead of PCI_STD_RESOURCE_END PCI/net: Use PCI_STD_NUM_BARS in loops instead of PCI_STD_RESOURCE_END rapidio/tsi721: use PCI_STD_NUM_BARS in loops instead of PCI_STD_RESOURCE_END efifb: Use PCI_STD_NUM_BARS in loops instead of PCI_STD_RESOURCE_END vfio_pci: Use PCI_STD_NUM_BARS in loops instead of PCI_STD_RESOURCE_END arch/s390/include/asm/pci.h | 5 +---- arch/s390/include/asm/pci_clp.h | 6 +++--- arch/s390/pci/pci.c | 16 ++++++++-------- arch/s390/pci/pci_clp.c | 6 +++--- arch/x86/pci/common.c | 2 +- drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c | 4 ++-- drivers/net/ethernet/synopsys/dwc-xlgmac-pci.c | 2 +- drivers/pci/quirks.c | 2 +- drivers/rapidio/devices/tsi721.c | 2 +- drivers/vfio/pci/vfio_pci.c | 4 ++-- drivers/vfio/pci/vfio_pci_config.c | 2 +- drivers/vfio/pci/vfio_pci_private.h | 4 ++-- drivers/video/fbdev/efifb.c | 2 +- include/linux/pci.h | 2 +- include/uapi/linux/pci_regs.h | 1 + 15 files changed, 29 insertions(+), 31 deletions(-) -- 2.21.0