mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-27 11:55:53 +00:00
PCI: Simplify __pci_assign_resource() coding style
If an allocation succeeds, we can return success immediately. Then we don't have to test for success in the subsequent code. No functional change. Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
This commit is contained in:
parent
30afe8d00b
commit
d3689df044
@ -213,9 +213,10 @@ static int __pci_assign_resource(struct pci_bus *bus, struct pci_dev *dev,
|
||||
ret = pci_bus_alloc_resource(bus, res, size, align, min,
|
||||
IORESOURCE_PREFETCH | IORESOURCE_MEM_64,
|
||||
pcibios_align_resource, dev);
|
||||
if (ret == 0)
|
||||
return 0;
|
||||
|
||||
if (ret < 0 &&
|
||||
(res->flags & (IORESOURCE_PREFETCH | IORESOURCE_MEM_64)) ==
|
||||
if ((res->flags & (IORESOURCE_PREFETCH | IORESOURCE_MEM_64)) ==
|
||||
(IORESOURCE_PREFETCH | IORESOURCE_MEM_64)) {
|
||||
/*
|
||||
* That failed.
|
||||
@ -225,10 +226,11 @@ static int __pci_assign_resource(struct pci_bus *bus, struct pci_dev *dev,
|
||||
ret = pci_bus_alloc_resource(bus, res, size, align, min,
|
||||
IORESOURCE_PREFETCH,
|
||||
pcibios_align_resource, dev);
|
||||
if (ret == 0)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (ret < 0 &&
|
||||
(res->flags & (IORESOURCE_PREFETCH | IORESOURCE_MEM_64))) {
|
||||
if (res->flags & (IORESOURCE_PREFETCH | IORESOURCE_MEM_64)) {
|
||||
/*
|
||||
* That failed.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user