From patchwork Tue May 19 03:23:24 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Chiang X-Patchwork-Id: 24656 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n4J3Ng68015913 for ; Tue, 19 May 2009 03:23:42 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752772AbZESDXY (ORCPT ); Mon, 18 May 2009 23:23:24 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753087AbZESDXY (ORCPT ); Mon, 18 May 2009 23:23:24 -0400 Received: from g5t0009.atlanta.hp.com ([15.192.0.46]:43490 "EHLO g5t0009.atlanta.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752925AbZESDXX (ORCPT ); Mon, 18 May 2009 23:23:23 -0400 Received: from smtp2.fc.hp.com (smtp.cnd.hp.com [15.11.136.114]) by g5t0009.atlanta.hp.com (Postfix) with ESMTP id 4C5A130116; Tue, 19 May 2009 03:23:25 +0000 (UTC) Received: from localhost.localdomain (lart.fc.hp.com [15.11.146.31]) by smtp2.fc.hp.com (Postfix) with ESMTP id CFFB62BB3F2; Tue, 19 May 2009 02:55:48 +0000 (UTC) Received: from bob.kio (localhost [127.0.0.1]) by localhost.localdomain (Postfix) with ESMTP id 72D0E26144; Mon, 18 May 2009 21:23:24 -0600 (MDT) Subject: [PATCH] ACPICA: Eliminate double call to acpi_ns_get_parent_node in acpi_get_parent To: lenb@kernel.org From: Alex Chiang Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, Robert Moore Date: Mon, 18 May 2009 21:23:24 -0600 Message-ID: <20090519032244.3729.46729.stgit@bob.kio> User-Agent: StGit/0.14.3.347.g594a MIME-Version: 1.0 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Cache the value of the parent node so we don't have to look it up twice. Cc: Robert Moore Signed-off-by: Alex Chiang --- drivers/acpi/acpica/nsxfobj.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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; }