Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/958755/?format=api
{ "id": 958755, "url": "http://patchwork.ozlabs.org/api/patches/958755/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20180817102645.3839621-4-arnd@arndb.de/", "project": { "id": 2, "url": "http://patchwork.ozlabs.org/api/projects/2/?format=api", "name": "Linux PPC development", "link_name": "linuxppc-dev", "list_id": "linuxppc-dev.lists.ozlabs.org", "list_email": "linuxppc-dev@lists.ozlabs.org", "web_url": "https://github.com/linuxppc/wiki/wiki", "scm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git", "webscm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/", "list_archive_url": "https://lore.kernel.org/linuxppc-dev/", "list_archive_url_format": "https://lore.kernel.org/linuxppc-dev/{}/", "commit_url_format": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?id={}" }, "msgid": "<20180817102645.3839621-4-arnd@arndb.de>", "list_archive_url": "https://lore.kernel.org/linuxppc-dev/20180817102645.3839621-4-arnd@arndb.de/", "date": "2018-08-17T10:26:33", "name": "[RFC,03/15] PCI: move pci_scan_root_bus into callers", "commit_ref": null, "pull_url": null, "state": "not-applicable", "archived": false, "hash": "39030f4c5f49367308c82d34611cf680724ebdfe", "submitter": { "id": 30, "url": "http://patchwork.ozlabs.org/api/people/30/?format=api", "name": "Arnd Bergmann", "email": "arnd@arndb.de" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20180817102645.3839621-4-arnd@arndb.de/mbox/", "series": [ { "id": 61229, "url": "http://patchwork.ozlabs.org/api/series/61229/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=61229", "date": "2018-08-17T10:26:32", "name": "PCI: turn some __weak functions into callbacks", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/61229/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/958755/comments/", "check": "warning", "checks": "http://patchwork.ozlabs.org/api/patches/958755/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>", "X-Original-To": [ "patchwork-incoming@ozlabs.org", "linuxppc-dev@lists.ozlabs.org" ], "Delivered-To": [ "patchwork-incoming@ozlabs.org", "linuxppc-dev@lists.ozlabs.org" ], "Received": [ "from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\t(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 41sKYC2yS2z9s3Z\n\tfor <patchwork-incoming@ozlabs.org>;\n\tFri, 17 Aug 2018 20:43:11 +1000 (AEST)", "from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 41sKYC1crWzF0vb\n\tfor <patchwork-incoming@ozlabs.org>;\n\tFri, 17 Aug 2018 20:43:11 +1000 (AEST)", "from mout.kundenserver.de (mout.kundenserver.de [217.72.192.73])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128\n\tbits)) (No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 41sKKB6CqkzDrWY\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tFri, 17 Aug 2018 20:32:45 +1000 (AEST)", "from wuerfel.lan ([109.193.40.16]) by mrelayeu.kundenserver.de\n\t(mreue101 [212.227.15.145]) with ESMTPA (Nemesis) id\n\t0Mf0OX-1fXBJl1wd7-00OXrw; Fri, 17 Aug 2018 12:27:16 +0200" ], "Authentication-Results": [ "ozlabs.org;\n\tdmarc=none (p=none dis=none) header.from=arndb.de", "lists.ozlabs.org;\n\tdmarc=none (p=none dis=none) header.from=arndb.de", "lists.ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=arndb.de\n\t(client-ip=217.72.192.73; helo=mout.kundenserver.de;\n\tenvelope-from=arnd@arndb.de; receiver=<UNKNOWN>)", "lists.ozlabs.org;\n\tdmarc=none (p=none dis=none) header.from=arndb.de" ], "From": "Arnd Bergmann <arnd@arndb.de>", "To": "linux-pci@vger.kernel.org,\n\tBjorn Helgaas <bhelgaas@google.com>", "Subject": "[RFC 03/15] PCI: move pci_scan_root_bus into callers", "Date": "Fri, 17 Aug 2018 12:26:33 +0200", "Message-Id": "<20180817102645.3839621-4-arnd@arndb.de>", "X-Mailer": "git-send-email 2.18.0", "In-Reply-To": "<20180817102645.3839621-1-arnd@arndb.de>", "References": "<20180817102645.3839621-1-arnd@arndb.de>", "X-Provags-ID": "V03:K1:/BkngKF/6b10KWqzjF4LQs6B6MkQtkRFmL6SWbFHT/fR7ZScAD6\n\tPxIPcoQ33neYAd2DVQLD4hSnISy5S+mjTGrPpMPdZPzOGGwcgsdWWFM+AuB+VXQ/Un5aGIY\n\tStxePL7nJko2UJ1UZ5SoqMJdCUyytat7rPOFwnoUXMwuQprWGUrja1NmIA1Y28QzLVqWGsL\n\tVZPgBGucfp/4ObNhRus3w==", "X-UI-Out-Filterresults": "notjunk:1; V01:K0:yk/2WoKa2Tc=:UZx4Ov030SIXEGCgA89BLa\n\tFo7ZjH7sD3AjG5Olyljg6m0KZNfNxTw4KN4WaBTbdciiJyzE9Nw2OqOnlrR63j7oiDJBVZaOd\n\ts9NmiGAJunm6OpoovumSicVPX53M/9bECWo1zLMuDvmT2l55e9ph+zWE3+iWaXg0XqbsA9SnI\n\twQVT1yyBFacJosDoePfbuMw5g2w8UGIfoOJQ3ewVd5qJk9XhbgfK6oJf02f7AoFHoPFSWLZe6\n\tt7vXC3p/uNgZlgxH2zg6f+gAvOfsiuGUU7c03yz7PE5qMswJpjkvnqWRPPXnqG6N02v3QJomV\n\tyiCAD2ZrXAnBidZ1nCpHyrI17n7/QvgK86I3h1psOQPsLieFhcawINXKNI1K+WXskW2lhZvrq\n\t2x6KiGWINfBINz6Y9VA4gLZQz1yWKxGglBCKphglpE6HGwLHVIaoki/7fb683+vjKpJv2xRXp\n\tYHAxC7s+/XR8lQRoKRCL7FUB4wqjeQ1Gsie8TZriTyMtUdqvMsLU7WjxbiUcgyLsguIw+vXr5\n\t97L4OarAAGrQcjvppO7sHk8eyu12XUuDYmjHgTKfPQBh3c+Af27LbvvIv6Z49ct5uYJUAeqn9\n\tVF2lOMRy5cP4spbAiTVydTZVhP0xQesHqYOwasIPqxePgv5iErX0JTIdpZ+DeuW0jQ8Eyh8t1\n\tTa6LBxHDivrMsFXmCyrxPnINY+sjfjXqMtfSqpDRJRollpk7d7KE/NzL0a2BFiBtRkQ8=", "X-BeenThere": "linuxppc-dev@lists.ozlabs.org", "X-Mailman-Version": "2.1.27", "Precedence": "list", "List-Id": "Linux on PowerPC Developers Mail List\n\t<linuxppc-dev.lists.ozlabs.org>", "List-Unsubscribe": "<https://lists.ozlabs.org/options/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=unsubscribe>", "List-Archive": "<http://lists.ozlabs.org/pipermail/linuxppc-dev/>", "List-Post": "<mailto:linuxppc-dev@lists.ozlabs.org>", "List-Help": "<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=help>", "List-Subscribe": "<https://lists.ozlabs.org/listinfo/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=subscribe>", "Cc": "Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,\n\tArnd Bergmann <arnd@arndb.de>, linux-kernel@vger.kernel.org,\n\tChristoph Hellwig <hch@infradead.org>, linux-acpi@vger.kernel.org,\n\tlinuxppc-dev@lists.ozlabs.org", "Errors-To": "linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org", "Sender": "\"Linuxppc-dev\"\n\t<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>" }, "content": "There are only six remaining callers of the old pci_scan_root_bus()\ninterface. Since we want to expose the pci_host_bridge structure\neverywhere and discourage users from calling the old interfaces, let's\nmove the implementation into the respective callsites.\n\nWhile this duplicates the source code, it makes the object code smaller\nfor almost all users by avoiding the global implementation, and it allows\nfurther cleanup of the callers.\n\nSigned-off-by: Arnd Bergmann <arnd@arndb.de>\n---\n arch/ia64/sn/kernel/io_init.c | 27 +++++++++++++++++++++++++++\n arch/microblaze/pci/pci-common.c | 27 +++++++++++++++++++++++++++\n arch/s390/pci/pci.c | 27 +++++++++++++++++++++++++++\n arch/x86/pci/common.c | 27 +++++++++++++++++++++++++++\n arch/xtensa/kernel/pci.c | 27 +++++++++++++++++++++++++++\n drivers/pci/probe.c | 28 ----------------------------\n drivers/pci/xen-pcifront.c | 27 +++++++++++++++++++++++++++\n include/linux/pci.h | 3 ---\n 8 files changed, 162 insertions(+), 31 deletions(-)", "diff": "diff --git a/arch/ia64/sn/kernel/io_init.c b/arch/ia64/sn/kernel/io_init.c\nindex d63809a6adfa..e768702a7b45 100644\n--- a/arch/ia64/sn/kernel/io_init.c\n+++ b/arch/ia64/sn/kernel/io_init.c\n@@ -213,6 +213,33 @@ sn_io_slot_fixup(struct pci_dev *dev)\n }\n EXPORT_SYMBOL(sn_io_slot_fixup);\n \n+static struct pci_bus *pci_scan_root_bus(struct device *parent, int bus,\n+\t\tstruct pci_ops *ops, void *sysdata, struct list_head *resources)\n+{\n+\tstruct pci_host_bridge *bridge;\n+\tint error;\n+\n+\tbridge = pci_alloc_host_bridge(0);\n+\tif (!bridge)\n+\t\treturn NULL;\n+\n+\tlist_splice_init(resources, &bridge->windows);\n+\tbridge->dev.parent = parent;\n+\tbridge->sysdata = sysdata;\n+\tbridge->busnr = bus;\n+\tbridge->ops = ops;\n+\n+\terror = pci_scan_root_bus_bridge(bridge);\n+\tif (error < 0)\n+\t\tgoto err_out;\n+\n+\treturn bridge->bus;\n+\n+err_out:\n+\tkfree(bridge);\n+\treturn NULL;\n+}\n+\n /*\n * sn_pci_controller_fixup() - This routine sets up a bus's resources\n *\t\t\t consistent with the Linux PCI abstraction layer.\ndiff --git a/arch/microblaze/pci/pci-common.c b/arch/microblaze/pci/pci-common.c\nindex f34346d56095..302071385e1b 100644\n--- a/arch/microblaze/pci/pci-common.c\n+++ b/arch/microblaze/pci/pci-common.c\n@@ -977,6 +977,33 @@ static void pcibios_setup_phb_resources(struct pci_controller *hose,\n \t\t (unsigned long)hose->io_base_virt - _IO_BASE);\n }\n \n+static struct pci_bus *pci_scan_root_bus(struct device *parent, int bus,\n+\t\tstruct pci_ops *ops, void *sysdata, struct list_head *resources)\n+{\n+\tstruct pci_host_bridge *bridge;\n+\tint error;\n+\n+\tbridge = pci_alloc_host_bridge(0);\n+\tif (!bridge)\n+\t\treturn NULL;\n+\n+\tlist_splice_init(resources, &bridge->windows);\n+\tbridge->dev.parent = parent;\n+\tbridge->sysdata = sysdata;\n+\tbridge->busnr = bus;\n+\tbridge->ops = ops;\n+\n+\terror = pci_scan_root_bus_bridge(bridge);\n+\tif (error < 0)\n+\t\tgoto err_out;\n+\n+\treturn bridge->bus;\n+\n+err_out:\n+\tkfree(bridge);\n+\treturn NULL;\n+}\n+\n static void pcibios_scan_phb(struct pci_controller *hose)\n {\n \tLIST_HEAD(resources);\ndiff --git a/arch/s390/pci/pci.c b/arch/s390/pci/pci.c\nindex 9f6f392a4461..b21205f131ce 100644\n--- a/arch/s390/pci/pci.c\n+++ b/arch/s390/pci/pci.c\n@@ -786,6 +786,33 @@ void pcibios_remove_bus(struct pci_bus *bus)\n \tkfree(zdev);\n }\n \n+static struct pci_bus *pci_scan_root_bus(struct device *parent, int bus,\n+\t\tstruct pci_ops *ops, void *sysdata, struct list_head *resources)\n+{\n+\tstruct pci_host_bridge *bridge;\n+\tint error;\n+\n+\tbridge = pci_alloc_host_bridge(0);\n+\tif (!bridge)\n+\t\treturn NULL;\n+\n+\tlist_splice_init(resources, &bridge->windows);\n+\tbridge->dev.parent = parent;\n+\tbridge->sysdata = sysdata;\n+\tbridge->busnr = bus;\n+\tbridge->ops = ops;\n+\n+\terror = pci_scan_root_bus_bridge(bridge);\n+\tif (error < 0)\n+\t\tgoto err_out;\n+\n+\treturn bridge->bus;\n+\n+err_out:\n+\tkfree(bridge);\n+\treturn NULL;\n+}\n+\n static int zpci_scan_bus(struct zpci_dev *zdev)\n {\n \tLIST_HEAD(resources);\ndiff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c\nindex d4ec117c1142..e740d9aa4024 100644\n--- a/arch/x86/pci/common.c\n+++ b/arch/x86/pci/common.c\n@@ -453,6 +453,33 @@ void __init dmi_check_pciprobe(void)\n \tdmi_check_system(pciprobe_dmi_table);\n }\n \n+static struct pci_bus *pci_scan_root_bus(struct device *parent, int bus,\n+\t\tstruct pci_ops *ops, void *sysdata, struct list_head *resources)\n+{\n+\tstruct pci_host_bridge *bridge;\n+\tint error;\n+\n+\tbridge = pci_alloc_host_bridge(0);\n+\tif (!bridge)\n+\t\treturn NULL;\n+\n+\tlist_splice_init(resources, &bridge->windows);\n+\tbridge->dev.parent = parent;\n+\tbridge->sysdata = sysdata;\n+\tbridge->busnr = bus;\n+\tbridge->ops = ops;\n+\n+\terror = pci_scan_root_bus_bridge(bridge);\n+\tif (error < 0)\n+\t\tgoto err_out;\n+\n+\treturn bridge->bus;\n+\n+err_out:\n+\tkfree(bridge);\n+\treturn NULL;\n+}\n+\n void pcibios_scan_root(int busnum)\n {\n \tstruct pci_bus *bus;\ndiff --git a/arch/xtensa/kernel/pci.c b/arch/xtensa/kernel/pci.c\nindex 21f13e9aabe1..5a8fd67e6c5e 100644\n--- a/arch/xtensa/kernel/pci.c\n+++ b/arch/xtensa/kernel/pci.c\n@@ -116,6 +116,33 @@ static void __init pci_controller_apertures(struct pci_controller *pci_ctrl,\n \t}\n }\n \n+static struct pci_bus *pci_scan_root_bus(struct device *parent, int bus,\n+\t\tstruct pci_ops *ops, void *sysdata, struct list_head *resources)\n+{\n+\tstruct pci_host_bridge *bridge;\n+\tint error;\n+\n+\tbridge = pci_alloc_host_bridge(0);\n+\tif (!bridge)\n+\t\treturn NULL;\n+\n+\tlist_splice_init(resources, &bridge->windows);\n+\tbridge->dev.parent = parent;\n+\tbridge->sysdata = sysdata;\n+\tbridge->busnr = bus;\n+\tbridge->ops = ops;\n+\n+\terror = pci_scan_root_bus_bridge(bridge);\n+\tif (error < 0)\n+\t\tgoto err_out;\n+\n+\treturn bridge->bus;\n+\n+err_out:\n+\tkfree(bridge);\n+\treturn NULL;\n+}\n+\n static int __init pcibios_init(void)\n {\n \tstruct pci_controller *pci_ctrl;\ndiff --git a/drivers/pci/probe.c b/drivers/pci/probe.c\nindex 12c3aa63c34d..cf169742c03e 100644\n--- a/drivers/pci/probe.c\n+++ b/drivers/pci/probe.c\n@@ -3050,34 +3050,6 @@ int pci_scan_root_bus_bridge(struct pci_host_bridge *bridge)\n }\n EXPORT_SYMBOL(pci_scan_root_bus_bridge);\n \n-struct pci_bus *pci_scan_root_bus(struct device *parent, int bus,\n-\t\tstruct pci_ops *ops, void *sysdata, struct list_head *resources)\n-{\n-\tstruct pci_host_bridge *bridge;\n-\tint error;\n-\n-\tbridge = pci_alloc_host_bridge(0);\n-\tif (!bridge)\n-\t\treturn NULL;\n-\n-\tlist_splice_init(resources, &bridge->windows);\n-\tbridge->dev.parent = parent;\n-\tbridge->sysdata = sysdata;\n-\tbridge->busnr = bus;\n-\tbridge->ops = ops;\n-\n-\terror = pci_scan_root_bus_bridge(bridge);\n-\tif (error < 0)\n-\t\tgoto err_out;\n-\n-\treturn bridge->bus;\n-\n-err_out:\n-\tkfree(bridge);\n-\treturn NULL;\n-}\n-EXPORT_SYMBOL(pci_scan_root_bus);\n-\n /**\n * pci_rescan_bus_bridge_resize - Scan a PCI bus for devices\n * @bridge: PCI bridge for the bus to scan\ndiff --git a/drivers/pci/xen-pcifront.c b/drivers/pci/xen-pcifront.c\nindex eba6e33147a2..24070e1c5f22 100644\n--- a/drivers/pci/xen-pcifront.c\n+++ b/drivers/pci/xen-pcifront.c\n@@ -443,6 +443,33 @@ static int pcifront_scan_bus(struct pcifront_device *pdev,\n \treturn 0;\n }\n \n+static struct pci_bus *pci_scan_root_bus(struct device *parent, int bus,\n+\t\tstruct pci_ops *ops, void *sysdata, struct list_head *resources)\n+{\n+\tstruct pci_host_bridge *bridge;\n+\tint error;\n+\n+\tbridge = pci_alloc_host_bridge(0);\n+\tif (!bridge)\n+\t\treturn NULL;\n+\n+\tlist_splice_init(resources, &bridge->windows);\n+\tbridge->dev.parent = parent;\n+\tbridge->sysdata = sysdata;\n+\tbridge->busnr = bus;\n+\tbridge->ops = ops;\n+\n+\terror = pci_scan_root_bus_bridge(bridge);\n+\tif (error < 0)\n+\t\tgoto err_out;\n+\n+\treturn bridge->bus;\n+\n+err_out:\n+\tkfree(bridge);\n+\treturn NULL;\n+}\n+\n static int pcifront_scan_root(struct pcifront_device *pdev,\n \t\t\t\t unsigned int domain, unsigned int bus)\n {\ndiff --git a/include/linux/pci.h b/include/linux/pci.h\nindex d77ce35a2b33..d226e06fb5e5 100644\n--- a/include/linux/pci.h\n+++ b/include/linux/pci.h\n@@ -912,9 +912,6 @@ int pci_host_probe(struct pci_host_bridge *bridge);\n int pci_bus_insert_busn_res(struct pci_bus *b, int bus, int busmax);\n int pci_bus_update_busn_res_end(struct pci_bus *b, int busmax);\n void pci_bus_release_busn_res(struct pci_bus *b);\n-struct pci_bus *pci_scan_root_bus(struct device *parent, int bus,\n-\t\t\t\t struct pci_ops *ops, void *sysdata,\n-\t\t\t\t struct list_head *resources);\n int pci_scan_root_bus_bridge(struct pci_host_bridge *bridge);\n struct pci_bus *pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev,\n \t\t\t\tint busnr);\n", "prefixes": [ "RFC", "03/15" ] }