From patchwork Mon Nov 14 18:58:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13042691 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9FD44C352AA for ; Mon, 14 Nov 2022 18:58:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236608AbiKNS6R (ORCPT ); Mon, 14 Nov 2022 13:58:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235836AbiKNS6L (ORCPT ); Mon, 14 Nov 2022 13:58:11 -0500 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3816F1D33D; Mon, 14 Nov 2022 10:58:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1668452290; x=1699988290; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=x6ggnXnghcO12tbT4wtQfhiqCsVpusNaj/2IGyQVVxI=; b=i3uF8urp3pCu/Df8JGxRDJ/iY/G6MQwQDC0b2ezYdPXiSn/faE7m3dE/ 7UlImdTQyyY9dtNs1UxJ+0iGkc3ntR2KDgJvWZvpF1Y0YsVnUzyLsWy3H RMrGMyiYAoJMG6H1eXy2jLO+49h3I5aw9bRAd5xINCcQ6c/j7bPZEH1mh RRXhXAIzA2PnMXDPAjieUhgzyrpbAGwrPDVQ+sghzgMYOGOv8MqJVu4Ym mgDvhoIttGDlYwvUVaR9hYRNYS8gzh7PYMPXn6XtszEKQT+jz+k4gisSd el7iJT2+jocapLWGSWzQwx4GHfTB8xxUTfZZkUvsS+Y+r7oq/ww3V4Hxe A==; X-IronPort-AV: E=McAfee;i="6500,9779,10531"; a="338843412" X-IronPort-AV: E=Sophos;i="5.96,164,1665471600"; d="scan'208";a="338843412" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Nov 2022 10:58:09 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10531"; a="638607285" X-IronPort-AV: E=Sophos;i="5.96,164,1665471600"; d="scan'208";a="638607285" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga002.jf.intel.com with ESMTP; 14 Nov 2022 10:58:00 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id BAA212F3; Mon, 14 Nov 2022 20:58:24 +0200 (EET) From: Andy Shevchenko To: =?utf-8?q?Micka=C3=ABl_Sala=C3=BCn?= , Mika Westerberg , Andy Shevchenko , Michael Ellerman , Arnd Bergmann , Bjorn Helgaas , "Rafael J. Wysocki" , =?utf-8?q?Pali_Roh=C3=A1r?= , 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 v3 0/4] PCI: Add pci_dev_for_each_resource() helper and Date: Mon, 14 Nov 2022 20:58:18 +0200 Message-Id: <20221114185822.65038-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org 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/r/20221114115953.40236-1-mika.westerberg@linux.intel.com Changelog v3: - rebased on top of v2 by Mika, see above - added tag to pcmcia patch (Dominik) 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(-)