aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2012-12-30 19:05:33 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-01-10 06:36:20 -0500
commitf8c9bfe461bb2923ae5d070f1ec0fb312825caad (patch)
tree977bd0cd3ba62e032cbe96fb10ca17b885171d42
parent04a81dce13c672757637b759039de216ed29a536 (diff)
ACPICA: Add root node optimization to internal get namespace node function.
Detect a request for the root node (a lone backslash) up front before invoking a full namespace lookup. Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r--drivers/acpi/acpica/nsutils.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/acpi/acpica/nsutils.c b/drivers/acpi/acpica/nsutils.c
index d2dfe6172181..596d4ccc963f 100644
--- a/drivers/acpi/acpica/nsutils.c
+++ b/drivers/acpi/acpica/nsutils.c
@@ -671,6 +671,8 @@ acpi_ns_get_node(struct acpi_namespace_node *prefix_node,
671 671
672 ACPI_FUNCTION_TRACE_PTR(ns_get_node, ACPI_CAST_PTR(char, pathname)); 672 ACPI_FUNCTION_TRACE_PTR(ns_get_node, ACPI_CAST_PTR(char, pathname));
673 673
674 /* Simplest case is a null pathname */
675
674 if (!pathname) { 676 if (!pathname) {
675 *return_node = prefix_node; 677 *return_node = prefix_node;
676 if (!prefix_node) { 678 if (!prefix_node) {
@@ -679,6 +681,13 @@ acpi_ns_get_node(struct acpi_namespace_node *prefix_node,
679 return_ACPI_STATUS(AE_OK); 681 return_ACPI_STATUS(AE_OK);
680 } 682 }
681 683
684 /* Quick check for a reference to the root */
685
686 if (ACPI_IS_ROOT_PREFIX(pathname[0]) && (!pathname[1])) {
687 *return_node = acpi_gbl_root_node;
688 return_ACPI_STATUS(AE_OK);
689 }
690
682 /* Convert path to internal representation */ 691 /* Convert path to internal representation */
683 692
684 status = acpi_ns_internalize_name(pathname, &internal_path); 693 status = acpi_ns_internalize_name(pathname, &internal_path);