lkml.org 
[lkml]   [2009]   [May]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRE: [PATCH] ACPICA: Eliminate double call to acpi_ns_get_parent_node in acpi_get_parent
I will integrate this into ACPICA.

Thanks,
Bob


>-----Original Message-----
>From: Alex Chiang [mailto:achiang@hp.com]
>Sent: Monday, May 18, 2009 8:23 PM
>To: lenb@kernel.org
>Cc: linux-acpi@vger.kernel.org; linux-kernel@vger.kernel.org; Moore, Robert
>Subject: [PATCH] ACPICA: Eliminate double call to acpi_ns_get_parent_node
>in acpi_get_parent
>
>Cache the value of the parent node so we don't have to look it up twice.
>
>Cc: Robert Moore <robert.moore@intel.com>
>Signed-off-by: Alex Chiang <achiang@hp.com>
>---
>
> drivers/acpi/acpica/nsxfobj.c | 8 ++++----
> 1 files changed, 4 insertions(+), 4 deletions(-)
>
>diff --git a/drivers/acpi/acpica/nsxfobj.c b/drivers/acpi/acpica/nsxfobj.c
>index 1c7efc1..1cd8f15 100644
>--- a/drivers/acpi/acpica/nsxfobj.c
>+++ b/drivers/acpi/acpica/nsxfobj.c
>@@ -161,7 +161,7 @@ ACPI_EXPORT_SYMBOL(acpi_get_type)
>
>***************************************************************************
>***/
> acpi_status acpi_get_parent(acpi_handle handle, acpi_handle * ret_handle)
> {
>- struct acpi_namespace_node *node;
>+ struct acpi_namespace_node *node, *parent_node;
> acpi_status status;
>
> if (!ret_handle) {
>@@ -189,12 +189,12 @@ acpi_status acpi_get_parent(acpi_handle handle,
>acpi_handle * ret_handle)
>
> /* Get the parent entry */
>
>- *ret_handle =
>- acpi_ns_convert_entry_to_handle(acpi_ns_get_parent_node(node));
>+ parent_node = acpi_ns_get_parent_node(node);
>+ *ret_handle = acpi_ns_convert_entry_to_handle(parent_node);
>
> /* Return exception if parent is null */
>
>- if (!acpi_ns_get_parent_node(node)) {
>+ if (!parent_node) {
> status = AE_NULL_ENTRY;
> }
>



\
 
 \ /
  Last update: 2009-05-19 16:31    [W:4.185 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site