aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2013-10-28 21:29:57 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-10-31 09:35:33 -0400
commitbb1cab3d52375b5007645ca55d2b55167e5f757b (patch)
treefa325a582fcda8db5a0455e98890b4b1e317f313
parent839e928f5bbb695c31ddc23cf3fae3cf1c9e9f20 (diff)
ACPICA: Clarify ACPI_FREE_BUFFER usage.
Add a comment to clarify reason for using ACPI_FREE_BUFFER directly instead of ACPI_FREE. In addition to that, change one instance in which ACPI_FREE_BUFFER() should be used instead of ACPI_FREE(). [rjw: Subject and changelog] 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/nsxfeval.c2
-rw-r--r--include/acpi/actypes.h10
2 files changed, 8 insertions, 4 deletions
diff --git a/drivers/acpi/acpica/nsxfeval.c b/drivers/acpi/acpica/nsxfeval.c
index a6e3bca48567..ce2a84575a36 100644
--- a/drivers/acpi/acpica/nsxfeval.c
+++ b/drivers/acpi/acpica/nsxfeval.c
@@ -139,7 +139,7 @@ acpi_evaluate_object_typed(acpi_handle handle,
139 139
140 /* Caller used ACPI_ALLOCATE_BUFFER, free the return buffer */ 140 /* Caller used ACPI_ALLOCATE_BUFFER, free the return buffer */
141 141
142 ACPI_FREE(return_buffer->pointer); 142 ACPI_FREE_BUFFER(*return_buffer);
143 return_buffer->pointer = NULL; 143 return_buffer->pointer = NULL;
144 } 144 }
145 145
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index 63909d9c2f7a..0bb23e6bce43 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -919,9 +919,13 @@ struct acpi_buffer {
919 void *pointer; /* pointer to buffer */ 919 void *pointer; /* pointer to buffer */
920}; 920};
921 921
922/* Free a buffer created in an struct acpi_buffer via ACPI_ALLOCATE_LOCAL_BUFFER */ 922/*
923 923 * Free a buffer created in an struct acpi_buffer via ACPI_ALLOCATE_BUFFER.
924#define ACPI_FREE_BUFFER(b) ACPI_FREE(b.pointer) 924 * Note: We use acpi_os_free here because acpi_os_allocate was used to allocate
925 * the buffer. This purposefully bypasses the internal allocation tracking
926 * mechanism (if it is enabled).
927 */
928#define ACPI_FREE_BUFFER(b) acpi_os_free((b).pointer)
925 929
926/* 930/*
927 * name_type for acpi_get_name 931 * name_type for acpi_get_name