From patchwork Thu Nov 3 16:46:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13030645 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 91F66C433FE for ; Thu, 3 Nov 2022 16:46:55 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.436893.691090 (Exim 4.92) (envelope-from ) id 1oqdMa-0001lV-74; Thu, 03 Nov 2022 16:46:44 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 436893.691090; Thu, 03 Nov 2022 16:46:44 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1oqdMa-0001lO-49; Thu, 03 Nov 2022 16:46:44 +0000 Received: by outflank-mailman (input) for mailman id 436893; Thu, 03 Nov 2022 16:46:42 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1oqdMY-000197-0X for xen-devel@lists.xenproject.org; Thu, 03 Nov 2022 16:46:42 +0000 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 1548d4d0-5b97-11ed-91b5-6bf2151ebd3b; Thu, 03 Nov 2022 17:46:39 +0100 (CET) Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Nov 2022 09:46:36 -0700 Received: from black.fi.intel.com ([10.237.72.28]) by orsmga007.jf.intel.com with ESMTP; 03 Nov 2022 09:46:29 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 858A5F7; Thu, 3 Nov 2022 18:46:52 +0200 (EET) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 1548d4d0-5b97-11ed-91b5-6bf2151ebd3b DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1667493999; x=1699029999; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=6sEwb2LvPX9v9prH3mu2nEGi0LVqQc1+Me9tIfh9Gsk=; b=Nd7KO1lUqzSnMtk3j7fYSRN4GBMulzyp8KtXzvtG6CJ3U8l0+Bw02ZYM 56Q0/w04hbsprEsCu7TpWXhSVHW587RksAV9JZ3yEL2KDC35A8DgUON9T S9V3ICr0AbOnFFdGzl+JWCeDkn+TJ2uCNhdvnrKcDIYU80ENRVrjjvMF4 QUfEk+tVFXZSWMcVeL34qNT0ZZ1z/dnzaFvI2fa3BGd6WgiLFY42JwZV0 FZvWu40M4ewv8maytGzDy0gsJ2WHoIajwyNW4eo7g+olJU+E9weHXxkKP gTgBjOqn60ynR9iyRXS6K2OkGl47/em5PD+/9CmQm1sHGCEdA6k878nFy g==; X-IronPort-AV: E=McAfee;i="6500,9779,10520"; a="309732828" X-IronPort-AV: E=Sophos;i="5.96,134,1665471600"; d="scan'208";a="309732828" X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10520"; a="629408020" X-IronPort-AV: E=Sophos;i="5.96,134,1665471600"; d="scan'208";a="629408020" From: Andy Shevchenko To: =?utf-8?q?Micka=C3=ABl_Sala=C3=BCn?= , Andy Shevchenko , Mika Westerberg , Michael Ellerman , Arnd Bergmann , Bjorn Helgaas , "Rafael J. Wysocki" , Juergen Gross , Dominik Brodowski , linux-kernel@vger.kernel.org, linux-alpha@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org, linux-pci@vger.kernel.org, xen-devel@lists.xenproject.org Cc: Miguel Ojeda , Richard Henderson , Ivan Kokshaysky , Matt Turner , Russell King , Thomas Bogendoerfer , Nicholas Piggin , Christophe Leroy , "David S. Miller" , Bjorn Helgaas , Stefano Stabellini , Oleksandr Tyshchenko Subject: [PATCH v2 0/4] PCI: Add pci_dev_for_each_resource() helper and refactor bus one Date: Thu, 3 Nov 2022 18:46:40 +0200 Message-Id: <20221103164644.70554-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Provide two new helper macros to iterate over PCI device resources and convert users. Looking at it, refactor existing pci_bus_for_each_resource() and convert users accordingly. This applies on top of this patch Mika sent out earlier: https://lore.kernel.org/linux-pci/20221103103254.30497-1-mika.westerberg@linux.intel.com/ Changelog v2: - refactor to have two macros - refactor existing pci_bus_for_each_resource() in the same way and convert users Andy Shevchenko (3): PCI: Split pci_bus_for_each_resource_p() out of pci_bus_for_each_resource() EISA: Convert to use pci_bus_for_each_resource_p() pcmcia: Convert to use pci_bus_for_each_resource_p() Mika Westerberg (1): PCI: Introduce pci_dev_for_each_resource() .clang-format | 3 +++ arch/alpha/kernel/pci.c | 5 ++--- arch/arm/kernel/bios32.c | 16 ++++++------- arch/mips/pci/pci-legacy.c | 3 +-- arch/powerpc/kernel/pci-common.c | 5 ++--- arch/sparc/kernel/leon_pci.c | 5 ++--- arch/sparc/kernel/pci.c | 10 ++++----- arch/sparc/kernel/pcic.c | 5 ++--- drivers/eisa/pci_eisa.c | 4 ++-- drivers/pci/bus.c | 7 +++--- drivers/pci/hotplug/shpchp_sysfs.c | 8 +++---- drivers/pci/pci.c | 5 ++--- drivers/pci/probe.c | 2 +- drivers/pci/remove.c | 5 ++--- drivers/pci/setup-bus.c | 36 ++++++++++++------------------ drivers/pci/setup-res.c | 4 +--- drivers/pci/xen-pcifront.c | 4 +--- drivers/pcmcia/rsrc_nonstatic.c | 9 +++----- drivers/pcmcia/yenta_socket.c | 3 +-- include/linux/pci.h | 25 +++++++++++++++++---- 20 files changed, 78 insertions(+), 86 deletions(-)