diff options
author | Vasily Gorbik <gor@linux.ibm.com> | 2023-04-04 19:29:28 +0300 |
---|---|---|
committer | Vasily Gorbik <gor@linux.ibm.com> | 2023-04-04 19:29:28 +0300 |
commit | f62f8b716da158f94bf191ea89b34d01bf94b261 (patch) | |
tree | 9fdfbdb5096b3b576ae56c9977cd66af9d345300 /arch/s390/pci/pci.c | |
parent | 85206bf95313c33a244d6ea4304b01ade95b8b05 (diff) | |
parent | 49d6e68f66132ee521d587ce97645ed2d3183d90 (diff) | |
download | linux-f62f8b716da158f94bf191ea89b34d01bf94b261.tar.xz |
Merge branch 'uaccess-inline-asm-cleanup' into features
Heiko Carstens says:
===================
There are a couple of oddities within the s390 uaccess library
functions. Therefore cleanup the whole uaccess.c file.
There is no functional change, only improved readability. The output
of "objdump -Dr" was always compared before/after each patch to make
sure that the generated object file is identical, if that could be
expected. Therefore the series also includes more patches than really
required to cleanup the code.
Furthermore the kunit usercopy tests also still pass.
===================
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Diffstat (limited to 'arch/s390/pci/pci.c')
-rw-r--r-- | arch/s390/pci/pci.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/arch/s390/pci/pci.c b/arch/s390/pci/pci.c index ed6ff20dd0f6..afc3f33788da 100644 --- a/arch/s390/pci/pci.c +++ b/arch/s390/pci/pci.c @@ -544,8 +544,7 @@ static struct resource *__alloc_res(struct zpci_dev *zdev, unsigned long start, return r; } -int zpci_setup_bus_resources(struct zpci_dev *zdev, - struct list_head *resources) +int zpci_setup_bus_resources(struct zpci_dev *zdev) { unsigned long addr, size, flags; struct resource *res; @@ -581,7 +580,6 @@ int zpci_setup_bus_resources(struct zpci_dev *zdev, return -ENOMEM; } zdev->bars[i].res = res; - pci_add_resource(resources, res); } zdev->has_resources = 1; @@ -590,17 +588,23 @@ int zpci_setup_bus_resources(struct zpci_dev *zdev, static void zpci_cleanup_bus_resources(struct zpci_dev *zdev) { + struct resource *res; int i; + pci_lock_rescan_remove(); for (i = 0; i < PCI_STD_NUM_BARS; i++) { - if (!zdev->bars[i].size || !zdev->bars[i].res) + res = zdev->bars[i].res; + if (!res) continue; + release_resource(res); + pci_bus_remove_resource(zdev->zbus->bus, res); zpci_free_iomap(zdev, zdev->bars[i].map_idx); - release_resource(zdev->bars[i].res); - kfree(zdev->bars[i].res); + zdev->bars[i].res = NULL; + kfree(res); } zdev->has_resources = 0; + pci_unlock_rescan_remove(); } int pcibios_device_add(struct pci_dev *pdev) |