diff options
author | Jung-uk Kim <jkim@FreeBSD.org> | 2013-03-08 04:21:54 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-03-11 19:45:04 -0400 |
commit | 1af89271711b23ff9eee66de018bc92eb347ea68 (patch) | |
tree | 28a21a8cab522f6f453fc3c2832bd0fabb929cd5 /drivers/acpi/acpica | |
parent | d4d32195ff070acca43577250adee6b210decdd3 (diff) |
ACPICA: Add macros to access pointer to next object in the descriptor list
Signed-off-by: Jung-uk Kim <jkim@FreeBSD.org>
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/acpi/acpica')
-rw-r--r-- | drivers/acpi/acpica/acmacros.h | 4 | ||||
-rw-r--r-- | drivers/acpi/acpica/utcache.c | 10 |
2 files changed, 6 insertions, 8 deletions
diff --git a/drivers/acpi/acpica/acmacros.h b/drivers/acpi/acpica/acmacros.h index ed7943b9044f..8b7ca40c4eb5 100644 --- a/drivers/acpi/acpica/acmacros.h +++ b/drivers/acpi/acpica/acmacros.h | |||
@@ -322,8 +322,10 @@ | |||
322 | * where a pointer to an object of type union acpi_operand_object can also | 322 | * where a pointer to an object of type union acpi_operand_object can also |
323 | * appear. This macro is used to distinguish them. | 323 | * appear. This macro is used to distinguish them. |
324 | * | 324 | * |
325 | * The "Descriptor" field is the first field in both structures. | 325 | * The "DescriptorType" field is the second field in both structures. |
326 | */ | 326 | */ |
327 | #define ACPI_GET_DESCRIPTOR_PTR(d) (((union acpi_descriptor *)(void *)(d))->common.common_pointer) | ||
328 | #define ACPI_SET_DESCRIPTOR_PTR(d, o) (((union acpi_descriptor *)(void *)(d))->common.common_pointer = o) | ||
327 | #define ACPI_GET_DESCRIPTOR_TYPE(d) (((union acpi_descriptor *)(void *)(d))->common.descriptor_type) | 329 | #define ACPI_GET_DESCRIPTOR_TYPE(d) (((union acpi_descriptor *)(void *)(d))->common.descriptor_type) |
328 | #define ACPI_SET_DESCRIPTOR_TYPE(d, t) (((union acpi_descriptor *)(void *)(d))->common.descriptor_type = t) | 330 | #define ACPI_SET_DESCRIPTOR_TYPE(d, t) (((union acpi_descriptor *)(void *)(d))->common.descriptor_type = t) |
329 | 331 | ||
diff --git a/drivers/acpi/acpica/utcache.c b/drivers/acpi/acpica/utcache.c index 2de22fbacf4b..a877a9647fd9 100644 --- a/drivers/acpi/acpica/utcache.c +++ b/drivers/acpi/acpica/utcache.c | |||
@@ -127,9 +127,7 @@ acpi_status acpi_os_purge_cache(struct acpi_memory_list * cache) | |||
127 | 127 | ||
128 | /* Delete and unlink one cached state object */ | 128 | /* Delete and unlink one cached state object */ |
129 | 129 | ||
130 | next = | 130 | next = ACPI_GET_DESCRIPTOR_PTR(cache->list_head); |
131 | ((struct acpi_object_common *)cache->list_head)-> | ||
132 | next_object; | ||
133 | ACPI_FREE(cache->list_head); | 131 | ACPI_FREE(cache->list_head); |
134 | 132 | ||
135 | cache->list_head = next; | 133 | cache->list_head = next; |
@@ -219,8 +217,7 @@ acpi_os_release_object(struct acpi_memory_list * cache, void *object) | |||
219 | 217 | ||
220 | /* Put the object at the head of the cache list */ | 218 | /* Put the object at the head of the cache list */ |
221 | 219 | ||
222 | ((struct acpi_object_common *)object)->next_object = | 220 | ACPI_SET_DESCRIPTOR_PTR(object, cache->list_head); |
223 | cache->list_head; | ||
224 | cache->list_head = object; | 221 | cache->list_head = object; |
225 | cache->current_depth++; | 222 | cache->current_depth++; |
226 | 223 | ||
@@ -268,8 +265,7 @@ void *acpi_os_acquire_object(struct acpi_memory_list *cache) | |||
268 | /* There is an object available, use it */ | 265 | /* There is an object available, use it */ |
269 | 266 | ||
270 | object = cache->list_head; | 267 | object = cache->list_head; |
271 | cache->list_head = | 268 | cache->list_head = ACPI_GET_DESCRIPTOR_PTR(object); |
272 | ((struct acpi_object_common *)object)->next_object; | ||
273 | 269 | ||
274 | cache->current_depth--; | 270 | cache->current_depth--; |
275 | 271 | ||