diff options
author | Bob Moore | 2012-12-31 01:05:33 +0100 |
---|---|---|
committer | Rafael J. Wysocki | 2013-01-10 12:36:20 +0100 |
commit | f8c9bfe461bb2923ae5d070f1ec0fb312825caad (patch) | |
tree | 977bd0cd3ba62e032cbe96fb10ca17b885171d42 /drivers | |
parent | ACPICA: Eliminate some small unnecessary pathname functions. (diff) | |
download | kernel-qcow2-linux-f8c9bfe461bb2923ae5d070f1ec0fb312825caad.tar.gz kernel-qcow2-linux-f8c9bfe461bb2923ae5d070f1ec0fb312825caad.tar.xz kernel-qcow2-linux-f8c9bfe461bb2923ae5d070f1ec0fb312825caad.zip |
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/acpi/acpica/nsutils.c | 9 |
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, ACPI_FUNCTION_TRACE_PTR(ns_get_node, ACPI_CAST_PTR(char, pathname)); + /* Simplest case is a null pathname */ + if (!pathname) { *return_node = prefix_node; if (!prefix_node) { @@ -679,6 +681,13 @@ acpi_ns_get_node(struct acpi_namespace_node *prefix_node, return_ACPI_STATUS(AE_OK); } + /* Quick check for a reference to the root */ + + if (ACPI_IS_ROOT_PREFIX(pathname[0]) && (!pathname[1])) { + *return_node = acpi_gbl_root_node; + return_ACPI_STATUS(AE_OK); + } + /* Convert path to internal representation */ status = acpi_ns_internalize_name(pathname, &internal_path); |