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: 1623 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2315713wru; Mon, 14 Nov 2022 11:11:03 -0800 (PST) X-Google-Smtp-Source: AA0mqf78gtMtk/j2y2JwLPxViH+8TYlzzPIYr6waUvRu07UMxhnh3DyjiIDUZy8cc0IKgah+nU+d X-Received: by 2002:a63:5203:0:b0:46e:f23a:e9aa with SMTP id g3-20020a635203000000b0046ef23ae9aamr12495235pgb.428.1668453062720; Mon, 14 Nov 2022 11:11:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668453062; cv=none; d=google.com; s=arc-20160816; b=xlTnQhPgOgiXuo0X7vrPULgNf274C3OUnofJAnLsVch8URcQcjZYYTIWo7k+ZyGM8I XY2SOXtv5imZ696sXP4fDYf1gcQhKSlLE3em9KuEmZPz0/sy1vSMDCZE5EujDGLCej4t MfPwA4s+mJs7WUrO9DOHaT4Ofs8U1BEwOoGZeRMygE5/AJBqR3SqYCDjAz1Z0u1k7BSy L5ri9odtEjrKu/FBZIhrwtQArJ3Pkzw2X3JpqU5/eP7JK2XWAnOGzgCbIcU5D6FGj7+V 5FfYg4DxoDkkYzYRlivkNh7cgKUuIvWiXNgN2qKEZvPyeRiC79F5cyofq+EQVOnY7+4N 0s/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=GCyVbnMgQ32CjaFEGqKy+9AKdMzZIqgPrXLGxULE1J4=; b=oUA/YMU/iO/vbYR8vg0s7fuIYY8gJcm9ZYQr1PgstriuGOZTTQBcclaOAplFLS2qzj kBrTis6XH0mDQL73iGlO10vo3aAdnm+NtRhAGfk/L8XJyEwudKV3D0v9RCDvyAA6Iq5m 5yvb8zvaSJ+h8SMxaLM8WTpDlTXZImhcKAHRFM/iU/ygdjZYrwenJMXtZjPieM+pM9oE 7gniF9RnwTtjGuEAqwQfoC6HEaqKJdkn+evGKhtOa1Nedxv3iqu3SLz57HtCxheb6maI gJAzcOLQ64gxZ9x6TT/cOH2YxGTbAAY45Jm0MJjyLXjvOI9iLKtfdGiXVL6ZEs7x3+ac oV+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=i3uF8urp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g128-20020a636b86000000b00473cd4d74a1si10264217pgc.240.2022.11.14.11.10.47; Mon, 14 Nov 2022 11:11:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=i3uF8urp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236784AbiKNS6b (ORCPT + 99 others); Mon, 14 Nov 2022 13:58:31 -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 X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749499838878462302?= X-GMAIL-MSGID: =?utf-8?q?1749499838878462302?= 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(-)