瀏覽代碼

ACPICA: Eliminate extra call to NsGetParentNode

Was called twice in the same function with the same parameter.
Alex Chiang.

Signed-off-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Alex Chiang 16 年之前
父節點
當前提交
c446eed618
共有 1 個文件被更改,包括 4 次插入3 次删除
  1. 4 3
      drivers/acpi/acpica/nsxfobj.c

+ 4 - 3
drivers/acpi/acpica/nsxfobj.c

@@ -162,6 +162,7 @@ ACPI_EXPORT_SYMBOL(acpi_get_type)
 acpi_status acpi_get_parent(acpi_handle handle, acpi_handle * ret_handle)
 acpi_status acpi_get_parent(acpi_handle handle, acpi_handle * ret_handle)
 {
 {
 	struct acpi_namespace_node *node;
 	struct acpi_namespace_node *node;
+	struct acpi_namespace_node *parent_node;
 	acpi_status status;
 	acpi_status status;
 
 
 	if (!ret_handle) {
 	if (!ret_handle) {
@@ -189,12 +190,12 @@ acpi_status acpi_get_parent(acpi_handle handle, acpi_handle * ret_handle)
 
 
 	/* Get the parent entry */
 	/* 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 */
 	/* Return exception if parent is null */
 
 
-	if (!acpi_ns_get_parent_node(node)) {
+	if (!parent_node) {
 		status = AE_NULL_ENTRY;
 		status = AE_NULL_ENTRY;
 	}
 	}