Re: [PATCH 7/7] ACPI / PCI: Reorder checks in acpi_pci_osc_control_set()
From: Hidetoshi Seto <hidden>
Date: 2010-08-02 09:23:55
(2010/07/31 7:37), Rafael J. Wysocki wrote:
quoted hunk ↗ jump to hunk
From: Rafael J. Wysocki <redacted> Make acpi_pci_osc_control_set() attempt to find the handle of the _OSC object under the given PCI root bridge object after verifying that its second argument is correct and that there is a struct acpi_pci_root object for the given root bridge handle. This is more logical than the old code and it matches the code ordering in acpi_pci_root_osc_query(). Signed-off-by: Rafael J. Wysocki <redacted> --- drivers/acpi/pci_root.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) Index: linux-2.6/drivers/acpi/pci_root.c ===================================================================--- linux-2.6.orig/drivers/acpi/pci_root.c +++ linux-2.6/drivers/acpi/pci_root.c@@ -414,10 +414,6 @@ acpi_status acpi_pci_osc_control_set(acp acpi_handle tmp; struct acpi_pci_root *root; - status = acpi_get_handle(handle, "_OSC", &tmp); - if (ACPI_FAILURE(status)) - return status; - control_req = (flags & OSC_PCI_CONTROL_MASKS); if (!control_req) return AE_TYPE;@@ -426,6 +422,10 @@ acpi_status acpi_pci_osc_control_set(acp if (!root) return AE_NOT_EXIST; + status = acpi_get_handle(handle, "_OSC", &tmp); + if (ACPI_FAILURE(status)) + return status; + mutex_lock(&osc_lock); /* No need to evaluate _OSC if the control was already granted. */ if ((root->osc_control_set & control_req) == control_req)
Description is better than Kaneshige-san's [3/6]. And it seems that this patch can be applied alone too. Reviewed-by: Hidetoshi Seto <redacted>