From: Alex Chiang <achiang@hp.com>
To: lenb@kernel.org
Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
Robert Moore <robert.moore@intel.com>
Subject: [PATCH] ACPICA: Eliminate double call to acpi_ns_get_parent_node in acpi_get_parent
Date: Mon, 18 May 2009 21:23:24 -0600 [thread overview]
Message-ID: <20090519032244.3729.46729.stgit@bob.kio> (raw)
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;
}
next reply other threads:[~2009-05-19 3:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-19 3:23 Alex Chiang [this message]
2009-05-19 14:28 ` [PATCH] ACPICA: Eliminate double call to acpi_ns_get_parent_node in acpi_get_parent Moore, Robert
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090519032244.3729.46729.stgit@bob.kio \
--to=achiang@hp.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robert.moore@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox