aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/dispatcher/dsobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/dispatcher/dsobject.c')
-rw-r--r--drivers/acpi/dispatcher/dsobject.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/drivers/acpi/dispatcher/dsobject.c b/drivers/acpi/dispatcher/dsobject.c
index 8b21f0f9e517..72190abb1d59 100644
--- a/drivers/acpi/dispatcher/dsobject.c
+++ b/drivers/acpi/dispatcher/dsobject.c
@@ -81,7 +81,7 @@ acpi_ds_build_internal_object(struct acpi_walk_state *walk_state,
81 union acpi_operand_object *obj_desc; 81 union acpi_operand_object *obj_desc;
82 acpi_status status; 82 acpi_status status;
83 83
84 ACPI_FUNCTION_TRACE("ds_build_internal_object"); 84 ACPI_FUNCTION_TRACE(ds_build_internal_object);
85 85
86 *obj_desc_ptr = NULL; 86 *obj_desc_ptr = NULL;
87 if (op->common.aml_opcode == AML_INT_NAMEPATH_OP) { 87 if (op->common.aml_opcode == AML_INT_NAMEPATH_OP) {
@@ -103,6 +103,7 @@ acpi_ds_build_internal_object(struct acpi_walk_state *walk_state,
103 common. 103 common.
104 node))); 104 node)));
105 if (ACPI_FAILURE(status)) { 105 if (ACPI_FAILURE(status)) {
106
106 /* Check if we are resolving a named reference within a package */ 107 /* Check if we are resolving a named reference within a package */
107 108
108 if ((status == AE_NOT_FOUND) 109 if ((status == AE_NOT_FOUND)
@@ -186,7 +187,7 @@ acpi_ds_build_internal_buffer_obj(struct acpi_walk_state *walk_state,
186 union acpi_parse_object *byte_list; 187 union acpi_parse_object *byte_list;
187 u32 byte_list_length = 0; 188 u32 byte_list_length = 0;
188 189
189 ACPI_FUNCTION_TRACE("ds_build_internal_buffer_obj"); 190 ACPI_FUNCTION_TRACE(ds_build_internal_buffer_obj);
190 191
191 /* 192 /*
192 * If we are evaluating a Named buffer object "Name (xxxx, Buffer)". 193 * If we are evaluating a Named buffer object "Name (xxxx, Buffer)".
@@ -195,6 +196,7 @@ acpi_ds_build_internal_buffer_obj(struct acpi_walk_state *walk_state,
195 */ 196 */
196 obj_desc = *obj_desc_ptr; 197 obj_desc = *obj_desc_ptr;
197 if (!obj_desc) { 198 if (!obj_desc) {
199
198 /* Create a new buffer object */ 200 /* Create a new buffer object */
199 201
200 obj_desc = acpi_ut_create_internal_object(ACPI_TYPE_BUFFER); 202 obj_desc = acpi_ut_create_internal_object(ACPI_TYPE_BUFFER);
@@ -243,7 +245,7 @@ acpi_ds_build_internal_buffer_obj(struct acpi_walk_state *walk_state,
243 "Buffer defined with zero length in AML, creating\n")); 245 "Buffer defined with zero length in AML, creating\n"));
244 } else { 246 } else {
245 obj_desc->buffer.pointer = 247 obj_desc->buffer.pointer =
246 ACPI_MEM_CALLOCATE(obj_desc->buffer.length); 248 ACPI_ALLOCATE_ZEROED(obj_desc->buffer.length);
247 if (!obj_desc->buffer.pointer) { 249 if (!obj_desc->buffer.pointer) {
248 acpi_ut_delete_object_desc(obj_desc); 250 acpi_ut_delete_object_desc(obj_desc);
249 return_ACPI_STATUS(AE_NO_MEMORY); 251 return_ACPI_STATUS(AE_NO_MEMORY);
@@ -291,7 +293,7 @@ acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state,
291 acpi_status status = AE_OK; 293 acpi_status status = AE_OK;
292 acpi_native_uint i; 294 acpi_native_uint i;
293 295
294 ACPI_FUNCTION_TRACE("ds_build_internal_package_obj"); 296 ACPI_FUNCTION_TRACE(ds_build_internal_package_obj);
295 297
296 /* Find the parent of a possibly nested package */ 298 /* Find the parent of a possibly nested package */
297 299
@@ -339,9 +341,10 @@ acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state,
339 * individual objects). Add an extra pointer slot so 341 * individual objects). Add an extra pointer slot so
340 * that the list is always null terminated. 342 * that the list is always null terminated.
341 */ 343 */
342 obj_desc->package.elements = ACPI_MEM_CALLOCATE(((acpi_size) obj_desc-> 344 obj_desc->package.elements = ACPI_ALLOCATE_ZEROED(((acpi_size)
343 package.count + 345 obj_desc->package.
344 1) * sizeof(void *)); 346 count +
347 1) * sizeof(void *));
345 348
346 if (!obj_desc->package.elements) { 349 if (!obj_desc->package.elements) {
347 acpi_ut_delete_object_desc(obj_desc); 350 acpi_ut_delete_object_desc(obj_desc);
@@ -355,6 +358,7 @@ acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state,
355 arg = arg->common.next; 358 arg = arg->common.next;
356 for (i = 0; arg; i++) { 359 for (i = 0; arg; i++) {
357 if (arg->common.aml_opcode == AML_INT_RETURN_VALUE_OP) { 360 if (arg->common.aml_opcode == AML_INT_RETURN_VALUE_OP) {
361
358 /* Object (package or buffer) is already built */ 362 /* Object (package or buffer) is already built */
359 363
360 obj_desc->package.elements[i] = 364 obj_desc->package.elements[i] =
@@ -396,7 +400,7 @@ acpi_ds_create_node(struct acpi_walk_state *walk_state,
396 acpi_status status; 400 acpi_status status;
397 union acpi_operand_object *obj_desc; 401 union acpi_operand_object *obj_desc;
398 402
399 ACPI_FUNCTION_TRACE_PTR("ds_create_node", op); 403 ACPI_FUNCTION_TRACE_PTR(ds_create_node, op);
400 404
401 /* 405 /*
402 * Because of the execution pass through the non-control-method 406 * Because of the execution pass through the non-control-method
@@ -408,6 +412,7 @@ acpi_ds_create_node(struct acpi_walk_state *walk_state,
408 } 412 }
409 413
410 if (!op->common.value.arg) { 414 if (!op->common.value.arg) {
415
411 /* No arguments, there is nothing to do */ 416 /* No arguments, there is nothing to do */
412 417
413 return_ACPI_STATUS(AE_OK); 418 return_ACPI_STATUS(AE_OK);
@@ -464,11 +469,12 @@ acpi_ds_init_object_from_op(struct acpi_walk_state *walk_state,
464 union acpi_operand_object *obj_desc; 469 union acpi_operand_object *obj_desc;
465 acpi_status status = AE_OK; 470 acpi_status status = AE_OK;
466 471
467 ACPI_FUNCTION_TRACE("ds_init_object_from_op"); 472 ACPI_FUNCTION_TRACE(ds_init_object_from_op);
468 473
469 obj_desc = *ret_obj_desc; 474 obj_desc = *ret_obj_desc;
470 op_info = acpi_ps_get_opcode_info(opcode); 475 op_info = acpi_ps_get_opcode_info(opcode);
471 if (op_info->class == AML_CLASS_UNKNOWN) { 476 if (op_info->class == AML_CLASS_UNKNOWN) {
477
472 /* Unknown opcode */ 478 /* Unknown opcode */
473 479
474 return_ACPI_STATUS(AE_TYPE); 480 return_ACPI_STATUS(AE_TYPE);
@@ -626,6 +632,7 @@ acpi_ds_init_object_from_op(struct acpi_walk_state *walk_state,
626 default: /* Other literals, etc.. */ 632 default: /* Other literals, etc.. */
627 633
628 if (op->common.aml_opcode == AML_INT_NAMEPATH_OP) { 634 if (op->common.aml_opcode == AML_INT_NAMEPATH_OP) {
635
629 /* Node was saved in Op */ 636 /* Node was saved in Op */
630 637
631 obj_desc->reference.node = op->common.node; 638 obj_desc->reference.node = op->common.node;