[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1761770.yZzRr5SFh0@vostro.rjw.lan>
Date: Tue, 04 Feb 2014 00:22:32 +0100
From: "Rafael J. Wysocki" <rjw@...ysocki.net>
To: ACPI Devel Maling List <linux-acpi@...r.kernel.org>
Cc: Mika Westerberg <mika.westerberg@...ux.intel.com>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Aaron Lu <aaron.lu@...el.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Linux PCI <linux-pci@...r.kernel.org>
Subject: [PATCH 8/24][Resend] ACPI / hotplug / PCI: Simplify register_slot()
From: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
The err label in register_slot() is only jumped to from one place,
so move the code under the label to that place and drop the label.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
Tested-by: Mika Westerberg <mika.westerberg@...ux.intel.com>
---
drivers/pci/hotplug/acpiphp_glue.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
Index: linux-pm/drivers/pci/hotplug/acpiphp_glue.c
===================================================================
--- linux-pm.orig/drivers/pci/hotplug/acpiphp_glue.c
+++ linux-pm/drivers/pci/hotplug/acpiphp_glue.c
@@ -335,8 +335,10 @@ static acpi_status register_slot(acpi_ha
slot = kzalloc(sizeof(struct acpiphp_slot), GFP_KERNEL);
if (!slot) {
- status = AE_NO_MEMORY;
- goto err;
+ mutex_lock(&acpiphp_context_lock);
+ acpiphp_put_context(context);
+ mutex_unlock(&acpiphp_context_lock);
+ return AE_NO_MEMORY;
}
slot->bus = bridge->pci_bus;
@@ -404,12 +406,6 @@ static acpi_status register_slot(acpi_ha
}
return AE_OK;
-
- err:
- mutex_lock(&acpiphp_context_lock);
- acpiphp_put_context(context);
- mutex_unlock(&acpiphp_context_lock);
- return status;
}
static struct acpiphp_bridge *acpiphp_handle_to_bridge(acpi_handle handle)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists