summaryrefslogtreecommitdiff
path: root/source/components/namespace/nsxfname.c
diff options
context:
space:
mode:
authorJung-uk Kim <jkim@FreeBSD.org>2016-11-17 18:06:08 +0000
committerJung-uk Kim <jkim@FreeBSD.org>2016-11-17 18:06:08 +0000
commita56e3c255d5c5dfa4dd3a2fda4705a1607a6b7f3 (patch)
tree830d95042126506cd52440fe9710bb4e6811cfde /source/components/namespace/nsxfname.c
parent7600ac2283596bd000a29b9347e95346d3b740d7 (diff)
Diffstat (limited to 'source/components/namespace/nsxfname.c')
-rw-r--r--source/components/namespace/nsxfname.c42
1 files changed, 10 insertions, 32 deletions
diff --git a/source/components/namespace/nsxfname.c b/source/components/namespace/nsxfname.c
index cfd6937f497fb..1621ba985da90 100644
--- a/source/components/namespace/nsxfname.c
+++ b/source/components/namespace/nsxfname.c
@@ -176,8 +176,6 @@ AcpiGetName (
ACPI_BUFFER *Buffer)
{
ACPI_STATUS Status;
- ACPI_NAMESPACE_NODE *Node;
- const char *NodeName;
/* Parameter validation */
@@ -193,16 +191,6 @@ AcpiGetName (
return (Status);
}
- if (NameType == ACPI_FULL_PATHNAME ||
- NameType == ACPI_FULL_PATHNAME_NO_TRAILING)
- {
- /* Get the full pathname (From the namespace root) */
-
- Status = AcpiNsHandleToPathname (Handle, Buffer,
- NameType == ACPI_FULL_PATHNAME ? FALSE : TRUE);
- return (Status);
- }
-
/*
* Wants the single segment ACPI name.
* Validate handle and convert to a namespace Node
@@ -213,30 +201,20 @@ AcpiGetName (
return (Status);
}
- Node = AcpiNsValidateHandle (Handle);
- if (!Node)
+ if (NameType == ACPI_FULL_PATHNAME ||
+ NameType == ACPI_FULL_PATHNAME_NO_TRAILING)
{
- Status = AE_BAD_PARAMETER;
- goto UnlockAndExit;
- }
-
- /* Validate/Allocate/Clear caller buffer */
+ /* Get the full pathname (From the namespace root) */
- Status = AcpiUtInitializeBuffer (Buffer, ACPI_PATH_SEGMENT_LENGTH);
- if (ACPI_FAILURE (Status))
- {
- goto UnlockAndExit;
+ Status = AcpiNsHandleToPathname (Handle, Buffer,
+ NameType == ACPI_FULL_PATHNAME ? FALSE : TRUE);
}
+ else
+ {
+ /* Get the single name */
- /* Just copy the ACPI name from the Node and zero terminate it */
-
- NodeName = AcpiUtGetNodeName (Node);
- ACPI_MOVE_NAME (Buffer->Pointer, NodeName);
- ((char *) Buffer->Pointer) [ACPI_NAME_SIZE] = 0;
- Status = AE_OK;
-
-
-UnlockAndExit:
+ Status = AcpiNsHandleToName (Handle, Buffer);
+ }
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
return (Status);