Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 05013486 authored by Bjorn Helgaas's avatar Bjorn Helgaas
Browse files

PCI: Return early on allocation failures to unindent mainline code



On allocation failure, return early so the main body of the function
doesn't have to be indented as the body of an "if" statement.  No
functional change.

Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
parent dc087f2f
Loading
Loading
Loading
Loading
+15 −14
Original line number Diff line number Diff line
@@ -456,7 +456,9 @@ static struct pci_bus * pci_alloc_bus(void)
	struct pci_bus *b;

	b = kzalloc(sizeof(*b), GFP_KERNEL);
	if (b) {
	if (!b)
		return NULL;

	INIT_LIST_HEAD(&b->node);
	INIT_LIST_HEAD(&b->children);
	INIT_LIST_HEAD(&b->devices);
@@ -464,7 +466,6 @@ static struct pci_bus * pci_alloc_bus(void)
	INIT_LIST_HEAD(&b->resources);
	b->max_bus_speed = PCI_SPEED_UNKNOWN;
	b->cur_bus_speed = PCI_SPEED_UNKNOWN;
	}
	return b;
}

@@ -485,11 +486,11 @@ static struct pci_host_bridge *pci_alloc_host_bridge(struct pci_bus *b)
	struct pci_host_bridge *bridge;

	bridge = kzalloc(sizeof(*bridge), GFP_KERNEL);
	if (bridge) {
	if (!bridge)
		return NULL;

	INIT_LIST_HEAD(&bridge->windows);
	bridge->bus = b;
	}

	return bridge;
}