Re: [PATCH 3/6] ACPI/PCI: optimize checks in acpi_pci_osc_control_set()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Friday, July 30, 2010, Kenji Kaneshige wrote:
> Check for ACPI _OSC object is heavier than other checks in
> acpi_pci_osc_control_set(). So move it after the other checks.
> 
> Signed-off-by: Rafael J. Wysocki <rjw@xxxxxxx>
> Signed-off-by: Kenji Kaneshige <kaneshige.kenji@xxxxxxxxxxxxxx>

OK

Rafael

> ---
>  drivers/acpi/pci_root.c |    8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> Index: linux-2.6.35-rc6/drivers/acpi/pci_root.c
> ===================================================================
> --- linux-2.6.35-rc6.orig/drivers/acpi/pci_root.c
> +++ linux-2.6.35-rc6/drivers/acpi/pci_root.c
> @@ -388,10 +388,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;
> @@ -400,6 +396,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)
> 
> 
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux