lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090519032244.3729.46729.stgit@bob.kio>
Date:	Mon, 18 May 2009 21:23:24 -0600
From:	Alex Chiang <achiang@...com>
To:	lenb@...nel.org
Cc:	linux-acpi@...r.kernel.org, linux-kernel@...r.kernel.org,
	Robert Moore <robert.moore@...el.com>
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@...el.com>
Signed-off-by: Alex Chiang <achiang@...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;
 	}
 

--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ