aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/acpica
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2015-12-29 00:54:36 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2015-12-31 21:36:53 -0500
commit1fad87385e7e82f656fb661aef0f841e42991974 (patch)
tree55882b08ecf543cc508d489c4b08033f229dd82c /drivers/acpi/acpica
parentcd162b35a29900b7e7a595c5ea70066cd5d47aee (diff)
ACPICA: Core: Major update for code formatting, no functional changes
ACPICA commit dfa394471f6c01b2ee9433dbc143ec70cb9bca72 Mostly indentation inconsistencies across the code. Split some long lines, etc. Link: https://github.com/acpica/acpica/commit/dfa39447 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/dbstats.c1
-rw-r--r--drivers/acpi/acpica/dbutils.c1
-rw-r--r--drivers/acpi/acpica/dsargs.c7
-rw-r--r--drivers/acpi/acpica/dsdebug.c5
-rw-r--r--drivers/acpi/acpica/dsfield.c39
-rw-r--r--drivers/acpi/acpica/dsinit.c2
-rw-r--r--drivers/acpi/acpica/dsmethod.c24
-rw-r--r--drivers/acpi/acpica/dsmthdat.c20
-rw-r--r--drivers/acpi/acpica/dsobject.c19
-rw-r--r--drivers/acpi/acpica/dsopcode.c21
-rw-r--r--drivers/acpi/acpica/dsutils.c29
-rw-r--r--drivers/acpi/acpica/dswexec.c19
-rw-r--r--drivers/acpi/acpica/dswload.c10
-rw-r--r--drivers/acpi/acpica/dswload2.c10
-rw-r--r--drivers/acpi/acpica/dswscope.c1
-rw-r--r--drivers/acpi/acpica/evgpe.c2
-rw-r--r--drivers/acpi/acpica/evgpeblk.c1
-rw-r--r--drivers/acpi/acpica/evgpeutil.c1
-rw-r--r--drivers/acpi/acpica/evmisc.c5
-rw-r--r--drivers/acpi/acpica/evxface.c9
-rw-r--r--drivers/acpi/acpica/evxfregn.c1
-rw-r--r--drivers/acpi/acpica/exconfig.c8
-rw-r--r--drivers/acpi/acpica/exconvrt.c9
-rw-r--r--drivers/acpi/acpica/excreate.c10
-rw-r--r--drivers/acpi/acpica/exdebug.c1
-rw-r--r--drivers/acpi/acpica/exfield.c74
-rw-r--r--drivers/acpi/acpica/exfldio.c35
-rw-r--r--drivers/acpi/acpica/exmisc.c10
-rw-r--r--drivers/acpi/acpica/exnames.c4
-rw-r--r--drivers/acpi/acpica/exoparg1.c31
-rw-r--r--drivers/acpi/acpica/exoparg2.c12
-rw-r--r--drivers/acpi/acpica/exoparg3.c19
-rw-r--r--drivers/acpi/acpica/exoparg6.c1
-rw-r--r--drivers/acpi/acpica/exprep.c25
-rw-r--r--drivers/acpi/acpica/exregion.c13
-rw-r--r--drivers/acpi/acpica/exresnte.c2
-rw-r--r--drivers/acpi/acpica/exresolv.c10
-rw-r--r--drivers/acpi/acpica/exresop.c43
-rw-r--r--drivers/acpi/acpica/exstore.c17
-rw-r--r--drivers/acpi/acpica/exstorob.c7
-rw-r--r--drivers/acpi/acpica/exsystem.c6
-rw-r--r--drivers/acpi/acpica/exutils.c7
-rw-r--r--drivers/acpi/acpica/hwesleep.c4
-rw-r--r--drivers/acpi/acpica/hwgpe.c7
-rw-r--r--drivers/acpi/acpica/hwsleep.c4
-rw-r--r--drivers/acpi/acpica/hwxfsleep.c1
-rw-r--r--drivers/acpi/acpica/nsconvert.c18
-rw-r--r--drivers/acpi/acpica/nsdump.c3
-rw-r--r--drivers/acpi/acpica/nsload.c1
-rw-r--r--drivers/acpi/acpica/nsnames.c6
-rw-r--r--drivers/acpi/acpica/nsparse.c5
-rw-r--r--drivers/acpi/acpica/nsprepkg.c10
-rw-r--r--drivers/acpi/acpica/nsrepair.c6
-rw-r--r--drivers/acpi/acpica/nsrepair2.c22
-rw-r--r--drivers/acpi/acpica/nsutils.c8
-rw-r--r--drivers/acpi/acpica/nsxfeval.c4
-rw-r--r--drivers/acpi/acpica/nsxfname.c1
-rw-r--r--drivers/acpi/acpica/nsxfobj.c6
-rw-r--r--drivers/acpi/acpica/psargs.c1
-rw-r--r--drivers/acpi/acpica/psloop.c4
-rw-r--r--drivers/acpi/acpica/psparse.c8
-rw-r--r--drivers/acpi/acpica/psutils.c4
-rw-r--r--drivers/acpi/acpica/pswalk.c1
-rw-r--r--drivers/acpi/acpica/rsaddr.c4
-rw-r--r--drivers/acpi/acpica/rscalc.c81
-rw-r--r--drivers/acpi/acpica/rscreate.c32
-rw-r--r--drivers/acpi/acpica/rsdump.c6
-rw-r--r--drivers/acpi/acpica/rslist.c9
-rw-r--r--drivers/acpi/acpica/rsmisc.c22
-rw-r--r--drivers/acpi/acpica/rsutils.c42
-rw-r--r--drivers/acpi/acpica/rsxface.c2
-rw-r--r--drivers/acpi/acpica/tbdata.c1
-rw-r--r--drivers/acpi/acpica/tbinstal.c4
-rw-r--r--drivers/acpi/acpica/tbprint.c1
-rw-r--r--drivers/acpi/acpica/tbutils.c2
-rw-r--r--drivers/acpi/acpica/tbxfload.c1
-rw-r--r--drivers/acpi/acpica/utcopy.c23
-rw-r--r--drivers/acpi/acpica/utdecode.c3
-rw-r--r--drivers/acpi/acpica/utdelete.c5
-rw-r--r--drivers/acpi/acpica/uterror.c10
-rw-r--r--drivers/acpi/acpica/utfileio.c2
-rw-r--r--drivers/acpi/acpica/utmath.c10
-rw-r--r--drivers/acpi/acpica/utmisc.c11
-rw-r--r--drivers/acpi/acpica/utmutex.c5
-rw-r--r--drivers/acpi/acpica/utnonansi.c4
-rw-r--r--drivers/acpi/acpica/utobject.c20
-rw-r--r--drivers/acpi/acpica/utosi.c11
-rw-r--r--drivers/acpi/acpica/utownerid.c12
-rw-r--r--drivers/acpi/acpica/utpredef.c6
-rw-r--r--drivers/acpi/acpica/utprint.c15
-rw-r--r--drivers/acpi/acpica/utresrc.c8
-rw-r--r--drivers/acpi/acpica/utstate.c3
-rw-r--r--drivers/acpi/acpica/utstring.c1
-rw-r--r--drivers/acpi/acpica/uttrack.c50
-rw-r--r--drivers/acpi/acpica/utxface.c2
-rw-r--r--drivers/acpi/acpica/utxferror.c1
-rw-r--r--drivers/acpi/acpica/utxfmutex.c6
97 files changed, 617 insertions, 493 deletions
diff --git a/drivers/acpi/acpica/dbstats.c b/drivers/acpi/acpica/dbstats.c
index 4ba0a20811eb..de255d975941 100644
--- a/drivers/acpi/acpica/dbstats.c
+++ b/drivers/acpi/acpica/dbstats.c
@@ -382,6 +382,7 @@ acpi_status acpi_db_display_statistics(char *type_arg)
382 acpi_gbl_node_type_count[i], 382 acpi_gbl_node_type_count[i],
383 acpi_gbl_obj_type_count[i]); 383 acpi_gbl_obj_type_count[i]);
384 } 384 }
385
385 acpi_os_printf("%16.16s % 10ld% 10ld\n", "Misc/Unknown", 386 acpi_os_printf("%16.16s % 10ld% 10ld\n", "Misc/Unknown",
386 acpi_gbl_node_type_count_misc, 387 acpi_gbl_node_type_count_misc,
387 acpi_gbl_obj_type_count_misc); 388 acpi_gbl_obj_type_count_misc);
diff --git a/drivers/acpi/acpica/dbutils.c b/drivers/acpi/acpica/dbutils.c
index 86790e080139..8c85d85a9cb2 100644
--- a/drivers/acpi/acpica/dbutils.c
+++ b/drivers/acpi/acpica/dbutils.c
@@ -173,6 +173,7 @@ void acpi_db_dump_external_object(union acpi_object *obj_desc, u32 level)
173 if (obj_desc->buffer.length > 16) { 173 if (obj_desc->buffer.length > 16) {
174 acpi_os_printf("\n"); 174 acpi_os_printf("\n");
175 } 175 }
176
176 acpi_ut_debug_dump_buffer(ACPI_CAST_PTR 177 acpi_ut_debug_dump_buffer(ACPI_CAST_PTR
177 (u8, 178 (u8,
178 obj_desc->buffer.pointer), 179 obj_desc->buffer.pointer),
diff --git a/drivers/acpi/acpica/dsargs.c b/drivers/acpi/acpica/dsargs.c
index e2ab59e39162..76cfced31f9f 100644
--- a/drivers/acpi/acpica/dsargs.c
+++ b/drivers/acpi/acpica/dsargs.c
@@ -194,8 +194,8 @@ acpi_ds_get_buffer_field_arguments(union acpi_operand_object *obj_desc)
194 extra_desc = acpi_ns_get_secondary_object(obj_desc); 194 extra_desc = acpi_ns_get_secondary_object(obj_desc);
195 node = obj_desc->buffer_field.node; 195 node = obj_desc->buffer_field.node;
196 196
197 ACPI_DEBUG_EXEC(acpi_ut_display_init_pathname(ACPI_TYPE_BUFFER_FIELD, 197 ACPI_DEBUG_EXEC(acpi_ut_display_init_pathname
198 node, NULL)); 198 (ACPI_TYPE_BUFFER_FIELD, node, NULL));
199 199
200 ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "[%4.4s] BufferField Arg Init\n", 200 ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "[%4.4s] BufferField Arg Init\n",
201 acpi_ut_get_node_name(node))); 201 acpi_ut_get_node_name(node)));
@@ -385,7 +385,8 @@ acpi_status acpi_ds_get_region_arguments(union acpi_operand_object *obj_desc)
385 ACPI_DEBUG_EXEC(acpi_ut_display_init_pathname 385 ACPI_DEBUG_EXEC(acpi_ut_display_init_pathname
386 (ACPI_TYPE_REGION, node, NULL)); 386 (ACPI_TYPE_REGION, node, NULL));
387 387
388 ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "[%4.4s] OpRegion Arg Init at AML %p\n", 388 ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
389 "[%4.4s] OpRegion Arg Init at AML %p\n",
389 acpi_ut_get_node_name(node), 390 acpi_ut_get_node_name(node),
390 extra_desc->extra.aml_start)); 391 extra_desc->extra.aml_start));
391 392
diff --git a/drivers/acpi/acpica/dsdebug.c b/drivers/acpi/acpica/dsdebug.c
index 309556efc553..1eb82bd7ee16 100644
--- a/drivers/acpi/acpica/dsdebug.c
+++ b/drivers/acpi/acpica/dsdebug.c
@@ -161,6 +161,7 @@ acpi_ds_dump_method_stack(acpi_status status,
161 ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH, 161 ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
162 "\n**** Exception %s during execution of method ", 162 "\n**** Exception %s during execution of method ",
163 acpi_format_exception(status))); 163 acpi_format_exception(status)));
164
164 acpi_ds_print_node_pathname(walk_state->method_node, NULL); 165 acpi_ds_print_node_pathname(walk_state->method_node, NULL);
165 166
166 /* Display stack of executing methods */ 167 /* Display stack of executing methods */
@@ -203,8 +204,8 @@ acpi_ds_dump_method_stack(acpi_status status,
203 } else { 204 } else {
204 /* 205 /*
205 * This method has called another method 206 * This method has called another method
206 * NOTE: the method call parse subtree is already deleted at this 207 * NOTE: the method call parse subtree is already deleted at
207 * point, so we cannot disassemble the method invocation. 208 * this point, so we cannot disassemble the method invocation.
208 */ 209 */
209 ACPI_DEBUG_PRINT_RAW((ACPI_DB_DISPATCH, 210 ACPI_DEBUG_PRINT_RAW((ACPI_DB_DISPATCH,
210 "Call to method ")); 211 "Call to method "));
diff --git a/drivers/acpi/acpica/dsfield.c b/drivers/acpi/acpica/dsfield.c
index 37e11a31bd52..6bca0ec42dbd 100644
--- a/drivers/acpi/acpica/dsfield.c
+++ b/drivers/acpi/acpica/dsfield.c
@@ -106,6 +106,7 @@ acpi_ds_create_external_region(acpi_status lookup_status,
106 * insert the name into the namespace. 106 * insert the name into the namespace.
107 */ 107 */
108 acpi_dm_add_op_to_external_list(op, path, ACPI_TYPE_REGION, 0, 0); 108 acpi_dm_add_op_to_external_list(op, path, ACPI_TYPE_REGION, 0, 0);
109
109 status = acpi_ns_lookup(walk_state->scope_info, path, ACPI_TYPE_REGION, 110 status = acpi_ns_lookup(walk_state->scope_info, path, ACPI_TYPE_REGION,
110 ACPI_IMODE_LOAD_PASS1, ACPI_NS_SEARCH_PARENT, 111 ACPI_IMODE_LOAD_PASS1, ACPI_NS_SEARCH_PARENT,
111 walk_state, node); 112 walk_state, node);
@@ -202,11 +203,10 @@ acpi_ds_create_buffer_field(union acpi_parse_object *op,
202 203
203 /* Enter the name_string into the namespace */ 204 /* Enter the name_string into the namespace */
204 205
205 status = 206 status = acpi_ns_lookup(walk_state->scope_info,
206 acpi_ns_lookup(walk_state->scope_info, 207 arg->common.value.string, ACPI_TYPE_ANY,
207 arg->common.value.string, ACPI_TYPE_ANY, 208 ACPI_IMODE_LOAD_PASS1, flags,
208 ACPI_IMODE_LOAD_PASS1, flags, walk_state, 209 walk_state, &node);
209 &node);
210 if (ACPI_FAILURE(status)) { 210 if (ACPI_FAILURE(status)) {
211 ACPI_ERROR_NAMESPACE(arg->common.value.string, status); 211 ACPI_ERROR_NAMESPACE(arg->common.value.string, status);
212 return_ACPI_STATUS(status); 212 return_ACPI_STATUS(status);
@@ -244,8 +244,8 @@ acpi_ds_create_buffer_field(union acpi_parse_object *op,
244 } 244 }
245 245
246 /* 246 /*
247 * Remember location in AML stream of the field unit opcode and operands -- 247 * Remember location in AML stream of the field unit opcode and operands
248 * since the buffer and index operands must be evaluated. 248 * -- since the buffer and index operands must be evaluated.
249 */ 249 */
250 second_desc = obj_desc->common.next_object; 250 second_desc = obj_desc->common.next_object;
251 second_desc->extra.aml_start = op->named.data; 251 second_desc->extra.aml_start = op->named.data;
@@ -310,8 +310,8 @@ acpi_ds_get_field_names(struct acpi_create_field_info *info,
310 switch (arg->common.aml_opcode) { 310 switch (arg->common.aml_opcode) {
311 case AML_INT_RESERVEDFIELD_OP: 311 case AML_INT_RESERVEDFIELD_OP:
312 312
313 position = (u64)info->field_bit_position 313 position = (u64)info->field_bit_position +
314 + (u64)arg->common.value.size; 314 (u64)arg->common.value.size;
315 315
316 if (position > ACPI_UINT32_MAX) { 316 if (position > ACPI_UINT32_MAX) {
317 ACPI_ERROR((AE_INFO, 317 ACPI_ERROR((AE_INFO,
@@ -344,13 +344,13 @@ acpi_ds_get_field_names(struct acpi_create_field_info *info,
344 344
345 /* access_attribute (attrib_quick, attrib_byte, etc.) */ 345 /* access_attribute (attrib_quick, attrib_byte, etc.) */
346 346
347 info->attribute = 347 info->attribute = (u8)
348 (u8)((arg->common.value.integer >> 8) & 0xFF); 348 ((arg->common.value.integer >> 8) & 0xFF);
349 349
350 /* access_length (for serial/buffer protocols) */ 350 /* access_length (for serial/buffer protocols) */
351 351
352 info->access_length = 352 info->access_length = (u8)
353 (u8)((arg->common.value.integer >> 16) & 0xFF); 353 ((arg->common.value.integer >> 16) & 0xFF);
354 break; 354 break;
355 355
356 case AML_INT_CONNECTION_OP: 356 case AML_INT_CONNECTION_OP:
@@ -425,8 +425,8 @@ acpi_ds_get_field_names(struct acpi_create_field_info *info,
425 425
426 /* Keep track of bit position for the next field */ 426 /* Keep track of bit position for the next field */
427 427
428 position = (u64)info->field_bit_position 428 position = (u64)info->field_bit_position +
429 + (u64)arg->common.value.size; 429 (u64)arg->common.value.size;
430 430
431 if (position > ACPI_UINT32_MAX) { 431 if (position > ACPI_UINT32_MAX) {
432 ACPI_ERROR((AE_INFO, 432 ACPI_ERROR((AE_INFO,
@@ -716,11 +716,12 @@ acpi_ds_create_bank_field(union acpi_parse_object *op,
716 716
717 /* 717 /*
718 * Use Info.data_register_node to store bank_field Op 718 * Use Info.data_register_node to store bank_field Op
719 * It's safe because data_register_node will never be used when create bank field 719 * It's safe because data_register_node will never be used when create
720 * We store aml_start and aml_length in the bank_field Op for late evaluation 720 * bank field \we store aml_start and aml_length in the bank_field Op for
721 * Used in acpi_ex_prep_field_value(Info) 721 * late evaluation. Used in acpi_ex_prep_field_value(Info)
722 * 722 *
723 * TBD: Or, should we add a field in struct acpi_create_field_info, like "void *ParentOp"? 723 * TBD: Or, should we add a field in struct acpi_create_field_info, like
724 * "void *ParentOp"?
724 */ 725 */
725 info.data_register_node = (struct acpi_namespace_node *)op; 726 info.data_register_node = (struct acpi_namespace_node *)op;
726 727
diff --git a/drivers/acpi/acpica/dsinit.c b/drivers/acpi/acpica/dsinit.c
index 920f1b199bc6..c1d8af8a8aaf 100644
--- a/drivers/acpi/acpica/dsinit.c
+++ b/drivers/acpi/acpica/dsinit.c
@@ -247,7 +247,7 @@ acpi_ds_initialize_objects(u32 table_index,
247 /* Summary of objects initialized */ 247 /* Summary of objects initialized */
248 248
249 ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT, 249 ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,
250 "Table [%4.4s:%8.8s] (id %.2X) - %4u Objects with %3u Devices, " 250 "Table [%4.4s: %-8.8s] (id %.2X) - %4u Objects with %3u Devices, "
251 "%3u Regions, %4u Methods (%u/%u/%u Serial/Non/Cvt)\n", 251 "%3u Regions, %4u Methods (%u/%u/%u Serial/Non/Cvt)\n",
252 table->signature, table->oem_table_id, owner_id, 252 table->signature, table->oem_table_id, owner_id,
253 info.object_count, info.device_count, 253 info.object_count, info.device_count,
diff --git a/drivers/acpi/acpica/dsmethod.c b/drivers/acpi/acpica/dsmethod.c
index 49ba082ad379..6585e8e37c8e 100644
--- a/drivers/acpi/acpica/dsmethod.c
+++ b/drivers/acpi/acpica/dsmethod.c
@@ -118,10 +118,9 @@ acpi_ds_auto_serialize_method(struct acpi_namespace_node *node,
118 return_ACPI_STATUS(AE_NO_MEMORY); 118 return_ACPI_STATUS(AE_NO_MEMORY);
119 } 119 }
120 120
121 status = 121 status = acpi_ds_init_aml_walk(walk_state, op, node,
122 acpi_ds_init_aml_walk(walk_state, op, node, 122 obj_desc->method.aml_start,
123 obj_desc->method.aml_start, 123 obj_desc->method.aml_length, NULL, 0);
124 obj_desc->method.aml_length, NULL, 0);
125 if (ACPI_FAILURE(status)) { 124 if (ACPI_FAILURE(status)) {
126 acpi_ds_delete_walk_state(walk_state); 125 acpi_ds_delete_walk_state(walk_state);
127 acpi_ps_free_op(op); 126 acpi_ps_free_op(op);
@@ -375,7 +374,8 @@ acpi_ds_begin_method_execution(struct acpi_namespace_node *method_node,
375 && (walk_state->thread->current_sync_level > 374 && (walk_state->thread->current_sync_level >
376 obj_desc->method.mutex->mutex.sync_level)) { 375 obj_desc->method.mutex->mutex.sync_level)) {
377 ACPI_ERROR((AE_INFO, 376 ACPI_ERROR((AE_INFO,
378 "Cannot acquire Mutex for method [%4.4s], current SyncLevel is too large (%u)", 377 "Cannot acquire Mutex for method [%4.4s]"
378 ", current SyncLevel is too large (%u)",
379 acpi_ut_get_node_name(method_node), 379 acpi_ut_get_node_name(method_node),
380 walk_state->thread->current_sync_level)); 380 walk_state->thread->current_sync_level));
381 381
@@ -512,16 +512,18 @@ acpi_ds_call_control_method(struct acpi_thread_state *thread,
512 512
513 /* Init for new method, possibly wait on method mutex */ 513 /* Init for new method, possibly wait on method mutex */
514 514
515 status = acpi_ds_begin_method_execution(method_node, obj_desc, 515 status =
516 this_walk_state); 516 acpi_ds_begin_method_execution(method_node, obj_desc,
517 this_walk_state);
517 if (ACPI_FAILURE(status)) { 518 if (ACPI_FAILURE(status)) {
518 return_ACPI_STATUS(status); 519 return_ACPI_STATUS(status);
519 } 520 }
520 521
521 /* Begin method parse/execution. Create a new walk state */ 522 /* Begin method parse/execution. Create a new walk state */
522 523
523 next_walk_state = acpi_ds_create_walk_state(obj_desc->method.owner_id, 524 next_walk_state =
524 NULL, obj_desc, thread); 525 acpi_ds_create_walk_state(obj_desc->method.owner_id, NULL, obj_desc,
526 thread);
525 if (!next_walk_state) { 527 if (!next_walk_state) {
526 status = AE_NO_MEMORY; 528 status = AE_NO_MEMORY;
527 goto cleanup; 529 goto cleanup;
@@ -808,7 +810,8 @@ acpi_ds_terminate_control_method(union acpi_operand_object *method_desc,
808 info_flags & ACPI_METHOD_SERIALIZED_PENDING) { 810 info_flags & ACPI_METHOD_SERIALIZED_PENDING) {
809 if (walk_state) { 811 if (walk_state) {
810 ACPI_INFO((AE_INFO, 812 ACPI_INFO((AE_INFO,
811 "Marking method %4.4s as Serialized because of AE_ALREADY_EXISTS error", 813 "Marking method %4.4s as Serialized "
814 "because of AE_ALREADY_EXISTS error",
812 walk_state->method_node->name. 815 walk_state->method_node->name.
813 ascii)); 816 ascii));
814 } 817 }
@@ -826,6 +829,7 @@ acpi_ds_terminate_control_method(union acpi_operand_object *method_desc,
826 */ 829 */
827 method_desc->method.info_flags &= 830 method_desc->method.info_flags &=
828 ~ACPI_METHOD_SERIALIZED_PENDING; 831 ~ACPI_METHOD_SERIALIZED_PENDING;
832
829 method_desc->method.info_flags |= 833 method_desc->method.info_flags |=
830 (ACPI_METHOD_SERIALIZED | 834 (ACPI_METHOD_SERIALIZED |
831 ACPI_METHOD_IGNORE_SYNC_LEVEL); 835 ACPI_METHOD_IGNORE_SYNC_LEVEL);
diff --git a/drivers/acpi/acpica/dsmthdat.c b/drivers/acpi/acpica/dsmthdat.c
index 2e4c42b377ec..03c44f2ac7b7 100644
--- a/drivers/acpi/acpica/dsmthdat.c
+++ b/drivers/acpi/acpica/dsmthdat.c
@@ -99,6 +99,7 @@ void acpi_ds_method_data_init(struct acpi_walk_state *walk_state)
99 for (i = 0; i < ACPI_METHOD_NUM_ARGS; i++) { 99 for (i = 0; i < ACPI_METHOD_NUM_ARGS; i++) {
100 ACPI_MOVE_32_TO_32(&walk_state->arguments[i].name, 100 ACPI_MOVE_32_TO_32(&walk_state->arguments[i].name,
101 NAMEOF_ARG_NTE); 101 NAMEOF_ARG_NTE);
102
102 walk_state->arguments[i].name.integer |= (i << 24); 103 walk_state->arguments[i].name.integer |= (i << 24);
103 walk_state->arguments[i].descriptor_type = ACPI_DESC_TYPE_NAMED; 104 walk_state->arguments[i].descriptor_type = ACPI_DESC_TYPE_NAMED;
104 walk_state->arguments[i].type = ACPI_TYPE_ANY; 105 walk_state->arguments[i].type = ACPI_TYPE_ANY;
@@ -201,7 +202,7 @@ acpi_ds_method_data_init_args(union acpi_operand_object **params,
201 202
202 if (!params) { 203 if (!params) {
203 ACPI_DEBUG_PRINT((ACPI_DB_EXEC, 204 ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
204 "No param list passed to method\n")); 205 "No parameter list passed to method\n"));
205 return_ACPI_STATUS(AE_OK); 206 return_ACPI_STATUS(AE_OK);
206 } 207 }
207 208
@@ -214,9 +215,9 @@ acpi_ds_method_data_init_args(union acpi_operand_object **params,
214 * Store the argument in the method/walk descriptor. 215 * Store the argument in the method/walk descriptor.
215 * Do not copy the arg in order to implement call by reference 216 * Do not copy the arg in order to implement call by reference
216 */ 217 */
217 status = acpi_ds_method_data_set_value(ACPI_REFCLASS_ARG, index, 218 status =
218 params[index], 219 acpi_ds_method_data_set_value(ACPI_REFCLASS_ARG, index,
219 walk_state); 220 params[index], walk_state);
220 if (ACPI_FAILURE(status)) { 221 if (ACPI_FAILURE(status)) {
221 return_ACPI_STATUS(status); 222 return_ACPI_STATUS(status);
222 } 223 }
@@ -610,11 +611,11 @@ acpi_ds_store_object_to_local(u8 type,
610 * do the indirect store 611 * do the indirect store
611 */ 612 */
612 if ((ACPI_GET_DESCRIPTOR_TYPE(current_obj_desc) == 613 if ((ACPI_GET_DESCRIPTOR_TYPE(current_obj_desc) ==
613 ACPI_DESC_TYPE_OPERAND) 614 ACPI_DESC_TYPE_OPERAND) &&
614 && (current_obj_desc->common.type == 615 (current_obj_desc->common.type ==
615 ACPI_TYPE_LOCAL_REFERENCE) 616 ACPI_TYPE_LOCAL_REFERENCE) &&
616 && (current_obj_desc->reference.class == 617 (current_obj_desc->reference.class ==
617 ACPI_REFCLASS_REFOF)) { 618 ACPI_REFCLASS_REFOF)) {
618 ACPI_DEBUG_PRINT((ACPI_DB_EXEC, 619 ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
619 "Arg (%p) is an ObjRef(Node), storing in node %p\n", 620 "Arg (%p) is an ObjRef(Node), storing in node %p\n",
620 new_obj_desc, 621 new_obj_desc,
@@ -638,6 +639,7 @@ acpi_ds_store_object_to_local(u8 type,
638 if (new_obj_desc != obj_desc) { 639 if (new_obj_desc != obj_desc) {
639 acpi_ut_remove_reference(new_obj_desc); 640 acpi_ut_remove_reference(new_obj_desc);
640 } 641 }
642
641 return_ACPI_STATUS(status); 643 return_ACPI_STATUS(status);
642 } 644 }
643 } 645 }
diff --git a/drivers/acpi/acpica/dsobject.c b/drivers/acpi/acpica/dsobject.c
index 2beb7fd674ae..302c91f5377b 100644
--- a/drivers/acpi/acpica/dsobject.c
+++ b/drivers/acpi/acpica/dsobject.c
@@ -463,10 +463,10 @@ acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state,
463 arg->common.node); 463 arg->common.node);
464 } 464 }
465 } else { 465 } else {
466 status = acpi_ds_build_internal_object(walk_state, arg, 466 status =
467 &obj_desc-> 467 acpi_ds_build_internal_object(walk_state, arg,
468 package. 468 &obj_desc->package.
469 elements[i]); 469 elements[i]);
470 } 470 }
471 471
472 if (*obj_desc_ptr) { 472 if (*obj_desc_ptr) {
@@ -525,7 +525,8 @@ acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state,
525 } 525 }
526 526
527 ACPI_INFO((AE_INFO, 527 ACPI_INFO((AE_INFO,
528 "Actual Package length (%u) is larger than NumElements field (%u), truncated", 528 "Actual Package length (%u) is larger than "
529 "NumElements field (%u), truncated",
529 i, element_count)); 530 i, element_count));
530 } else if (i < element_count) { 531 } else if (i < element_count) {
531 /* 532 /*
@@ -533,7 +534,8 @@ acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state,
533 * Note: this is not an error, the package is padded out with NULLs. 534 * Note: this is not an error, the package is padded out with NULLs.
534 */ 535 */
535 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 536 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
536 "Package List length (%u) smaller than NumElements count (%u), padded with null elements\n", 537 "Package List length (%u) smaller than NumElements "
538 "count (%u), padded with null elements\n",
537 i, element_count)); 539 i, element_count));
538 } 540 }
539 541
@@ -584,8 +586,9 @@ acpi_ds_create_node(struct acpi_walk_state *walk_state,
584 586
585 /* Build an internal object for the argument(s) */ 587 /* Build an internal object for the argument(s) */
586 588
587 status = acpi_ds_build_internal_object(walk_state, op->common.value.arg, 589 status =
588 &obj_desc); 590 acpi_ds_build_internal_object(walk_state, op->common.value.arg,
591 &obj_desc);
589 if (ACPI_FAILURE(status)) { 592 if (ACPI_FAILURE(status)) {
590 return_ACPI_STATUS(status); 593 return_ACPI_STATUS(status);
591 } 594 }
diff --git a/drivers/acpi/acpica/dsopcode.c b/drivers/acpi/acpica/dsopcode.c
index 81d7b9863e32..1edd66f18907 100644
--- a/drivers/acpi/acpica/dsopcode.c
+++ b/drivers/acpi/acpica/dsopcode.c
@@ -243,8 +243,9 @@ acpi_ds_init_buffer_field(u16 aml_opcode,
243 * For field_flags, use LOCK_RULE = 0 (NO_LOCK), 243 * For field_flags, use LOCK_RULE = 0 (NO_LOCK),
244 * UPDATE_RULE = 0 (UPDATE_PRESERVE) 244 * UPDATE_RULE = 0 (UPDATE_PRESERVE)
245 */ 245 */
246 status = acpi_ex_prep_common_field_object(obj_desc, field_flags, 0, 246 status =
247 bit_offset, bit_count); 247 acpi_ex_prep_common_field_object(obj_desc, field_flags, 0,
248 bit_offset, bit_count);
248 if (ACPI_FAILURE(status)) { 249 if (ACPI_FAILURE(status)) {
249 goto cleanup; 250 goto cleanup;
250 } 251 }
@@ -330,8 +331,9 @@ acpi_ds_eval_buffer_field_operands(struct acpi_walk_state *walk_state,
330 331
331 /* Resolve the operands */ 332 /* Resolve the operands */
332 333
333 status = acpi_ex_resolve_operands(op->common.aml_opcode, 334 status =
334 ACPI_WALK_OPERANDS, walk_state); 335 acpi_ex_resolve_operands(op->common.aml_opcode, ACPI_WALK_OPERANDS,
336 walk_state);
335 if (ACPI_FAILURE(status)) { 337 if (ACPI_FAILURE(status)) {
336 ACPI_ERROR((AE_INFO, "(%s) bad operand(s), status 0x%X", 338 ACPI_ERROR((AE_INFO, "(%s) bad operand(s), status 0x%X",
337 acpi_ps_get_opcode_name(op->common.aml_opcode), 339 acpi_ps_get_opcode_name(op->common.aml_opcode),
@@ -414,8 +416,9 @@ acpi_ds_eval_region_operands(struct acpi_walk_state *walk_state,
414 416
415 /* Resolve the length and address operands to numbers */ 417 /* Resolve the length and address operands to numbers */
416 418
417 status = acpi_ex_resolve_operands(op->common.aml_opcode, 419 status =
418 ACPI_WALK_OPERANDS, walk_state); 420 acpi_ex_resolve_operands(op->common.aml_opcode, ACPI_WALK_OPERANDS,
421 walk_state);
419 if (ACPI_FAILURE(status)) { 422 if (ACPI_FAILURE(status)) {
420 return_ACPI_STATUS(status); 423 return_ACPI_STATUS(status);
421 } 424 }
@@ -452,7 +455,6 @@ acpi_ds_eval_region_operands(struct acpi_walk_state *walk_state,
452 /* Now the address and length are valid for this opregion */ 455 /* Now the address and length are valid for this opregion */
453 456
454 obj_desc->region.flags |= AOPOBJ_DATA_VALID; 457 obj_desc->region.flags |= AOPOBJ_DATA_VALID;
455
456 return_ACPI_STATUS(status); 458 return_ACPI_STATUS(status);
457} 459}
458 460
@@ -510,8 +512,9 @@ acpi_ds_eval_table_region_operands(struct acpi_walk_state *walk_state,
510 * Resolve the Signature string, oem_id string, 512 * Resolve the Signature string, oem_id string,
511 * and oem_table_id string operands 513 * and oem_table_id string operands
512 */ 514 */
513 status = acpi_ex_resolve_operands(op->common.aml_opcode, 515 status =
514 ACPI_WALK_OPERANDS, walk_state); 516 acpi_ex_resolve_operands(op->common.aml_opcode, ACPI_WALK_OPERANDS,
517 walk_state);
515 if (ACPI_FAILURE(status)) { 518 if (ACPI_FAILURE(status)) {
516 goto cleanup; 519 goto cleanup;
517 } 520 }
diff --git a/drivers/acpi/acpica/dsutils.c b/drivers/acpi/acpica/dsutils.c
index cecba391d4fc..fa8e2920a3ef 100644
--- a/drivers/acpi/acpica/dsutils.c
+++ b/drivers/acpi/acpica/dsutils.c
@@ -245,9 +245,9 @@ acpi_ds_is_result_used(union acpi_parse_object * op,
245 * we will use the return value 245 * we will use the return value
246 */ 246 */
247 if ((walk_state->control_state->common.state == 247 if ((walk_state->control_state->common.state ==
248 ACPI_CONTROL_PREDICATE_EXECUTING) 248 ACPI_CONTROL_PREDICATE_EXECUTING) &&
249 && (walk_state->control_state->control. 249 (walk_state->control_state->control.predicate_op ==
250 predicate_op == op)) { 250 op)) {
251 goto result_used; 251 goto result_used;
252 } 252 }
253 break; 253 break;
@@ -481,10 +481,9 @@ acpi_ds_create_operand(struct acpi_walk_state *walk_state,
481 481
482 /* Get the entire name string from the AML stream */ 482 /* Get the entire name string from the AML stream */
483 483
484 status = 484 status = acpi_ex_get_name_string(ACPI_TYPE_ANY,
485 acpi_ex_get_name_string(ACPI_TYPE_ANY, 485 arg->common.value.buffer,
486 arg->common.value.buffer, 486 &name_string, &name_length);
487 &name_string, &name_length);
488 487
489 if (ACPI_FAILURE(status)) { 488 if (ACPI_FAILURE(status)) {
490 return_ACPI_STATUS(status); 489 return_ACPI_STATUS(status);
@@ -503,9 +502,8 @@ acpi_ds_create_operand(struct acpi_walk_state *walk_state,
503 */ 502 */
504 if ((walk_state->deferred_node) && 503 if ((walk_state->deferred_node) &&
505 (walk_state->deferred_node->type == ACPI_TYPE_BUFFER_FIELD) 504 (walk_state->deferred_node->type == ACPI_TYPE_BUFFER_FIELD)
506 && (arg_index == 505 && (arg_index == (u32)
507 (u32)((walk_state->opcode == 506 ((walk_state->opcode == AML_CREATE_FIELD_OP) ? 3 : 2))) {
508 AML_CREATE_FIELD_OP) ? 3 : 2))) {
509 obj_desc = 507 obj_desc =
510 ACPI_CAST_PTR(union acpi_operand_object, 508 ACPI_CAST_PTR(union acpi_operand_object,
511 walk_state->deferred_node); 509 walk_state->deferred_node);
@@ -522,9 +520,10 @@ acpi_ds_create_operand(struct acpi_walk_state *walk_state,
522 op_info = 520 op_info =
523 acpi_ps_get_opcode_info(parent_op->common. 521 acpi_ps_get_opcode_info(parent_op->common.
524 aml_opcode); 522 aml_opcode);
525 if ((op_info->flags & AML_NSNODE) 523
526 && (parent_op->common.aml_opcode != 524 if ((op_info->flags & AML_NSNODE) &&
527 AML_INT_METHODCALL_OP) 525 (parent_op->common.aml_opcode !=
526 AML_INT_METHODCALL_OP)
528 && (parent_op->common.aml_opcode != AML_REGION_OP) 527 && (parent_op->common.aml_opcode != AML_REGION_OP)
529 && (parent_op->common.aml_opcode != 528 && (parent_op->common.aml_opcode !=
530 AML_INT_NAMEPATH_OP)) { 529 AML_INT_NAMEPATH_OP)) {
@@ -633,8 +632,8 @@ acpi_ds_create_operand(struct acpi_walk_state *walk_state,
633 return_ACPI_STATUS(AE_NOT_IMPLEMENTED); 632 return_ACPI_STATUS(AE_NOT_IMPLEMENTED);
634 } 633 }
635 634
636 if ((op_info->flags & AML_HAS_RETVAL) 635 if ((op_info->flags & AML_HAS_RETVAL) ||
637 || (arg->common.flags & ACPI_PARSEOP_IN_STACK)) { 636 (arg->common.flags & ACPI_PARSEOP_IN_STACK)) {
638 ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH, 637 ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
639 "Argument previously created, already stacked\n")); 638 "Argument previously created, already stacked\n"));
640 639
diff --git a/drivers/acpi/acpica/dswexec.c b/drivers/acpi/acpica/dswexec.c
index 9cc5761ef483..ed2f1d362092 100644
--- a/drivers/acpi/acpica/dswexec.c
+++ b/drivers/acpi/acpica/dswexec.c
@@ -172,7 +172,8 @@ acpi_ds_get_predicate_value(struct acpi_walk_state *walk_state,
172 172
173cleanup: 173cleanup:
174 174
175 ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Completed a predicate eval=%X Op=%p\n", 175 ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
176 "Completed a predicate eval=%X Op=%p\n",
176 walk_state->control_state->common.value, 177 walk_state->control_state->common.value,
177 walk_state->op)); 178 walk_state->op));
178 179
@@ -263,8 +264,8 @@ acpi_ds_exec_begin_op(struct acpi_walk_state *walk_state,
263 (walk_state->control_state->common.state == 264 (walk_state->control_state->common.state ==
264 ACPI_CONTROL_CONDITIONAL_EXECUTING)) { 265 ACPI_CONTROL_CONDITIONAL_EXECUTING)) {
265 ACPI_DEBUG_PRINT((ACPI_DB_EXEC, 266 ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
266 "Exec predicate Op=%p State=%p\n", op, 267 "Exec predicate Op=%p State=%p\n",
267 walk_state)); 268 op, walk_state));
268 269
269 walk_state->control_state->common.state = 270 walk_state->control_state->common.state =
270 ACPI_CONTROL_PREDICATE_EXECUTING; 271 ACPI_CONTROL_PREDICATE_EXECUTING;
@@ -500,9 +501,8 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state)
500 "Method Reference in a Package, Op=%p\n", 501 "Method Reference in a Package, Op=%p\n",
501 op)); 502 op));
502 503
503 op->common.node = 504 op->common.node = (struct acpi_namespace_node *)
504 (struct acpi_namespace_node *)op->asl.value. 505 op->asl.value.arg->asl.node;
505 arg->asl.node;
506 acpi_ut_add_reference(op->asl.value.arg->asl. 506 acpi_ut_add_reference(op->asl.value.arg->asl.
507 node->object); 507 node->object);
508 return_ACPI_STATUS(AE_OK); 508 return_ACPI_STATUS(AE_OK);
@@ -584,8 +584,8 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state)
584 * Put the Node on the object stack (Contains the ACPI Name 584 * Put the Node on the object stack (Contains the ACPI Name
585 * of this object) 585 * of this object)
586 */ 586 */
587 walk_state->operands[0] = 587 walk_state->operands[0] = (void *)
588 (void *)op->common.parent->common.node; 588 op->common.parent->common.node;
589 walk_state->num_operands = 1; 589 walk_state->num_operands = 1;
590 590
591 status = acpi_ds_create_node(walk_state, 591 status = acpi_ds_create_node(walk_state,
@@ -690,7 +690,8 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state)
690 default: 690 default:
691 691
692 ACPI_ERROR((AE_INFO, 692 ACPI_ERROR((AE_INFO,
693 "Unimplemented opcode, class=0x%X type=0x%X Opcode=0x%X Op=%p", 693 "Unimplemented opcode, class=0x%X "
694 "type=0x%X Opcode=0x%X Op=%p",
694 op_class, op_type, op->common.aml_opcode, 695 op_class, op_type, op->common.aml_opcode,
695 op)); 696 op));
696 697
diff --git a/drivers/acpi/acpica/dswload.c b/drivers/acpi/acpica/dswload.c
index 097188a6b1c1..b3254742aaf6 100644
--- a/drivers/acpi/acpica/dswload.c
+++ b/drivers/acpi/acpica/dswload.c
@@ -476,13 +476,9 @@ acpi_status acpi_ds_load1_end_op(struct acpi_walk_state *walk_state)
476 status = 476 status =
477 acpi_ex_create_region(op->named.data, 477 acpi_ex_create_region(op->named.data,
478 op->named.length, 478 op->named.length,
479 (acpi_adr_space_type) ((op-> 479 (acpi_adr_space_type)
480 common. 480 ((op->common.value.arg)->
481 value. 481 common.value.integer),
482 arg)->
483 common.
484 value.
485 integer),
486 walk_state); 482 walk_state);
487 if (ACPI_FAILURE(status)) { 483 if (ACPI_FAILURE(status)) {
488 return_ACPI_STATUS(status); 484 return_ACPI_STATUS(status);
diff --git a/drivers/acpi/acpica/dswload2.c b/drivers/acpi/acpica/dswload2.c
index e2c08cd79aca..8a32153a111b 100644
--- a/drivers/acpi/acpica/dswload2.c
+++ b/drivers/acpi/acpica/dswload2.c
@@ -598,11 +598,10 @@ acpi_status acpi_ds_load2_end_op(struct acpi_walk_state *walk_state)
598 * Executing a method: initialize the region and unlock 598 * Executing a method: initialize the region and unlock
599 * the interpreter 599 * the interpreter
600 */ 600 */
601 status = 601 status = acpi_ex_create_region(op->named.data,
602 acpi_ex_create_region(op->named.data, 602 op->named.length,
603 op->named.length, 603 region_space,
604 region_space, 604 walk_state);
605 walk_state);
606 if (ACPI_FAILURE(status)) { 605 if (ACPI_FAILURE(status)) {
607 return_ACPI_STATUS(status); 606 return_ACPI_STATUS(status);
608 } 607 }
@@ -664,6 +663,7 @@ acpi_status acpi_ds_load2_end_op(struct acpi_walk_state *walk_state)
664 length, 663 length,
665 walk_state); 664 walk_state);
666 } 665 }
666
667 walk_state->operands[0] = NULL; 667 walk_state->operands[0] = NULL;
668 walk_state->num_operands = 0; 668 walk_state->num_operands = 0;
669 669
diff --git a/drivers/acpi/acpica/dswscope.c b/drivers/acpi/acpica/dswscope.c
index 43b3ea40c0b6..2d7a04493469 100644
--- a/drivers/acpi/acpica/dswscope.c
+++ b/drivers/acpi/acpica/dswscope.c
@@ -77,6 +77,7 @@ void acpi_ds_scope_stack_clear(struct acpi_walk_state *walk_state)
77 "Popped object type (%s)\n", 77 "Popped object type (%s)\n",
78 acpi_ut_get_type_name(scope_info->common. 78 acpi_ut_get_type_name(scope_info->common.
79 value))); 79 value)));
80
80 acpi_ut_delete_generic_state(scope_info); 81 acpi_ut_delete_generic_state(scope_info);
81 } 82 }
82} 83}
diff --git a/drivers/acpi/acpica/evgpe.c b/drivers/acpi/acpica/evgpe.c
index ccf793247447..112e821a1cec 100644
--- a/drivers/acpi/acpica/evgpe.c
+++ b/drivers/acpi/acpica/evgpe.c
@@ -92,8 +92,8 @@ acpi_ev_update_gpe_enable_mask(struct acpi_gpe_event_info *gpe_event_info)
92 ACPI_SET_BIT(gpe_register_info->enable_for_run, 92 ACPI_SET_BIT(gpe_register_info->enable_for_run,
93 (u8)register_bit); 93 (u8)register_bit);
94 } 94 }
95 gpe_register_info->enable_mask = gpe_register_info->enable_for_run;
96 95
96 gpe_register_info->enable_mask = gpe_register_info->enable_for_run;
97 return_ACPI_STATUS(AE_OK); 97 return_ACPI_STATUS(AE_OK);
98} 98}
99 99
diff --git a/drivers/acpi/acpica/evgpeblk.c b/drivers/acpi/acpica/evgpeblk.c
index e0f24c504513..c00a9f2f82d5 100644
--- a/drivers/acpi/acpica/evgpeblk.c
+++ b/drivers/acpi/acpica/evgpeblk.c
@@ -167,6 +167,7 @@ acpi_status acpi_ev_delete_gpe_block(struct acpi_gpe_block_info *gpe_block)
167 if (gpe_block->next) { 167 if (gpe_block->next) {
168 gpe_block->next->previous = gpe_block->previous; 168 gpe_block->next->previous = gpe_block->previous;
169 } 169 }
170
170 acpi_os_release_lock(acpi_gbl_gpe_lock, flags); 171 acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
171 } 172 }
172 173
diff --git a/drivers/acpi/acpica/evgpeutil.c b/drivers/acpi/acpica/evgpeutil.c
index 3a958f3612fe..fd5ab9012238 100644
--- a/drivers/acpi/acpica/evgpeutil.c
+++ b/drivers/acpi/acpica/evgpeutil.c
@@ -346,6 +346,7 @@ acpi_ev_delete_gpe_handlers(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
346 ACPI_FREE(notify); 346 ACPI_FREE(notify);
347 notify = next; 347 notify = next;
348 } 348 }
349
349 gpe_event_info->dispatch.notify_list = NULL; 350 gpe_event_info->dispatch.notify_list = NULL;
350 gpe_event_info->flags &= 351 gpe_event_info->flags &=
351 ~ACPI_GPE_DISPATCH_MASK; 352 ~ACPI_GPE_DISPATCH_MASK;
diff --git a/drivers/acpi/acpica/evmisc.c b/drivers/acpi/acpica/evmisc.c
index f7c9dfe7b990..8866f50d38f7 100644
--- a/drivers/acpi/acpica/evmisc.c
+++ b/drivers/acpi/acpica/evmisc.c
@@ -68,6 +68,7 @@ static void ACPI_SYSTEM_XFACE acpi_ev_notify_dispatch(void *context);
68 68
69u8 acpi_ev_is_notify_object(struct acpi_namespace_node *node) 69u8 acpi_ev_is_notify_object(struct acpi_namespace_node *node)
70{ 70{
71
71 switch (node->type) { 72 switch (node->type) {
72 case ACPI_TYPE_DEVICE: 73 case ACPI_TYPE_DEVICE:
73 case ACPI_TYPE_PROCESSOR: 74 case ACPI_TYPE_PROCESSOR:
@@ -170,8 +171,8 @@ acpi_ev_queue_notify_request(struct acpi_namespace_node * node,
170 acpi_ut_get_notify_name(notify_value, ACPI_TYPE_ANY), 171 acpi_ut_get_notify_name(notify_value, ACPI_TYPE_ANY),
171 node)); 172 node));
172 173
173 status = acpi_os_execute(OSL_NOTIFY_HANDLER, acpi_ev_notify_dispatch, 174 status = acpi_os_execute(OSL_NOTIFY_HANDLER,
174 info); 175 acpi_ev_notify_dispatch, info);
175 if (ACPI_FAILURE(status)) { 176 if (ACPI_FAILURE(status)) {
176 acpi_ut_delete_generic_state(info); 177 acpi_ut_delete_generic_state(info);
177 } 178 }
diff --git a/drivers/acpi/acpica/evxface.c b/drivers/acpi/acpica/evxface.c
index 07d22bfbaa00..012b9dedfa79 100644
--- a/drivers/acpi/acpica/evxface.c
+++ b/drivers/acpi/acpica/evxface.c
@@ -879,9 +879,8 @@ acpi_install_gpe_handler(acpi_handle gpe_device,
879 879
880 ACPI_FUNCTION_TRACE(acpi_install_gpe_handler); 880 ACPI_FUNCTION_TRACE(acpi_install_gpe_handler);
881 881
882 status = 882 status = acpi_ev_install_gpe_handler(gpe_device, gpe_number, type,
883 acpi_ev_install_gpe_handler(gpe_device, gpe_number, type, FALSE, 883 FALSE, address, context);
884 address, context);
885 884
886 return_ACPI_STATUS(status); 885 return_ACPI_STATUS(status);
887} 886}
@@ -914,8 +913,8 @@ acpi_install_gpe_raw_handler(acpi_handle gpe_device,
914 913
915 ACPI_FUNCTION_TRACE(acpi_install_gpe_raw_handler); 914 ACPI_FUNCTION_TRACE(acpi_install_gpe_raw_handler);
916 915
917 status = acpi_ev_install_gpe_handler(gpe_device, gpe_number, type, TRUE, 916 status = acpi_ev_install_gpe_handler(gpe_device, gpe_number, type,
918 address, context); 917 TRUE, address, context);
919 918
920 return_ACPI_STATUS(status); 919 return_ACPI_STATUS(status);
921} 920}
diff --git a/drivers/acpi/acpica/evxfregn.c b/drivers/acpi/acpica/evxfregn.c
index f21afbab03f7..dbd9f16a077f 100644
--- a/drivers/acpi/acpica/evxfregn.c
+++ b/drivers/acpi/acpica/evxfregn.c
@@ -135,6 +135,7 @@ acpi_install_address_space_handler(acpi_handle device,
135 if (!acpi_gbl_reg_methods_executed) { 135 if (!acpi_gbl_reg_methods_executed) {
136 136
137 /* We will defer execution of the _REG methods for this space */ 137 /* We will defer execution of the _REG methods for this space */
138
138 goto unlock_and_exit; 139 goto unlock_and_exit;
139 } 140 }
140 break; 141 break;
diff --git a/drivers/acpi/acpica/exconfig.c b/drivers/acpi/acpica/exconfig.c
index b540913c11ac..adcb9c7029c4 100644
--- a/drivers/acpi/acpica/exconfig.c
+++ b/drivers/acpi/acpica/exconfig.c
@@ -358,8 +358,8 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc,
358 } 358 }
359 359
360 /* 360 /*
361 * If the Region Address and Length have not been previously evaluated, 361 * If the Region Address and Length have not been previously
362 * evaluate them now and save the results. 362 * evaluated, evaluate them now and save the results.
363 */ 363 */
364 if (!(obj_desc->common.flags & AOPOBJ_DATA_VALID)) { 364 if (!(obj_desc->common.flags & AOPOBJ_DATA_VALID)) {
365 status = acpi_ds_get_region_arguments(obj_desc); 365 status = acpi_ds_get_region_arguments(obj_desc);
@@ -454,8 +454,8 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc,
454 } 454 }
455 455
456 /* 456 /*
457 * Copy the table from the buffer because the buffer could be modified 457 * Copy the table from the buffer because the buffer could be
458 * or even deleted in the future 458 * modified or even deleted in the future
459 */ 459 */
460 table = ACPI_ALLOCATE(length); 460 table = ACPI_ALLOCATE(length);
461 if (!table) { 461 if (!table) {
diff --git a/drivers/acpi/acpica/exconvrt.c b/drivers/acpi/acpica/exconvrt.c
index 145de28c702d..73c2e823488d 100644
--- a/drivers/acpi/acpica/exconvrt.c
+++ b/drivers/acpi/acpica/exconvrt.c
@@ -227,8 +227,8 @@ acpi_ex_convert_to_buffer(union acpi_operand_object *obj_desc,
227 /* Copy the integer to the buffer, LSB first */ 227 /* Copy the integer to the buffer, LSB first */
228 228
229 new_buf = return_desc->buffer.pointer; 229 new_buf = return_desc->buffer.pointer;
230 memcpy(new_buf, 230 memcpy(new_buf, &obj_desc->integer.value,
231 &obj_desc->integer.value, acpi_gbl_integer_byte_width); 231 acpi_gbl_integer_byte_width);
232 break; 232 break;
233 233
234 case ACPI_TYPE_STRING: 234 case ACPI_TYPE_STRING:
@@ -354,9 +354,8 @@ acpi_ex_convert_to_ascii(u64 integer, u16 base, u8 *string, u8 data_width)
354 354
355 /* Get one hex digit, most significant digits first */ 355 /* Get one hex digit, most significant digits first */
356 356
357 string[k] = 357 string[k] = (u8)
358 (u8)acpi_ut_hex_to_ascii_char(integer, 358 acpi_ut_hex_to_ascii_char(integer, ACPI_MUL_4(j));
359 ACPI_MUL_4(j));
360 k++; 359 k++;
361 } 360 }
362 break; 361 break;
diff --git a/drivers/acpi/acpica/excreate.c b/drivers/acpi/acpica/excreate.c
index 95fe46473e8b..0f3444647f52 100644
--- a/drivers/acpi/acpica/excreate.c
+++ b/drivers/acpi/acpica/excreate.c
@@ -189,9 +189,9 @@ acpi_status acpi_ex_create_event(struct acpi_walk_state *walk_state)
189 189
190 /* Attach object to the Node */ 190 /* Attach object to the Node */
191 191
192 status = 192 status = acpi_ns_attach_object((struct acpi_namespace_node *)
193 acpi_ns_attach_object((struct acpi_namespace_node *)walk_state-> 193 walk_state->operands[0], obj_desc,
194 operands[0], obj_desc, ACPI_TYPE_EVENT); 194 ACPI_TYPE_EVENT);
195 195
196cleanup: 196cleanup:
197 /* 197 /*
@@ -493,8 +493,8 @@ acpi_ex_create_method(u8 * aml_start,
493 * flag, and sync_level for efficiency. 493 * flag, and sync_level for efficiency.
494 */ 494 */
495 method_flags = (u8)operand[1]->integer.value; 495 method_flags = (u8)operand[1]->integer.value;
496 obj_desc->method.param_count = 496 obj_desc->method.param_count = (u8)
497 (u8)(method_flags & AML_METHOD_ARG_COUNT); 497 (method_flags & AML_METHOD_ARG_COUNT);
498 498
499 /* 499 /*
500 * Get the sync_level. If method is serialized, a mutex will be 500 * Get the sync_level. If method is serialized, a mutex will be
diff --git a/drivers/acpi/acpica/exdebug.c b/drivers/acpi/acpica/exdebug.c
index de92458236f5..665a4b9556e2 100644
--- a/drivers/acpi/acpica/exdebug.c
+++ b/drivers/acpi/acpica/exdebug.c
@@ -491,6 +491,7 @@ acpi_ex_start_trace_method(struct acpi_namespace_node *method_node,
491 acpi_dbg_layer = acpi_gbl_trace_dbg_layer; 491 acpi_dbg_layer = acpi_gbl_trace_dbg_layer;
492 } 492 }
493 } 493 }
494
494 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); 495 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
495 496
496exit: 497exit:
diff --git a/drivers/acpi/acpica/exfield.c b/drivers/acpi/acpica/exfield.c
index c95fd186ded2..ad7080ba65e2 100644
--- a/drivers/acpi/acpica/exfield.c
+++ b/drivers/acpi/acpica/exfield.c
@@ -167,10 +167,11 @@ acpi_ex_read_data_from_field(struct acpi_walk_state * walk_state,
167 || obj_desc->field.region_obj->region.space_id == 167 || obj_desc->field.region_obj->region.space_id ==
168 ACPI_ADR_SPACE_IPMI)) { 168 ACPI_ADR_SPACE_IPMI)) {
169 /* 169 /*
170 * This is an SMBus, GSBus or IPMI read. We must create a buffer to hold 170 * This is an SMBus, GSBus or IPMI read. We must create a buffer to
171 * the data and then directly access the region handler. 171 * hold the data and then directly access the region handler.
172 * 172 *
173 * Note: SMBus and GSBus protocol value is passed in upper 16-bits of Function 173 * Note: SMBus and GSBus protocol value is passed in upper 16-bits
174 * of Function
174 */ 175 */
175 if (obj_desc->field.region_obj->region.space_id == 176 if (obj_desc->field.region_obj->region.space_id ==
176 ACPI_ADR_SPACE_SMBUS) { 177 ACPI_ADR_SPACE_SMBUS) {
@@ -180,17 +181,17 @@ acpi_ex_read_data_from_field(struct acpi_walk_state * walk_state,
180 } else if (obj_desc->field.region_obj->region.space_id == 181 } else if (obj_desc->field.region_obj->region.space_id ==
181 ACPI_ADR_SPACE_GSBUS) { 182 ACPI_ADR_SPACE_GSBUS) {
182 accessor_type = obj_desc->field.attribute; 183 accessor_type = obj_desc->field.attribute;
183 length = acpi_ex_get_serial_access_length(accessor_type, 184 length =
184 obj_desc-> 185 acpi_ex_get_serial_access_length(accessor_type,
185 field. 186 obj_desc->field.
186 access_length); 187 access_length);
187 188
188 /* 189 /*
189 * Add additional 2 bytes for the generic_serial_bus data buffer: 190 * Add additional 2 bytes for the generic_serial_bus data buffer:
190 * 191 *
191 * Status; (Byte 0 of the data buffer) 192 * Status; (Byte 0 of the data buffer)
192 * Length; (Byte 1 of the data buffer) 193 * Length; (Byte 1 of the data buffer)
193 * Data[x-1]; (Bytes 2-x of the arbitrary length data buffer) 194 * Data[x-1]: (Bytes 2-x of the arbitrary length data buffer)
194 */ 195 */
195 length += 2; 196 length += 2;
196 function = ACPI_READ | (accessor_type << 16); 197 function = ACPI_READ | (accessor_type << 16);
@@ -216,6 +217,7 @@ acpi_ex_read_data_from_field(struct acpi_walk_state * walk_state,
216 buffer_desc-> 217 buffer_desc->
217 buffer.pointer), 218 buffer.pointer),
218 function); 219 function);
220
219 acpi_ex_release_global_lock(obj_desc->common_field.field_flags); 221 acpi_ex_release_global_lock(obj_desc->common_field.field_flags);
220 goto exit; 222 goto exit;
221 } 223 }
@@ -232,6 +234,7 @@ acpi_ex_read_data_from_field(struct acpi_walk_state * walk_state,
232 */ 234 */
233 length = 235 length =
234 (acpi_size) ACPI_ROUND_BITS_UP_TO_BYTES(obj_desc->field.bit_length); 236 (acpi_size) ACPI_ROUND_BITS_UP_TO_BYTES(obj_desc->field.bit_length);
237
235 if (length > acpi_gbl_integer_byte_width) { 238 if (length > acpi_gbl_integer_byte_width) {
236 239
237 /* Field is too large for an Integer, create a Buffer instead */ 240 /* Field is too large for an Integer, create a Buffer instead */
@@ -273,8 +276,10 @@ acpi_ex_read_data_from_field(struct acpi_walk_state * walk_state,
273 276
274 /* Perform the write */ 277 /* Perform the write */
275 278
276 status = acpi_ex_access_region(obj_desc, 0, 279 status =
277 (u64 *)buffer, ACPI_READ); 280 acpi_ex_access_region(obj_desc, 0, (u64 *)buffer,
281 ACPI_READ);
282
278 acpi_ex_release_global_lock(obj_desc->common_field.field_flags); 283 acpi_ex_release_global_lock(obj_desc->common_field.field_flags);
279 if (ACPI_FAILURE(status)) { 284 if (ACPI_FAILURE(status)) {
280 acpi_ut_remove_reference(buffer_desc); 285 acpi_ut_remove_reference(buffer_desc);
@@ -366,19 +371,22 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc,
366 || obj_desc->field.region_obj->region.space_id == 371 || obj_desc->field.region_obj->region.space_id ==
367 ACPI_ADR_SPACE_IPMI)) { 372 ACPI_ADR_SPACE_IPMI)) {
368 /* 373 /*
369 * This is an SMBus, GSBus or IPMI write. We will bypass the entire field 374 * This is an SMBus, GSBus or IPMI write. We will bypass the entire
370 * mechanism and handoff the buffer directly to the handler. For 375 * field mechanism and handoff the buffer directly to the handler.
371 * these address spaces, the buffer is bi-directional; on a write, 376 * For these address spaces, the buffer is bi-directional; on a
372 * return data is returned in the same buffer. 377 * write, return data is returned in the same buffer.
373 * 378 *
374 * Source must be a buffer of sufficient size: 379 * Source must be a buffer of sufficient size:
375 * ACPI_SMBUS_BUFFER_SIZE, ACPI_GSBUS_BUFFER_SIZE, or ACPI_IPMI_BUFFER_SIZE. 380 * ACPI_SMBUS_BUFFER_SIZE, ACPI_GSBUS_BUFFER_SIZE, or
381 * ACPI_IPMI_BUFFER_SIZE.
376 * 382 *
377 * Note: SMBus and GSBus protocol type is passed in upper 16-bits of Function 383 * Note: SMBus and GSBus protocol type is passed in upper 16-bits
384 * of Function
378 */ 385 */
379 if (source_desc->common.type != ACPI_TYPE_BUFFER) { 386 if (source_desc->common.type != ACPI_TYPE_BUFFER) {
380 ACPI_ERROR((AE_INFO, 387 ACPI_ERROR((AE_INFO,
381 "SMBus/IPMI/GenericSerialBus write requires Buffer, found type %s", 388 "SMBus/IPMI/GenericSerialBus write requires "
389 "Buffer, found type %s",
382 acpi_ut_get_object_type_name(source_desc))); 390 acpi_ut_get_object_type_name(source_desc)));
383 391
384 return_ACPI_STATUS(AE_AML_OPERAND_TYPE); 392 return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
@@ -392,17 +400,17 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc,
392 } else if (obj_desc->field.region_obj->region.space_id == 400 } else if (obj_desc->field.region_obj->region.space_id ==
393 ACPI_ADR_SPACE_GSBUS) { 401 ACPI_ADR_SPACE_GSBUS) {
394 accessor_type = obj_desc->field.attribute; 402 accessor_type = obj_desc->field.attribute;
395 length = acpi_ex_get_serial_access_length(accessor_type, 403 length =
396 obj_desc-> 404 acpi_ex_get_serial_access_length(accessor_type,
397 field. 405 obj_desc->field.
398 access_length); 406 access_length);
399 407
400 /* 408 /*
401 * Add additional 2 bytes for the generic_serial_bus data buffer: 409 * Add additional 2 bytes for the generic_serial_bus data buffer:
402 * 410 *
403 * Status; (Byte 0 of the data buffer) 411 * Status; (Byte 0 of the data buffer)
404 * Length; (Byte 1 of the data buffer) 412 * Length; (Byte 1 of the data buffer)
405 * Data[x-1]; (Bytes 2-x of the arbitrary length data buffer) 413 * Data[x-1]: (Bytes 2-x of the arbitrary length data buffer)
406 */ 414 */
407 length += 2; 415 length += 2;
408 function = ACPI_WRITE | (accessor_type << 16); 416 function = ACPI_WRITE | (accessor_type << 16);
@@ -414,7 +422,8 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc,
414 422
415 if (source_desc->buffer.length < length) { 423 if (source_desc->buffer.length < length) {
416 ACPI_ERROR((AE_INFO, 424 ACPI_ERROR((AE_INFO,
417 "SMBus/IPMI/GenericSerialBus write requires Buffer of length %u, found length %u", 425 "SMBus/IPMI/GenericSerialBus write requires "
426 "Buffer of length %u, found length %u",
418 length, source_desc->buffer.length)); 427 length, source_desc->buffer.length));
419 428
420 return_ACPI_STATUS(AE_AML_BUFFER_LIMIT); 429 return_ACPI_STATUS(AE_AML_BUFFER_LIMIT);
@@ -438,8 +447,8 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc,
438 * Perform the write (returns status and perhaps data in the 447 * Perform the write (returns status and perhaps data in the
439 * same buffer) 448 * same buffer)
440 */ 449 */
441 status = acpi_ex_access_region(obj_desc, 0, 450 status =
442 (u64 *)buffer, function); 451 acpi_ex_access_region(obj_desc, 0, (u64 *)buffer, function);
443 acpi_ex_release_global_lock(obj_desc->common_field.field_flags); 452 acpi_ex_release_global_lock(obj_desc->common_field.field_flags);
444 453
445 *result_desc = buffer_desc; 454 *result_desc = buffer_desc;
@@ -460,7 +469,7 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc,
460 } 469 }
461 470
462 ACPI_DEBUG_PRINT((ACPI_DB_BFIELD, 471 ACPI_DEBUG_PRINT((ACPI_DB_BFIELD,
463 "GPIO FieldWrite [FROM]: (%s:%X), Val %.8X [TO]: Pin %u Bits %u\n", 472 "GPIO FieldWrite [FROM]: (%s:%X), Val %.8X [TO]: Pin %u Bits %u\n",
464 acpi_ut_get_type_name(source_desc->common. 473 acpi_ut_get_type_name(source_desc->common.
465 type), 474 type),
466 source_desc->common.type, 475 source_desc->common.type,
@@ -476,8 +485,9 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc,
476 485
477 /* Perform the write */ 486 /* Perform the write */
478 487
479 status = acpi_ex_access_region(obj_desc, 0, 488 status =
480 (u64 *)buffer, ACPI_WRITE); 489 acpi_ex_access_region(obj_desc, 0, (u64 *)buffer,
490 ACPI_WRITE);
481 acpi_ex_release_global_lock(obj_desc->common_field.field_flags); 491 acpi_ex_release_global_lock(obj_desc->common_field.field_flags);
482 return_ACPI_STATUS(status); 492 return_ACPI_STATUS(status);
483 } 493 }
diff --git a/drivers/acpi/acpica/exfldio.c b/drivers/acpi/acpica/exfldio.c
index 70b7bbbb860b..0337191dbf3d 100644
--- a/drivers/acpi/acpica/exfldio.c
+++ b/drivers/acpi/acpica/exfldio.c
@@ -180,7 +180,8 @@ acpi_ex_setup_region(union acpi_operand_object *obj_desc,
180 * byte, and a field with Dword access specified. 180 * byte, and a field with Dword access specified.
181 */ 181 */
182 ACPI_ERROR((AE_INFO, 182 ACPI_ERROR((AE_INFO,
183 "Field [%4.4s] access width (%u bytes) too large for region [%4.4s] (length %u)", 183 "Field [%4.4s] access width (%u bytes) "
184 "too large for region [%4.4s] (length %u)",
184 acpi_ut_get_node_name(obj_desc-> 185 acpi_ut_get_node_name(obj_desc->
185 common_field.node), 186 common_field.node),
186 obj_desc->common_field.access_byte_width, 187 obj_desc->common_field.access_byte_width,
@@ -194,7 +195,8 @@ acpi_ex_setup_region(union acpi_operand_object *obj_desc,
194 * exceeds region length, indicate an error 195 * exceeds region length, indicate an error
195 */ 196 */
196 ACPI_ERROR((AE_INFO, 197 ACPI_ERROR((AE_INFO,
197 "Field [%4.4s] Base+Offset+Width %u+%u+%u is beyond end of region [%4.4s] (length %u)", 198 "Field [%4.4s] Base+Offset+Width %u+%u+%u "
199 "is beyond end of region [%4.4s] (length %u)",
198 acpi_ut_get_node_name(obj_desc->common_field.node), 200 acpi_ut_get_node_name(obj_desc->common_field.node),
199 obj_desc->common_field.base_byte_offset, 201 obj_desc->common_field.base_byte_offset,
200 field_datum_byte_offset, 202 field_datum_byte_offset,
@@ -638,15 +640,15 @@ acpi_ex_write_with_update_rule(union acpi_operand_object *obj_desc,
638 640
639 ACPI_ERROR((AE_INFO, 641 ACPI_ERROR((AE_INFO,
640 "Unknown UpdateRule value: 0x%X", 642 "Unknown UpdateRule value: 0x%X",
641 (obj_desc->common_field. 643 (obj_desc->common_field.field_flags &
642 field_flags &
643 AML_FIELD_UPDATE_RULE_MASK))); 644 AML_FIELD_UPDATE_RULE_MASK)));
644 return_ACPI_STATUS(AE_AML_OPERAND_VALUE); 645 return_ACPI_STATUS(AE_AML_OPERAND_VALUE);
645 } 646 }
646 } 647 }
647 648
648 ACPI_DEBUG_PRINT((ACPI_DB_BFIELD, 649 ACPI_DEBUG_PRINT((ACPI_DB_BFIELD,
649 "Mask %8.8X%8.8X, DatumOffset %X, Width %X, Value %8.8X%8.8X, MergedValue %8.8X%8.8X\n", 650 "Mask %8.8X%8.8X, DatumOffset %X, Width %X, "
651 "Value %8.8X%8.8X, MergedValue %8.8X%8.8X\n",
650 ACPI_FORMAT_UINT64(mask), 652 ACPI_FORMAT_UINT64(mask),
651 field_datum_byte_offset, 653 field_datum_byte_offset,
652 obj_desc->common_field.access_byte_width, 654 obj_desc->common_field.access_byte_width,
@@ -655,8 +657,9 @@ acpi_ex_write_with_update_rule(union acpi_operand_object *obj_desc,
655 657
656 /* Write the merged value */ 658 /* Write the merged value */
657 659
658 status = acpi_ex_field_datum_io(obj_desc, field_datum_byte_offset, 660 status =
659 &merged_value, ACPI_WRITE); 661 acpi_ex_field_datum_io(obj_desc, field_datum_byte_offset,
662 &merged_value, ACPI_WRITE);
660 663
661 return_ACPI_STATUS(status); 664 return_ACPI_STATUS(status);
662} 665}
@@ -764,8 +767,9 @@ acpi_ex_extract_from_field(union acpi_operand_object *obj_desc,
764 /* Get next input datum from the field */ 767 /* Get next input datum from the field */
765 768
766 field_offset += obj_desc->common_field.access_byte_width; 769 field_offset += obj_desc->common_field.access_byte_width;
767 status = acpi_ex_field_datum_io(obj_desc, field_offset, 770 status =
768 &raw_datum, ACPI_READ); 771 acpi_ex_field_datum_io(obj_desc, field_offset, &raw_datum,
772 ACPI_READ);
769 if (ACPI_FAILURE(status)) { 773 if (ACPI_FAILURE(status)) {
770 return_ACPI_STATUS(status); 774 return_ACPI_STATUS(status);
771 } 775 }
@@ -858,6 +862,7 @@ acpi_ex_insert_into_field(union acpi_operand_object *obj_desc,
858 new_buffer = NULL; 862 new_buffer = NULL;
859 required_length = 863 required_length =
860 ACPI_ROUND_BITS_UP_TO_BYTES(obj_desc->common_field.bit_length); 864 ACPI_ROUND_BITS_UP_TO_BYTES(obj_desc->common_field.bit_length);
865
861 /* 866 /*
862 * We must have a buffer that is at least as long as the field 867 * We must have a buffer that is at least as long as the field
863 * we are writing to. This is because individual fields are 868 * we are writing to. This is because individual fields are
@@ -932,9 +937,9 @@ acpi_ex_insert_into_field(union acpi_operand_object *obj_desc,
932 /* Write merged datum to the target field */ 937 /* Write merged datum to the target field */
933 938
934 merged_datum &= mask; 939 merged_datum &= mask;
935 status = acpi_ex_write_with_update_rule(obj_desc, mask, 940 status =
936 merged_datum, 941 acpi_ex_write_with_update_rule(obj_desc, mask, merged_datum,
937 field_offset); 942 field_offset);
938 if (ACPI_FAILURE(status)) { 943 if (ACPI_FAILURE(status)) {
939 goto exit; 944 goto exit;
940 } 945 }
@@ -990,9 +995,9 @@ acpi_ex_insert_into_field(union acpi_operand_object *obj_desc,
990 /* Write the last datum to the field */ 995 /* Write the last datum to the field */
991 996
992 merged_datum &= mask; 997 merged_datum &= mask;
993 status = acpi_ex_write_with_update_rule(obj_desc, 998 status =
994 mask, merged_datum, 999 acpi_ex_write_with_update_rule(obj_desc, mask, merged_datum,
995 field_offset); 1000 field_offset);
996 1001
997exit: 1002exit:
998 /* Free temporary buffer if we used one */ 1003 /* Free temporary buffer if we used one */
diff --git a/drivers/acpi/acpica/exmisc.c b/drivers/acpi/acpica/exmisc.c
index d02afece0f10..b5413bb8b374 100644
--- a/drivers/acpi/acpica/exmisc.c
+++ b/drivers/acpi/acpica/exmisc.c
@@ -267,8 +267,9 @@ acpi_ex_do_concatenate(union acpi_operand_object *operand0,
267 267
268 case ACPI_TYPE_STRING: 268 case ACPI_TYPE_STRING:
269 269
270 status = acpi_ex_convert_to_string(operand1, &local_operand1, 270 status =
271 ACPI_IMPLICIT_CONVERT_HEX); 271 acpi_ex_convert_to_string(operand1, &local_operand1,
272 ACPI_IMPLICIT_CONVERT_HEX);
272 break; 273 break;
273 274
274 case ACPI_TYPE_BUFFER: 275 case ACPI_TYPE_BUFFER:
@@ -591,8 +592,9 @@ acpi_ex_do_logical_op(u16 opcode,
591 592
592 case ACPI_TYPE_STRING: 593 case ACPI_TYPE_STRING:
593 594
594 status = acpi_ex_convert_to_string(operand1, &local_operand1, 595 status =
595 ACPI_IMPLICIT_CONVERT_HEX); 596 acpi_ex_convert_to_string(operand1, &local_operand1,
597 ACPI_IMPLICIT_CONVERT_HEX);
596 break; 598 break;
597 599
598 case ACPI_TYPE_BUFFER: 600 case ACPI_TYPE_BUFFER:
diff --git a/drivers/acpi/acpica/exnames.c b/drivers/acpi/acpica/exnames.c
index 20e87813c7d7..b2e911a35866 100644
--- a/drivers/acpi/acpica/exnames.c
+++ b/drivers/acpi/acpica/exnames.c
@@ -164,8 +164,8 @@ static acpi_status acpi_ex_name_segment(u8 ** in_aml_address, char *name_string)
164 ACPI_FUNCTION_TRACE(ex_name_segment); 164 ACPI_FUNCTION_TRACE(ex_name_segment);
165 165
166 /* 166 /*
167 * If first character is a digit, then we know that we aren't looking at a 167 * If first character is a digit, then we know that we aren't looking
168 * valid name segment 168 * at a valid name segment
169 */ 169 */
170 char_buf[0] = *aml_address; 170 char_buf[0] = *aml_address;
171 171
diff --git a/drivers/acpi/acpica/exoparg1.c b/drivers/acpi/acpica/exoparg1.c
index 77930683ab7d..bcdf43ca7b28 100644
--- a/drivers/acpi/acpica/exoparg1.c
+++ b/drivers/acpi/acpica/exoparg1.c
@@ -484,22 +484,26 @@ acpi_status acpi_ex_opcode_1A_1T_1R(struct acpi_walk_state *walk_state)
484 484
485 case AML_TO_DECSTRING_OP: /* to_decimal_string (Data, Result) */ 485 case AML_TO_DECSTRING_OP: /* to_decimal_string (Data, Result) */
486 486
487 status = acpi_ex_convert_to_string(operand[0], &return_desc, 487 status =
488 ACPI_EXPLICIT_CONVERT_DECIMAL); 488 acpi_ex_convert_to_string(operand[0], &return_desc,
489 ACPI_EXPLICIT_CONVERT_DECIMAL);
489 if (return_desc == operand[0]) { 490 if (return_desc == operand[0]) {
490 491
491 /* No conversion performed, add ref to handle return value */ 492 /* No conversion performed, add ref to handle return value */
493
492 acpi_ut_add_reference(return_desc); 494 acpi_ut_add_reference(return_desc);
493 } 495 }
494 break; 496 break;
495 497
496 case AML_TO_HEXSTRING_OP: /* to_hex_string (Data, Result) */ 498 case AML_TO_HEXSTRING_OP: /* to_hex_string (Data, Result) */
497 499
498 status = acpi_ex_convert_to_string(operand[0], &return_desc, 500 status =
499 ACPI_EXPLICIT_CONVERT_HEX); 501 acpi_ex_convert_to_string(operand[0], &return_desc,
502 ACPI_EXPLICIT_CONVERT_HEX);
500 if (return_desc == operand[0]) { 503 if (return_desc == operand[0]) {
501 504
502 /* No conversion performed, add ref to handle return value */ 505 /* No conversion performed, add ref to handle return value */
506
503 acpi_ut_add_reference(return_desc); 507 acpi_ut_add_reference(return_desc);
504 } 508 }
505 break; 509 break;
@@ -510,17 +514,20 @@ acpi_status acpi_ex_opcode_1A_1T_1R(struct acpi_walk_state *walk_state)
510 if (return_desc == operand[0]) { 514 if (return_desc == operand[0]) {
511 515
512 /* No conversion performed, add ref to handle return value */ 516 /* No conversion performed, add ref to handle return value */
517
513 acpi_ut_add_reference(return_desc); 518 acpi_ut_add_reference(return_desc);
514 } 519 }
515 break; 520 break;
516 521
517 case AML_TO_INTEGER_OP: /* to_integer (Data, Result) */ 522 case AML_TO_INTEGER_OP: /* to_integer (Data, Result) */
518 523
519 status = acpi_ex_convert_to_integer(operand[0], &return_desc, 524 status =
520 ACPI_ANY_BASE); 525 acpi_ex_convert_to_integer(operand[0], &return_desc,
526 ACPI_ANY_BASE);
521 if (return_desc == operand[0]) { 527 if (return_desc == operand[0]) {
522 528
523 /* No conversion performed, add ref to handle return value */ 529 /* No conversion performed, add ref to handle return value */
530
524 acpi_ut_add_reference(return_desc); 531 acpi_ut_add_reference(return_desc);
525 } 532 }
526 break; 533 break;
@@ -713,9 +720,9 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
713 720
714 /* Get the base object */ 721 /* Get the base object */
715 722
716 status = acpi_ex_resolve_multiple(walk_state, 723 status =
717 operand[0], &type, 724 acpi_ex_resolve_multiple(walk_state, operand[0], &type,
718 &temp_desc); 725 &temp_desc);
719 if (ACPI_FAILURE(status)) { 726 if (ACPI_FAILURE(status)) {
720 goto cleanup; 727 goto cleanup;
721 } 728 }
@@ -759,8 +766,10 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
759 default: 766 default:
760 767
761 ACPI_ERROR((AE_INFO, 768 ACPI_ERROR((AE_INFO,
762 "Operand must be Buffer/Integer/String/Package - found type %s", 769 "Operand must be Buffer/Integer/String/Package"
770 " - found type %s",
763 acpi_ut_get_type_name(type))); 771 acpi_ut_get_type_name(type)));
772
764 status = AE_AML_OPERAND_TYPE; 773 status = AE_AML_OPERAND_TYPE;
765 goto cleanup; 774 goto cleanup;
766 } 775 }
@@ -981,6 +990,7 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
981 "Unknown Index TargetType 0x%X in reference object %p", 990 "Unknown Index TargetType 0x%X in reference object %p",
982 operand[0]->reference. 991 operand[0]->reference.
983 target_type, operand[0])); 992 target_type, operand[0]));
993
984 status = AE_AML_OPERAND_TYPE; 994 status = AE_AML_OPERAND_TYPE;
985 goto cleanup; 995 goto cleanup;
986 } 996 }
@@ -1050,6 +1060,7 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
1050 1060
1051 ACPI_ERROR((AE_INFO, "Unknown AML opcode 0x%X", 1061 ACPI_ERROR((AE_INFO, "Unknown AML opcode 0x%X",
1052 walk_state->opcode)); 1062 walk_state->opcode));
1063
1053 status = AE_AML_BAD_OPCODE; 1064 status = AE_AML_BAD_OPCODE;
1054 goto cleanup; 1065 goto cleanup;
1055 } 1066 }
diff --git a/drivers/acpi/acpica/exoparg2.c b/drivers/acpi/acpica/exoparg2.c
index b8944ebb1081..6dad2ca1c8c9 100644
--- a/drivers/acpi/acpica/exoparg2.c
+++ b/drivers/acpi/acpica/exoparg2.c
@@ -199,6 +199,7 @@ acpi_status acpi_ex_opcode_2A_2T_1R(struct acpi_walk_state *walk_state)
199 199
200 ACPI_ERROR((AE_INFO, "Unknown AML opcode 0x%X", 200 ACPI_ERROR((AE_INFO, "Unknown AML opcode 0x%X",
201 walk_state->opcode)); 201 walk_state->opcode));
202
202 status = AE_AML_BAD_OPCODE; 203 status = AE_AML_BAD_OPCODE;
203 goto cleanup; 204 goto cleanup;
204 } 205 }
@@ -299,8 +300,9 @@ acpi_status acpi_ex_opcode_2A_1T_1R(struct acpi_walk_state *walk_state)
299 300
300 case AML_CONCAT_OP: /* Concatenate (Data1, Data2, Result) */ 301 case AML_CONCAT_OP: /* Concatenate (Data1, Data2, Result) */
301 302
302 status = acpi_ex_do_concatenate(operand[0], operand[1], 303 status =
303 &return_desc, walk_state); 304 acpi_ex_do_concatenate(operand[0], operand[1], &return_desc,
305 walk_state);
304 break; 306 break;
305 307
306 case AML_TO_STRING_OP: /* to_string (Buffer, Length, Result) (ACPI 2.0) */ 308 case AML_TO_STRING_OP: /* to_string (Buffer, Length, Result) (ACPI 2.0) */
@@ -345,8 +347,9 @@ acpi_status acpi_ex_opcode_2A_1T_1R(struct acpi_walk_state *walk_state)
345 347
346 /* concatenate_res_template (Buffer, Buffer, Result) (ACPI 2.0) */ 348 /* concatenate_res_template (Buffer, Buffer, Result) (ACPI 2.0) */
347 349
348 status = acpi_ex_concat_template(operand[0], operand[1], 350 status =
349 &return_desc, walk_state); 351 acpi_ex_concat_template(operand[0], operand[1],
352 &return_desc, walk_state);
350 break; 353 break;
351 354
352 case AML_INDEX_OP: /* Index (Source Index Result) */ 355 case AML_INDEX_OP: /* Index (Source Index Result) */
@@ -553,6 +556,7 @@ acpi_status acpi_ex_opcode_2A_0T_1R(struct acpi_walk_state *walk_state)
553 556
554 ACPI_ERROR((AE_INFO, "Unknown AML opcode 0x%X", 557 ACPI_ERROR((AE_INFO, "Unknown AML opcode 0x%X",
555 walk_state->opcode)); 558 walk_state->opcode));
559
556 status = AE_AML_BAD_OPCODE; 560 status = AE_AML_BAD_OPCODE;
557 goto cleanup; 561 goto cleanup;
558 } 562 }
diff --git a/drivers/acpi/acpica/exoparg3.c b/drivers/acpi/acpica/exoparg3.c
index 351b82a5953e..27fb0172fca2 100644
--- a/drivers/acpi/acpica/exoparg3.c
+++ b/drivers/acpi/acpica/exoparg3.c
@@ -95,7 +95,8 @@ acpi_status acpi_ex_opcode_3A_0T_0R(struct acpi_walk_state *walk_state)
95 case AML_FATAL_OP: /* Fatal (fatal_type fatal_code fatal_arg) */ 95 case AML_FATAL_OP: /* Fatal (fatal_type fatal_code fatal_arg) */
96 96
97 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 97 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
98 "FatalOp: Type %X Code %X Arg %X <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n", 98 "FatalOp: Type %X Code %X Arg %X "
99 "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n",
99 (u32)operand[0]->integer.value, 100 (u32)operand[0]->integer.value,
100 (u32)operand[1]->integer.value, 101 (u32)operand[1]->integer.value,
101 (u32)operand[2]->integer.value)); 102 (u32)operand[2]->integer.value));
@@ -131,6 +132,7 @@ acpi_status acpi_ex_opcode_3A_0T_0R(struct acpi_walk_state *walk_state)
131 132
132 ACPI_ERROR((AE_INFO, "Unknown AML opcode 0x%X", 133 ACPI_ERROR((AE_INFO, "Unknown AML opcode 0x%X",
133 walk_state->opcode)); 134 walk_state->opcode));
135
134 status = AE_AML_BAD_OPCODE; 136 status = AE_AML_BAD_OPCODE;
135 goto cleanup; 137 goto cleanup;
136 } 138 }
@@ -193,7 +195,8 @@ acpi_status acpi_ex_opcode_3A_1T_1R(struct acpi_walk_state *walk_state)
193 /* Truncate request if larger than the actual String/Buffer */ 195 /* Truncate request if larger than the actual String/Buffer */
194 196
195 else if ((index + length) > operand[0]->string.length) { 197 else if ((index + length) > operand[0]->string.length) {
196 length = (acpi_size) operand[0]->string.length - 198 length =
199 (acpi_size) operand[0]->string.length -
197 (acpi_size) index; 200 (acpi_size) index;
198 } 201 }
199 202
@@ -237,8 +240,8 @@ acpi_status acpi_ex_opcode_3A_1T_1R(struct acpi_walk_state *walk_state)
237 240
238 /* We have a buffer, copy the portion requested */ 241 /* We have a buffer, copy the portion requested */
239 242
240 memcpy(buffer, operand[0]->string.pointer + index, 243 memcpy(buffer,
241 length); 244 operand[0]->string.pointer + index, length);
242 } 245 }
243 246
244 /* Set the length of the new String/Buffer */ 247 /* Set the length of the new String/Buffer */
@@ -255,6 +258,7 @@ acpi_status acpi_ex_opcode_3A_1T_1R(struct acpi_walk_state *walk_state)
255 258
256 ACPI_ERROR((AE_INFO, "Unknown AML opcode 0x%X", 259 ACPI_ERROR((AE_INFO, "Unknown AML opcode 0x%X",
257 walk_state->opcode)); 260 walk_state->opcode));
261
258 status = AE_AML_BAD_OPCODE; 262 status = AE_AML_BAD_OPCODE;
259 goto cleanup; 263 goto cleanup;
260 } 264 }
@@ -270,12 +274,11 @@ cleanup:
270 if (ACPI_FAILURE(status) || walk_state->result_obj) { 274 if (ACPI_FAILURE(status) || walk_state->result_obj) {
271 acpi_ut_remove_reference(return_desc); 275 acpi_ut_remove_reference(return_desc);
272 walk_state->result_obj = NULL; 276 walk_state->result_obj = NULL;
273 } 277 } else {
278 /* Set the return object and exit */
274 279
275 /* Set the return object and exit */
276
277 else {
278 walk_state->result_obj = return_desc; 280 walk_state->result_obj = return_desc;
279 } 281 }
282
280 return_ACPI_STATUS(status); 283 return_ACPI_STATUS(status);
281} 284}
diff --git a/drivers/acpi/acpica/exoparg6.c b/drivers/acpi/acpica/exoparg6.c
index c930edda3f65..7efc9f47ffb9 100644
--- a/drivers/acpi/acpica/exoparg6.c
+++ b/drivers/acpi/acpica/exoparg6.c
@@ -310,6 +310,7 @@ acpi_status acpi_ex_opcode_6A_0T_1R(struct acpi_walk_state * walk_state)
310 310
311 ACPI_ERROR((AE_INFO, "Unknown AML opcode 0x%X", 311 ACPI_ERROR((AE_INFO, "Unknown AML opcode 0x%X",
312 walk_state->opcode)); 312 walk_state->opcode));
313
313 status = AE_AML_BAD_OPCODE; 314 status = AE_AML_BAD_OPCODE;
314 goto cleanup; 315 goto cleanup;
315 } 316 }
diff --git a/drivers/acpi/acpica/exprep.c b/drivers/acpi/acpica/exprep.c
index 4c2836dc825b..1f111cc94c00 100644
--- a/drivers/acpi/acpica/exprep.c
+++ b/drivers/acpi/acpica/exprep.c
@@ -1,6 +1,6 @@
1/****************************************************************************** 1/******************************************************************************
2 * 2 *
3 * Module Name: exprep - ACPI AML (p-code) execution - field prep utilities 3 * Module Name: exprep - ACPI AML field prep utilities
4 * 4 *
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
@@ -103,8 +103,10 @@ acpi_ex_generate_access(u32 field_bit_offset,
103 /* Round Field start offset and length to "minimal" byte boundaries */ 103 /* Round Field start offset and length to "minimal" byte boundaries */
104 104
105 field_byte_offset = ACPI_DIV_8(ACPI_ROUND_DOWN(field_bit_offset, 8)); 105 field_byte_offset = ACPI_DIV_8(ACPI_ROUND_DOWN(field_bit_offset, 8));
106 field_byte_end_offset = ACPI_DIV_8(ACPI_ROUND_UP(field_bit_length + 106
107 field_bit_offset, 8)); 107 field_byte_end_offset =
108 ACPI_DIV_8(ACPI_ROUND_UP(field_bit_length + field_bit_offset, 8));
109
108 field_byte_length = field_byte_end_offset - field_byte_offset; 110 field_byte_length = field_byte_end_offset - field_byte_offset;
109 111
110 ACPI_DEBUG_PRINT((ACPI_DB_BFIELD, 112 ACPI_DEBUG_PRINT((ACPI_DB_BFIELD,
@@ -159,7 +161,8 @@ acpi_ex_generate_access(u32 field_bit_offset,
159 161
160 if (accesses <= 1) { 162 if (accesses <= 1) {
161 ACPI_DEBUG_PRINT((ACPI_DB_BFIELD, 163 ACPI_DEBUG_PRINT((ACPI_DB_BFIELD,
162 "Entire field can be accessed with one operation of size %u\n", 164 "Entire field can be accessed "
165 "with one operation of size %u\n",
163 access_byte_width)); 166 access_byte_width));
164 return_VALUE(access_byte_width); 167 return_VALUE(access_byte_width);
165 } 168 }
@@ -202,6 +205,7 @@ acpi_ex_generate_access(u32 field_bit_offset,
202 */ 205 */
203 ACPI_DEBUG_PRINT((ACPI_DB_BFIELD, 206 ACPI_DEBUG_PRINT((ACPI_DB_BFIELD,
204 "Cannot access field in one operation, using width 8\n")); 207 "Cannot access field in one operation, using width 8\n"));
208
205 return_VALUE(8); 209 return_VALUE(8);
206} 210}
207#endif /* ACPI_UNDER_DEVELOPMENT */ 211#endif /* ACPI_UNDER_DEVELOPMENT */
@@ -281,6 +285,7 @@ acpi_ex_decode_field_access(union acpi_operand_object *obj_desc,
281 /* Invalid field access type */ 285 /* Invalid field access type */
282 286
283 ACPI_ERROR((AE_INFO, "Unknown field access type 0x%X", access)); 287 ACPI_ERROR((AE_INFO, "Unknown field access type 0x%X", access));
288
284 return_UINT32(0); 289 return_UINT32(0);
285 } 290 }
286 291
@@ -354,8 +359,8 @@ acpi_ex_prep_common_field_object(union acpi_operand_object *obj_desc,
354 * For all other access types (Byte, Word, Dword, Qword), the Bitwidth is 359 * For all other access types (Byte, Word, Dword, Qword), the Bitwidth is
355 * the same (equivalent) as the byte_alignment. 360 * the same (equivalent) as the byte_alignment.
356 */ 361 */
357 access_bit_width = acpi_ex_decode_field_access(obj_desc, field_flags, 362 access_bit_width =
358 &byte_alignment); 363 acpi_ex_decode_field_access(obj_desc, field_flags, &byte_alignment);
359 if (!access_bit_width) { 364 if (!access_bit_width) {
360 return_ACPI_STATUS(AE_AML_OPERAND_VALUE); 365 return_ACPI_STATUS(AE_AML_OPERAND_VALUE);
361 } 366 }
@@ -595,7 +600,8 @@ acpi_status acpi_ex_prep_field_value(struct acpi_create_field_info *info)
595 access_byte_width); 600 access_byte_width);
596 601
597 ACPI_DEBUG_PRINT((ACPI_DB_BFIELD, 602 ACPI_DEBUG_PRINT((ACPI_DB_BFIELD,
598 "IndexField: BitOff %X, Off %X, Value %X, Gran %X, Index %p, Data %p\n", 603 "IndexField: BitOff %X, Off %X, Value %X, "
604 "Gran %X, Index %p, Data %p\n",
599 obj_desc->index_field.start_field_bit_offset, 605 obj_desc->index_field.start_field_bit_offset,
600 obj_desc->index_field.base_byte_offset, 606 obj_desc->index_field.base_byte_offset,
601 obj_desc->index_field.value, 607 obj_desc->index_field.value,
@@ -615,8 +621,9 @@ acpi_status acpi_ex_prep_field_value(struct acpi_create_field_info *info)
615 * Store the constructed descriptor (obj_desc) into the parent Node, 621 * Store the constructed descriptor (obj_desc) into the parent Node,
616 * preserving the current type of that named_obj. 622 * preserving the current type of that named_obj.
617 */ 623 */
618 status = acpi_ns_attach_object(info->field_node, obj_desc, 624 status =
619 acpi_ns_get_type(info->field_node)); 625 acpi_ns_attach_object(info->field_node, obj_desc,
626 acpi_ns_get_type(info->field_node));
620 627
621 ACPI_DEBUG_PRINT((ACPI_DB_BFIELD, 628 ACPI_DEBUG_PRINT((ACPI_DB_BFIELD,
622 "Set NamedObj %p [%4.4s], ObjDesc %p\n", 629 "Set NamedObj %p [%4.4s], ObjDesc %p\n",
diff --git a/drivers/acpi/acpica/exregion.c b/drivers/acpi/acpica/exregion.c
index b4a5e44c00dd..1851a307544a 100644
--- a/drivers/acpi/acpica/exregion.c
+++ b/drivers/acpi/acpica/exregion.c
@@ -392,7 +392,8 @@ acpi_ex_pci_config_space_handler(u32 function,
392 pci_register = (u16) (u32) address; 392 pci_register = (u16) (u32) address;
393 393
394 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 394 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
395 "Pci-Config %u (%u) Seg(%04x) Bus(%04x) Dev(%04x) Func(%04x) Reg(%04x)\n", 395 "Pci-Config %u (%u) Seg(%04x) Bus(%04x) "
396 "Dev(%04x) Func(%04x) Reg(%04x)\n",
396 function, bit_width, pci_id->segment, pci_id->bus, 397 function, bit_width, pci_id->segment, pci_id->bus,
397 pci_id->device, pci_id->function, pci_register)); 398 pci_id->device, pci_id->function, pci_register));
398 399
@@ -400,14 +401,16 @@ acpi_ex_pci_config_space_handler(u32 function,
400 case ACPI_READ: 401 case ACPI_READ:
401 402
402 *value = 0; 403 *value = 0;
403 status = acpi_os_read_pci_configuration(pci_id, pci_register, 404 status =
404 value, bit_width); 405 acpi_os_read_pci_configuration(pci_id, pci_register, value,
406 bit_width);
405 break; 407 break;
406 408
407 case ACPI_WRITE: 409 case ACPI_WRITE:
408 410
409 status = acpi_os_write_pci_configuration(pci_id, pci_register, 411 status =
410 *value, bit_width); 412 acpi_os_write_pci_configuration(pci_id, pci_register,
413 *value, bit_width);
411 break; 414 break;
412 415
413 default: 416 default:
diff --git a/drivers/acpi/acpica/exresnte.c b/drivers/acpi/acpica/exresnte.c
index 1b372ef69308..6793dcc8a946 100644
--- a/drivers/acpi/acpica/exresnte.c
+++ b/drivers/acpi/acpica/exresnte.c
@@ -112,7 +112,7 @@ acpi_ex_resolve_node_to_value(struct acpi_namespace_node **object_ptr,
112 112
113 /* 113 /*
114 * Several object types require no further processing: 114 * Several object types require no further processing:
115 * 1) Device/Thermal objects don't have a "real" subobject, return the Node 115 * 1) Device/Thermal objects don't have a "real" subobject, return Node
116 * 2) Method locals and arguments have a pseudo-Node 116 * 2) Method locals and arguments have a pseudo-Node
117 * 3) 10/2007: Added method type to assist with Package construction. 117 * 3) 10/2007: Added method type to assist with Package construction.
118 */ 118 */
diff --git a/drivers/acpi/acpica/exresolv.c b/drivers/acpi/acpica/exresolv.c
index a1afe1a1e7c2..7f9260b129fc 100644
--- a/drivers/acpi/acpica/exresolv.c
+++ b/drivers/acpi/acpica/exresolv.c
@@ -217,7 +217,8 @@ acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr,
217 * the package, can't dereference it 217 * the package, can't dereference it
218 */ 218 */
219 ACPI_ERROR((AE_INFO, 219 ACPI_ERROR((AE_INFO,
220 "Attempt to dereference an Index to NULL package element Idx=%p", 220 "Attempt to dereference an Index to "
221 "NULL package element Idx=%p",
221 stack_desc)); 222 stack_desc));
222 status = AE_AML_UNINITIALIZED_ELEMENT; 223 status = AE_AML_UNINITIALIZED_ELEMENT;
223 } 224 }
@@ -361,10 +362,9 @@ acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state,
361 362
362 if (type == ACPI_TYPE_LOCAL_ALIAS) { 363 if (type == ACPI_TYPE_LOCAL_ALIAS) {
363 type = ((struct acpi_namespace_node *)obj_desc)->type; 364 type = ((struct acpi_namespace_node *)obj_desc)->type;
364 obj_desc = 365 obj_desc = acpi_ns_get_attached_object((struct
365 acpi_ns_get_attached_object((struct 366 acpi_namespace_node
366 acpi_namespace_node *) 367 *)obj_desc);
367 obj_desc);
368 } 368 }
369 369
370 if (!obj_desc) { 370 if (!obj_desc) {
diff --git a/drivers/acpi/acpica/exresop.c b/drivers/acpi/acpica/exresop.c
index 424442d50b5e..861453e58555 100644
--- a/drivers/acpi/acpica/exresop.c
+++ b/drivers/acpi/acpica/exresop.c
@@ -90,8 +90,8 @@ acpi_ex_check_object_type(acpi_object_type type_needed,
90 * specification, a store to a constant is a noop.) 90 * specification, a store to a constant is a noop.)
91 */ 91 */
92 if ((this_type == ACPI_TYPE_INTEGER) && 92 if ((this_type == ACPI_TYPE_INTEGER) &&
93 (((union acpi_operand_object *)object)->common. 93 (((union acpi_operand_object *)object)->common.flags &
94 flags & AOPOBJ_AML_CONSTANT)) { 94 AOPOBJ_AML_CONSTANT)) {
95 return (AE_OK); 95 return (AE_OK);
96 } 96 }
97 } 97 }
@@ -196,10 +196,10 @@ acpi_ex_resolve_operands(u16 opcode,
196 * thus, the attached object is always the aliased namespace node 196 * thus, the attached object is always the aliased namespace node
197 */ 197 */
198 if (object_type == ACPI_TYPE_LOCAL_ALIAS) { 198 if (object_type == ACPI_TYPE_LOCAL_ALIAS) {
199 obj_desc = 199 obj_desc = acpi_ns_get_attached_object((struct
200 acpi_ns_get_attached_object((struct 200 acpi_namespace_node
201 acpi_namespace_node 201 *)
202 *)obj_desc); 202 obj_desc);
203 *stack_ptr = obj_desc; 203 *stack_ptr = obj_desc;
204 object_type = 204 object_type =
205 ((struct acpi_namespace_node *)obj_desc)-> 205 ((struct acpi_namespace_node *)obj_desc)->
@@ -285,8 +285,8 @@ acpi_ex_resolve_operands(u16 opcode,
285 case ARGI_REF_OR_STRING: /* Can be a String or Reference */ 285 case ARGI_REF_OR_STRING: /* Can be a String or Reference */
286 286
287 if ((ACPI_GET_DESCRIPTOR_TYPE(obj_desc) == 287 if ((ACPI_GET_DESCRIPTOR_TYPE(obj_desc) ==
288 ACPI_DESC_TYPE_OPERAND) 288 ACPI_DESC_TYPE_OPERAND) &&
289 && (obj_desc->common.type == ACPI_TYPE_STRING)) { 289 (obj_desc->common.type == ACPI_TYPE_STRING)) {
290 /* 290 /*
291 * String found - the string references a named object and 291 * String found - the string references a named object and
292 * must be resolved to a node 292 * must be resolved to a node
@@ -465,8 +465,9 @@ acpi_ex_resolve_operands(u16 opcode,
465 * But we can implicitly convert from a BUFFER or INTEGER 465 * But we can implicitly convert from a BUFFER or INTEGER
466 * aka - "Implicit Source Operand Conversion" 466 * aka - "Implicit Source Operand Conversion"
467 */ 467 */
468 status = acpi_ex_convert_to_string(obj_desc, stack_ptr, 468 status =
469 ACPI_IMPLICIT_CONVERT_HEX); 469 acpi_ex_convert_to_string(obj_desc, stack_ptr,
470 ACPI_IMPLICIT_CONVERT_HEX);
470 if (ACPI_FAILURE(status)) { 471 if (ACPI_FAILURE(status)) {
471 if (status == AE_TYPE) { 472 if (status == AE_TYPE) {
472 ACPI_ERROR((AE_INFO, 473 ACPI_ERROR((AE_INFO,
@@ -597,8 +598,10 @@ acpi_ex_resolve_operands(u16 opcode,
597 598
598 case ARGI_REGION_OR_BUFFER: /* Used by Load() only */ 599 case ARGI_REGION_OR_BUFFER: /* Used by Load() only */
599 600
600 /* Need an operand of type REGION or a BUFFER (which could be a resolved region field) */ 601 /*
601 602 * Need an operand of type REGION or a BUFFER
603 * (which could be a resolved region field)
604 */
602 switch (obj_desc->common.type) { 605 switch (obj_desc->common.type) {
603 case ACPI_TYPE_BUFFER: 606 case ACPI_TYPE_BUFFER:
604 case ACPI_TYPE_REGION: 607 case ACPI_TYPE_REGION:
@@ -640,9 +643,9 @@ acpi_ex_resolve_operands(u16 opcode,
640 643
641 if (acpi_gbl_enable_interpreter_slack) { 644 if (acpi_gbl_enable_interpreter_slack) {
642 /* 645 /*
643 * Enable original behavior of Store(), allowing any and all 646 * Enable original behavior of Store(), allowing any
644 * objects as the source operand. The ACPI spec does not 647 * and all objects as the source operand. The ACPI
645 * allow this, however. 648 * spec does not allow this, however.
646 */ 649 */
647 break; 650 break;
648 } 651 }
@@ -655,7 +658,8 @@ acpi_ex_resolve_operands(u16 opcode,
655 } 658 }
656 659
657 ACPI_ERROR((AE_INFO, 660 ACPI_ERROR((AE_INFO,
658 "Needed Integer/Buffer/String/Package/Ref/Ddb], found [%s] %p", 661 "Needed Integer/Buffer/String/Package/Ref/Ddb]"
662 ", found [%s] %p",
659 acpi_ut_get_object_type_name 663 acpi_ut_get_object_type_name
660 (obj_desc), obj_desc)); 664 (obj_desc), obj_desc));
661 665
@@ -678,9 +682,10 @@ acpi_ex_resolve_operands(u16 opcode,
678 * Make sure that the original object was resolved to the 682 * Make sure that the original object was resolved to the
679 * required object type (Simple cases only). 683 * required object type (Simple cases only).
680 */ 684 */
681 status = acpi_ex_check_object_type(type_needed, 685 status =
682 (*stack_ptr)->common.type, 686 acpi_ex_check_object_type(type_needed,
683 *stack_ptr); 687 (*stack_ptr)->common.type,
688 *stack_ptr);
684 if (ACPI_FAILURE(status)) { 689 if (ACPI_FAILURE(status)) {
685 return_ACPI_STATUS(status); 690 return_ACPI_STATUS(status);
686 } 691 }
diff --git a/drivers/acpi/acpica/exstore.c b/drivers/acpi/acpica/exstore.c
index c076e9100d66..d3afbcbe7886 100644
--- a/drivers/acpi/acpica/exstore.c
+++ b/drivers/acpi/acpica/exstore.c
@@ -467,7 +467,8 @@ acpi_ex_store_object_to_node(union acpi_operand_object *source_desc,
467 case ACPI_TYPE_THERMAL: 467 case ACPI_TYPE_THERMAL:
468 468
469 ACPI_ERROR((AE_INFO, 469 ACPI_ERROR((AE_INFO,
470 "Target must be [Buffer/Integer/String/Reference], found [%s] (%4.4s)", 470 "Target must be [Buffer/Integer/String/Reference]"
471 ", found [%s] (%4.4s)",
471 acpi_ut_get_type_name(node->type), 472 acpi_ut_get_type_name(node->type),
472 node->name.ascii)); 473 node->name.ascii));
473 474
@@ -504,8 +505,9 @@ acpi_ex_store_object_to_node(union acpi_operand_object *source_desc,
504 * an implicit conversion, as per the ACPI specification. 505 * an implicit conversion, as per the ACPI specification.
505 * A direct store is performed instead. 506 * A direct store is performed instead.
506 */ 507 */
507 status = acpi_ex_store_direct_to_node(source_desc, node, 508 status =
508 walk_state); 509 acpi_ex_store_direct_to_node(source_desc, node,
510 walk_state);
509 break; 511 break;
510 } 512 }
511 513
@@ -528,8 +530,9 @@ acpi_ex_store_object_to_node(union acpi_operand_object *source_desc,
528 * store has been performed such that the node/object type 530 * store has been performed such that the node/object type
529 * has been changed. 531 * has been changed.
530 */ 532 */
531 status = acpi_ns_attach_object(node, new_desc, 533 status =
532 new_desc->common.type); 534 acpi_ns_attach_object(node, new_desc,
535 new_desc->common.type);
533 536
534 ACPI_DEBUG_PRINT((ACPI_DB_EXEC, 537 ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
535 "Store type [%s] into [%s] via Convert/Attach\n", 538 "Store type [%s] into [%s] via Convert/Attach\n",
@@ -563,8 +566,8 @@ acpi_ex_store_object_to_node(union acpi_operand_object *source_desc,
563 * operator. (Note, for this default case, all normal 566 * operator. (Note, for this default case, all normal
564 * Store/Target operations exited above with an error). 567 * Store/Target operations exited above with an error).
565 */ 568 */
566 status = acpi_ex_store_direct_to_node(source_desc, node, 569 status =
567 walk_state); 570 acpi_ex_store_direct_to_node(source_desc, node, walk_state);
568 break; 571 break;
569 } 572 }
570 573
diff --git a/drivers/acpi/acpica/exstorob.c b/drivers/acpi/acpica/exstorob.c
index e1d4f4d51b97..ad3bc92af2e6 100644
--- a/drivers/acpi/acpica/exstorob.c
+++ b/drivers/acpi/acpica/exstorob.c
@@ -1,6 +1,6 @@
1/****************************************************************************** 1/******************************************************************************
2 * 2 *
3 * Module Name: exstorob - AML Interpreter object store support, store to object 3 * Module Name: exstorob - AML object store support, store to object
4 * 4 *
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
@@ -203,8 +203,9 @@ acpi_ex_store_string_to_string(union acpi_operand_object *source_desc,
203 ACPI_FREE(target_desc->string.pointer); 203 ACPI_FREE(target_desc->string.pointer);
204 } 204 }
205 205
206 target_desc->string.pointer = ACPI_ALLOCATE_ZEROED((acpi_size) 206 target_desc->string.pointer =
207 length + 1); 207 ACPI_ALLOCATE_ZEROED((acpi_size) length + 1);
208
208 if (!target_desc->string.pointer) { 209 if (!target_desc->string.pointer) {
209 return_ACPI_STATUS(AE_NO_MEMORY); 210 return_ACPI_STATUS(AE_NO_MEMORY);
210 } 211 }
diff --git a/drivers/acpi/acpica/exsystem.c b/drivers/acpi/acpica/exsystem.c
index 05450656fe3d..7c91c1f799a5 100644
--- a/drivers/acpi/acpica/exsystem.c
+++ b/drivers/acpi/acpica/exsystem.c
@@ -78,7 +78,6 @@ acpi_status acpi_ex_system_wait_semaphore(acpi_semaphore semaphore, u16 timeout)
78 /* We must wait, so unlock the interpreter */ 78 /* We must wait, so unlock the interpreter */
79 79
80 acpi_ex_exit_interpreter(); 80 acpi_ex_exit_interpreter();
81
82 status = acpi_os_wait_semaphore(semaphore, 1, timeout); 81 status = acpi_os_wait_semaphore(semaphore, 1, timeout);
83 82
84 ACPI_DEBUG_PRINT((ACPI_DB_EXEC, 83 ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
@@ -124,7 +123,6 @@ acpi_status acpi_ex_system_wait_mutex(acpi_mutex mutex, u16 timeout)
124 /* We must wait, so unlock the interpreter */ 123 /* We must wait, so unlock the interpreter */
125 124
126 acpi_ex_exit_interpreter(); 125 acpi_ex_exit_interpreter();
127
128 status = acpi_os_acquire_mutex(mutex, timeout); 126 status = acpi_os_acquire_mutex(mutex, timeout);
129 127
130 ACPI_DEBUG_PRINT((ACPI_DB_EXEC, 128 ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
@@ -169,8 +167,8 @@ acpi_status acpi_ex_system_do_stall(u32 how_long)
169 * (ACPI specifies 100 usec as max, but this gives some slack in 167 * (ACPI specifies 100 usec as max, but this gives some slack in
170 * order to support existing BIOSs) 168 * order to support existing BIOSs)
171 */ 169 */
172 ACPI_ERROR((AE_INFO, "Time parameter is too large (%u)", 170 ACPI_ERROR((AE_INFO,
173 how_long)); 171 "Time parameter is too large (%u)", how_long));
174 status = AE_AML_OPERAND_VALUE; 172 status = AE_AML_OPERAND_VALUE;
175 } else { 173 } else {
176 acpi_os_stall(how_long); 174 acpi_os_stall(how_long);
diff --git a/drivers/acpi/acpica/exutils.c b/drivers/acpi/acpica/exutils.c
index 30c3f464fda5..8ae7634bd7d2 100644
--- a/drivers/acpi/acpica/exutils.c
+++ b/drivers/acpi/acpica/exutils.c
@@ -167,8 +167,8 @@ u8 acpi_ex_truncate_for32bit_table(union acpi_operand_object *obj_desc)
167 if ((acpi_gbl_integer_byte_width == 4) && 167 if ((acpi_gbl_integer_byte_width == 4) &&
168 (obj_desc->integer.value > (u64)ACPI_UINT32_MAX)) { 168 (obj_desc->integer.value > (u64)ACPI_UINT32_MAX)) {
169 /* 169 /*
170 * We are executing in a 32-bit ACPI table. 170 * We are executing in a 32-bit ACPI table. Truncate
171 * Truncate the value to 32 bits by zeroing out the upper 32-bit field 171 * the value to 32 bits by zeroing out the upper 32-bit field
172 */ 172 */
173 obj_desc->integer.value &= (u64)ACPI_UINT32_MAX; 173 obj_desc->integer.value &= (u64)ACPI_UINT32_MAX;
174 return (TRUE); 174 return (TRUE);
@@ -323,7 +323,8 @@ void acpi_ex_eisa_id_to_string(char *out_string, u64 compressed_id)
323 323
324 if (compressed_id > ACPI_UINT32_MAX) { 324 if (compressed_id > ACPI_UINT32_MAX) {
325 ACPI_WARNING((AE_INFO, 325 ACPI_WARNING((AE_INFO,
326 "Expected EISAID is larger than 32 bits: 0x%8.8X%8.8X, truncating", 326 "Expected EISAID is larger than 32 bits: "
327 "0x%8.8X%8.8X, truncating",
327 ACPI_FORMAT_UINT64(compressed_id))); 328 ACPI_FORMAT_UINT64(compressed_id)));
328 } 329 }
329 330
diff --git a/drivers/acpi/acpica/hwesleep.c b/drivers/acpi/acpica/hwesleep.c
index e5599f610808..d0319a228ef7 100644
--- a/drivers/acpi/acpica/hwesleep.c
+++ b/drivers/acpi/acpica/hwesleep.c
@@ -117,8 +117,8 @@ acpi_status acpi_hw_extended_sleep(u8 sleep_state)
117 117
118 /* Clear wake status (WAK_STS) */ 118 /* Clear wake status (WAK_STS) */
119 119
120 status = 120 status = acpi_write((u64)ACPI_X_WAKE_STATUS,
121 acpi_write((u64)ACPI_X_WAKE_STATUS, &acpi_gbl_FADT.sleep_status); 121 &acpi_gbl_FADT.sleep_status);
122 if (ACPI_FAILURE(status)) { 122 if (ACPI_FAILURE(status)) {
123 return_ACPI_STATUS(status); 123 return_ACPI_STATUS(status);
124 } 124 }
diff --git a/drivers/acpi/acpica/hwgpe.c b/drivers/acpi/acpica/hwgpe.c
index da4a92385dad..8272f966382a 100644
--- a/drivers/acpi/acpica/hwgpe.c
+++ b/drivers/acpi/acpica/hwgpe.c
@@ -187,9 +187,8 @@ acpi_status acpi_hw_clear_gpe(struct acpi_gpe_event_info * gpe_event_info)
187 */ 187 */
188 register_bit = acpi_hw_get_gpe_register_bit(gpe_event_info); 188 register_bit = acpi_hw_get_gpe_register_bit(gpe_event_info);
189 189
190 status = acpi_hw_write(register_bit, 190 status =
191 &gpe_register_info->status_address); 191 acpi_hw_write(register_bit, &gpe_register_info->status_address);
192
193 return (status); 192 return (status);
194} 193}
195 194
@@ -297,8 +296,8 @@ acpi_hw_gpe_enable_write(u8 enable_mask,
297 acpi_status status; 296 acpi_status status;
298 297
299 gpe_register_info->enable_mask = enable_mask; 298 gpe_register_info->enable_mask = enable_mask;
300 status = acpi_hw_write(enable_mask, &gpe_register_info->enable_address);
301 299
300 status = acpi_hw_write(enable_mask, &gpe_register_info->enable_address);
302 return (status); 301 return (status);
303} 302}
304 303
diff --git a/drivers/acpi/acpica/hwsleep.c b/drivers/acpi/acpica/hwsleep.c
index 7d21cae6d602..ac5b7f768d4b 100644
--- a/drivers/acpi/acpica/hwsleep.c
+++ b/drivers/acpi/acpica/hwsleep.c
@@ -80,8 +80,8 @@ acpi_status acpi_hw_legacy_sleep(u8 sleep_state)
80 80
81 /* Clear wake status */ 81 /* Clear wake status */
82 82
83 status = 83 status = acpi_write_bit_register(ACPI_BITREG_WAKE_STATUS,
84 acpi_write_bit_register(ACPI_BITREG_WAKE_STATUS, ACPI_CLEAR_STATUS); 84 ACPI_CLEAR_STATUS);
85 if (ACPI_FAILURE(status)) { 85 if (ACPI_FAILURE(status)) {
86 return_ACPI_STATUS(status); 86 return_ACPI_STATUS(status);
87 } 87 }
diff --git a/drivers/acpi/acpica/hwxfsleep.c b/drivers/acpi/acpica/hwxfsleep.c
index d62a61612b3f..f8af1abb6ef1 100644
--- a/drivers/acpi/acpica/hwxfsleep.c
+++ b/drivers/acpi/acpica/hwxfsleep.c
@@ -286,6 +286,7 @@ acpi_status acpi_enter_sleep_state_s4bios(void)
286 if (ACPI_FAILURE(status)) { 286 if (ACPI_FAILURE(status)) {
287 return_ACPI_STATUS(status); 287 return_ACPI_STATUS(status);
288 } 288 }
289
289 } while (!in_value); 290 } while (!in_value);
290 291
291 return_ACPI_STATUS(AE_OK); 292 return_ACPI_STATUS(AE_OK);
diff --git a/drivers/acpi/acpica/nsconvert.c b/drivers/acpi/acpica/nsconvert.c
index da55a1c60da1..749a18902dcf 100644
--- a/drivers/acpi/acpica/nsconvert.c
+++ b/drivers/acpi/acpica/nsconvert.c
@@ -96,9 +96,9 @@ acpi_ns_convert_to_integer(union acpi_operand_object *original_object,
96 /* Extract each buffer byte to create the integer */ 96 /* Extract each buffer byte to create the integer */
97 97
98 for (i = 0; i < original_object->buffer.length; i++) { 98 for (i = 0; i < original_object->buffer.length; i++) {
99 value |= 99 value |= ((u64)
100 ((u64)original_object->buffer. 100 original_object->buffer.pointer[i] << (i *
101 pointer[i] << (i * 8)); 101 8));
102 } 102 }
103 break; 103 break;
104 104
@@ -153,10 +153,9 @@ acpi_ns_convert_to_string(union acpi_operand_object *original_object,
153 return (AE_NO_MEMORY); 153 return (AE_NO_MEMORY);
154 } 154 }
155 } else { 155 } else {
156 status = 156 status = acpi_ex_convert_to_string(original_object,
157 acpi_ex_convert_to_string(original_object, 157 &new_object,
158 &new_object, 158 ACPI_IMPLICIT_CONVERT_HEX);
159 ACPI_IMPLICIT_CONVERT_HEX);
160 if (ACPI_FAILURE(status)) { 159 if (ACPI_FAILURE(status)) {
161 return (status); 160 return (status);
162 } 161 }
@@ -244,9 +243,8 @@ acpi_ns_convert_to_buffer(union acpi_operand_object *original_object,
244 243
245 /* String-to-Buffer conversion. Simple data copy */ 244 /* String-to-Buffer conversion. Simple data copy */
246 245
247 new_object = 246 new_object = acpi_ut_create_buffer_object
248 acpi_ut_create_buffer_object(original_object->string. 247 (original_object->string.length);
249 length);
250 if (!new_object) { 248 if (!new_object) {
251 return (AE_NO_MEMORY); 249 return (AE_NO_MEMORY);
252 } 250 }
diff --git a/drivers/acpi/acpica/nsdump.c b/drivers/acpi/acpica/nsdump.c
index e0719560bc33..bc5ff358b2a7 100644
--- a/drivers/acpi/acpica/nsdump.c
+++ b/drivers/acpi/acpica/nsdump.c
@@ -539,11 +539,13 @@ acpi_ns_dump_one_object(acpi_handle obj_handle,
539 acpi_os_printf 539 acpi_os_printf
540 ("(Pointer to ACPI Object type %.2X [UNKNOWN])\n", 540 ("(Pointer to ACPI Object type %.2X [UNKNOWN])\n",
541 obj_type); 541 obj_type);
542
542 bytes_to_dump = 32; 543 bytes_to_dump = 32;
543 } else { 544 } else {
544 acpi_os_printf 545 acpi_os_printf
545 ("(Pointer to ACPI Object type %.2X [%s])\n", 546 ("(Pointer to ACPI Object type %.2X [%s])\n",
546 obj_type, acpi_ut_get_type_name(obj_type)); 547 obj_type, acpi_ut_get_type_name(obj_type));
548
547 bytes_to_dump = 549 bytes_to_dump =
548 sizeof(union acpi_operand_object); 550 sizeof(union acpi_operand_object);
549 } 551 }
@@ -573,6 +575,7 @@ acpi_ns_dump_one_object(acpi_handle obj_handle,
573 */ 575 */
574 bytes_to_dump = obj_desc->string.length; 576 bytes_to_dump = obj_desc->string.length;
575 obj_desc = (void *)obj_desc->string.pointer; 577 obj_desc = (void *)obj_desc->string.pointer;
578
576 acpi_os_printf("(Buffer/String pointer %p length %X)\n", 579 acpi_os_printf("(Buffer/String pointer %p length %X)\n",
577 obj_desc, bytes_to_dump); 580 obj_desc, bytes_to_dump);
578 ACPI_DUMP_BUFFER(obj_desc, bytes_to_dump); 581 ACPI_DUMP_BUFFER(obj_desc, bytes_to_dump);
diff --git a/drivers/acpi/acpica/nsload.c b/drivers/acpi/acpica/nsload.c
index 14ab83668207..c1069165625d 100644
--- a/drivers/acpi/acpica/nsload.c
+++ b/drivers/acpi/acpica/nsload.c
@@ -321,7 +321,6 @@ acpi_status acpi_ns_unload_namespace(acpi_handle handle)
321 /* This function does the real work */ 321 /* This function does the real work */
322 322
323 status = acpi_ns_delete_subtree(handle); 323 status = acpi_ns_delete_subtree(handle);
324
325 return_ACPI_STATUS(status); 324 return_ACPI_STATUS(status);
326} 325}
327#endif 326#endif
diff --git a/drivers/acpi/acpica/nsnames.c b/drivers/acpi/acpica/nsnames.c
index 8934b4eddb73..521031f9b6c6 100644
--- a/drivers/acpi/acpica/nsnames.c
+++ b/drivers/acpi/acpica/nsnames.c
@@ -70,7 +70,6 @@ char *acpi_ns_get_external_pathname(struct acpi_namespace_node *node)
70 ACPI_FUNCTION_TRACE_PTR(ns_get_external_pathname, node); 70 ACPI_FUNCTION_TRACE_PTR(ns_get_external_pathname, node);
71 71
72 name_buffer = acpi_ns_get_normalized_pathname(node, FALSE); 72 name_buffer = acpi_ns_get_normalized_pathname(node, FALSE);
73
74 return_PTR(name_buffer); 73 return_PTR(name_buffer);
75} 74}
76 75
@@ -93,7 +92,6 @@ acpi_size acpi_ns_get_pathname_length(struct acpi_namespace_node *node)
93 ACPI_FUNCTION_ENTRY(); 92 ACPI_FUNCTION_ENTRY();
94 93
95 size = acpi_ns_build_normalized_path(node, NULL, 0, FALSE); 94 size = acpi_ns_build_normalized_path(node, NULL, 0, FALSE);
96
97 return (size); 95 return (size);
98} 96}
99 97
@@ -217,6 +215,7 @@ acpi_ns_build_normalized_path(struct acpi_namespace_node *node,
217 ACPI_PATH_PUT8(full_path, path_size, 215 ACPI_PATH_PUT8(full_path, path_size,
218 AML_DUAL_NAME_PREFIX, length); 216 AML_DUAL_NAME_PREFIX, length);
219 } 217 }
218
220 ACPI_MOVE_32_TO_32(name, &next_node->name); 219 ACPI_MOVE_32_TO_32(name, &next_node->name);
221 do_no_trailing = no_trailing; 220 do_no_trailing = no_trailing;
222 for (i = 0; i < 4; i++) { 221 for (i = 0; i < 4; i++) {
@@ -228,8 +227,10 @@ acpi_ns_build_normalized_path(struct acpi_namespace_node *node,
228 ACPI_PATH_PUT8(full_path, path_size, c, length); 227 ACPI_PATH_PUT8(full_path, path_size, c, length);
229 } 228 }
230 } 229 }
230
231 next_node = next_node->parent; 231 next_node = next_node->parent;
232 } 232 }
233
233 ACPI_PATH_PUT8(full_path, path_size, AML_ROOT_PREFIX, length); 234 ACPI_PATH_PUT8(full_path, path_size, AML_ROOT_PREFIX, length);
234 235
235 /* Reverse the path string */ 236 /* Reverse the path string */
@@ -237,6 +238,7 @@ acpi_ns_build_normalized_path(struct acpi_namespace_node *node,
237 if (length <= path_size) { 238 if (length <= path_size) {
238 left = full_path; 239 left = full_path;
239 right = full_path + length - 1; 240 right = full_path + length - 1;
241
240 while (left < right) { 242 while (left < right) {
241 c = *left; 243 c = *left;
242 *left++ = *right; 244 *left++ = *right;
diff --git a/drivers/acpi/acpica/nsparse.c b/drivers/acpi/acpica/nsparse.c
index 3736d43b18b9..43b45a8c2fe4 100644
--- a/drivers/acpi/acpica/nsparse.c
+++ b/drivers/acpi/acpica/nsparse.c
@@ -141,8 +141,8 @@ acpi_ns_one_complete_parse(u32 pass_number,
141 141
142 /* Parse the AML */ 142 /* Parse the AML */
143 143
144 ACPI_DEBUG_PRINT((ACPI_DB_PARSE, "*PARSE* pass %u parse\n", 144 ACPI_DEBUG_PRINT((ACPI_DB_PARSE,
145 pass_number)); 145 "*PARSE* pass %u parse\n", pass_number));
146 status = acpi_ps_parse_aml(walk_state); 146 status = acpi_ps_parse_aml(walk_state);
147 147
148cleanup: 148cleanup:
@@ -181,6 +181,7 @@ acpi_ns_parse_table(u32 table_index, struct acpi_namespace_node *start_node)
181 * performs another complete parse of the AML. 181 * performs another complete parse of the AML.
182 */ 182 */
183 ACPI_DEBUG_PRINT((ACPI_DB_PARSE, "**** Start pass 1\n")); 183 ACPI_DEBUG_PRINT((ACPI_DB_PARSE, "**** Start pass 1\n"));
184
184 status = acpi_ns_one_complete_parse(ACPI_IMODE_LOAD_PASS1, 185 status = acpi_ns_one_complete_parse(ACPI_IMODE_LOAD_PASS1,
185 table_index, start_node); 186 table_index, start_node);
186 if (ACPI_FAILURE(status)) { 187 if (ACPI_FAILURE(status)) {
diff --git a/drivers/acpi/acpica/nsprepkg.c b/drivers/acpi/acpica/nsprepkg.c
index 9bb251932b45..c05a83be5c11 100644
--- a/drivers/acpi/acpica/nsprepkg.c
+++ b/drivers/acpi/acpica/nsprepkg.c
@@ -233,8 +233,9 @@ acpi_ns_check_package(struct acpi_evaluate_info *info,
233 233
234 /* First element is the (Integer) revision */ 234 /* First element is the (Integer) revision */
235 235
236 status = acpi_ns_check_object_type(info, elements, 236 status =
237 ACPI_RTYPE_INTEGER, 0); 237 acpi_ns_check_object_type(info, elements,
238 ACPI_RTYPE_INTEGER, 0);
238 if (ACPI_FAILURE(status)) { 239 if (ACPI_FAILURE(status)) {
239 return (status); 240 return (status);
240 } 241 }
@@ -252,8 +253,9 @@ acpi_ns_check_package(struct acpi_evaluate_info *info,
252 253
253 /* First element is the (Integer) count of subpackages to follow */ 254 /* First element is the (Integer) count of subpackages to follow */
254 255
255 status = acpi_ns_check_object_type(info, elements, 256 status =
256 ACPI_RTYPE_INTEGER, 0); 257 acpi_ns_check_object_type(info, elements,
258 ACPI_RTYPE_INTEGER, 0);
257 if (ACPI_FAILURE(status)) { 259 if (ACPI_FAILURE(status)) {
258 return (status); 260 return (status);
259 } 261 }
diff --git a/drivers/acpi/acpica/nsrepair.c b/drivers/acpi/acpica/nsrepair.c
index 77d8103d0094..360e3ab3e956 100644
--- a/drivers/acpi/acpica/nsrepair.c
+++ b/drivers/acpi/acpica/nsrepair.c
@@ -366,6 +366,7 @@ static const struct acpi_simple_repair_info *acpi_ns_match_simple_repair(struct
366 366
367 return (NULL); 367 return (NULL);
368 } 368 }
369
369 this_name++; 370 this_name++;
370 } 371 }
371 372
@@ -521,6 +522,7 @@ acpi_ns_remove_null_elements(struct acpi_evaluate_info *info,
521 *dest = *source; 522 *dest = *source;
522 dest++; 523 dest++;
523 } 524 }
525
524 source++; 526 source++;
525 } 527 }
526 528
@@ -572,8 +574,8 @@ acpi_ns_wrap_with_package(struct acpi_evaluate_info *info,
572 ACPI_FUNCTION_NAME(ns_wrap_with_package); 574 ACPI_FUNCTION_NAME(ns_wrap_with_package);
573 575
574 /* 576 /*
575 * Create the new outer package and populate it. The new package will 577 * Create the new outer package and populate it. The new
576 * have a single element, the lone sub-object. 578 * package will have a single element, the lone sub-object.
577 */ 579 */
578 pkg_obj_desc = acpi_ut_create_package_object(1); 580 pkg_obj_desc = acpi_ut_create_package_object(1);
579 if (!pkg_obj_desc) { 581 if (!pkg_obj_desc) {
diff --git a/drivers/acpi/acpica/nsrepair2.c b/drivers/acpi/acpica/nsrepair2.c
index 7ca8f2b7a059..f6dd2a83ea63 100644
--- a/drivers/acpi/acpica/nsrepair2.c
+++ b/drivers/acpi/acpica/nsrepair2.c
@@ -225,6 +225,7 @@ static const struct acpi_repair_info *acpi_ns_match_complex_repair(struct
225 if (ACPI_COMPARE_NAME(node->name.ascii, this_name->name)) { 225 if (ACPI_COMPARE_NAME(node->name.ascii, this_name->name)) {
226 return (this_name); 226 return (this_name);
227 } 227 }
228
228 this_name++; 229 this_name++;
229 } 230 }
230 231
@@ -301,7 +302,8 @@ acpi_ns_repair_FDE(struct acpi_evaluate_info *info,
301 /* We can only repair if we have exactly 5 BYTEs */ 302 /* We can only repair if we have exactly 5 BYTEs */
302 303
303 if (return_object->buffer.length != ACPI_FDE_BYTE_BUFFER_SIZE) { 304 if (return_object->buffer.length != ACPI_FDE_BYTE_BUFFER_SIZE) {
304 ACPI_WARN_PREDEFINED((AE_INFO, info->full_pathname, 305 ACPI_WARN_PREDEFINED((AE_INFO,
306 info->full_pathname,
305 info->node_flags, 307 info->node_flags,
306 "Incorrect return buffer length %u, expected %u", 308 "Incorrect return buffer length %u, expected %u",
307 return_object->buffer.length, 309 return_object->buffer.length,
@@ -321,8 +323,8 @@ acpi_ns_repair_FDE(struct acpi_evaluate_info *info,
321 /* Expand each byte to a DWORD */ 323 /* Expand each byte to a DWORD */
322 324
323 byte_buffer = return_object->buffer.pointer; 325 byte_buffer = return_object->buffer.pointer;
324 dword_buffer = 326 dword_buffer = ACPI_CAST_PTR(u32,
325 ACPI_CAST_PTR(u32, buffer_object->buffer.pointer); 327 buffer_object->buffer.pointer);
326 328
327 for (i = 0; i < ACPI_FDE_FIELD_COUNT; i++) { 329 for (i = 0; i < ACPI_FDE_FIELD_COUNT; i++) {
328 *dword_buffer = (u32) *byte_buffer; 330 *dword_buffer = (u32) *byte_buffer;
@@ -461,7 +463,8 @@ acpi_ns_repair_CST(struct acpi_evaluate_info *info,
461 removing = FALSE; 463 removing = FALSE;
462 464
463 if ((*outer_elements)->package.count == 0) { 465 if ((*outer_elements)->package.count == 0) {
464 ACPI_WARN_PREDEFINED((AE_INFO, info->full_pathname, 466 ACPI_WARN_PREDEFINED((AE_INFO,
467 info->full_pathname,
465 info->node_flags, 468 info->node_flags,
466 "SubPackage[%u] - removing entry due to zero count", 469 "SubPackage[%u] - removing entry due to zero count",
467 i)); 470 i));
@@ -471,7 +474,8 @@ acpi_ns_repair_CST(struct acpi_evaluate_info *info,
471 474
472 obj_desc = (*outer_elements)->package.elements[1]; /* Index1 = Type */ 475 obj_desc = (*outer_elements)->package.elements[1]; /* Index1 = Type */
473 if ((u32)obj_desc->integer.value == 0) { 476 if ((u32)obj_desc->integer.value == 0) {
474 ACPI_WARN_PREDEFINED((AE_INFO, info->full_pathname, 477 ACPI_WARN_PREDEFINED((AE_INFO,
478 info->full_pathname,
475 info->node_flags, 479 info->node_flags,
476 "SubPackage[%u] - removing entry due to invalid Type(0)", 480 "SubPackage[%u] - removing entry due to invalid Type(0)",
477 i)); 481 i));
@@ -538,8 +542,8 @@ acpi_ns_repair_HID(struct acpi_evaluate_info *info,
538 } 542 }
539 543
540 if (return_object->string.length == 0) { 544 if (return_object->string.length == 0) {
541 ACPI_WARN_PREDEFINED((AE_INFO, info->full_pathname, 545 ACPI_WARN_PREDEFINED((AE_INFO,
542 info->node_flags, 546 info->full_pathname, info->node_flags,
543 "Invalid zero-length _HID or _CID string")); 547 "Invalid zero-length _HID or _CID string"));
544 548
545 /* Return AE_OK anyway, let driver handle it */ 549 /* Return AE_OK anyway, let driver handle it */
@@ -711,7 +715,8 @@ acpi_ns_repair_PSS(struct acpi_evaluate_info *info,
711 obj_desc = elements[1]; /* Index1 = power_dissipation */ 715 obj_desc = elements[1]; /* Index1 = power_dissipation */
712 716
713 if ((u32)obj_desc->integer.value > previous_value) { 717 if ((u32)obj_desc->integer.value > previous_value) {
714 ACPI_WARN_PREDEFINED((AE_INFO, info->full_pathname, 718 ACPI_WARN_PREDEFINED((AE_INFO,
719 info->full_pathname,
715 info->node_flags, 720 info->node_flags,
716 "SubPackage[%u,%u] - suspicious power dissipation values", 721 "SubPackage[%u,%u] - suspicious power dissipation values",
717 i - 1, i)); 722 i - 1, i));
@@ -969,6 +974,7 @@ acpi_ns_remove_element(union acpi_operand_object *obj_desc, u32 index)
969 *dest = *source; 974 *dest = *source;
970 dest++; 975 dest++;
971 } 976 }
977
972 source++; 978 source++;
973 } 979 }
974 980
diff --git a/drivers/acpi/acpica/nsutils.c b/drivers/acpi/acpica/nsutils.c
index de325ae04ce1..32f1d956eb7f 100644
--- a/drivers/acpi/acpica/nsutils.c
+++ b/drivers/acpi/acpica/nsutils.c
@@ -173,9 +173,10 @@ void acpi_ns_get_internal_name_length(struct acpi_namestring_info *info)
173 info->fully_qualified = FALSE; 173 info->fully_qualified = FALSE;
174 174
175 /* 175 /*
176 * For the internal name, the required length is 4 bytes per segment, plus 176 * For the internal name, the required length is 4 bytes per segment,
177 * 1 each for root_prefix, multi_name_prefix_op, segment count, trailing null 177 * plus 1 each for root_prefix, multi_name_prefix_op, segment count,
178 * (which is not really needed, but no there's harm in putting it there) 178 * trailing null (which is not really needed, but no there's harm in
179 * putting it there)
179 * 180 *
180 * strlen() + 1 covers the first name_seg, which has no path separator 181 * strlen() + 1 covers the first name_seg, which has no path separator
181 */ 182 */
@@ -699,6 +700,7 @@ acpi_ns_get_node(struct acpi_namespace_node *prefix_node,
699 if (!prefix_node) { 700 if (!prefix_node) {
700 *return_node = acpi_gbl_root_node; 701 *return_node = acpi_gbl_root_node;
701 } 702 }
703
702 return_ACPI_STATUS(AE_OK); 704 return_ACPI_STATUS(AE_OK);
703 } 705 }
704 706
diff --git a/drivers/acpi/acpica/nsxfeval.c b/drivers/acpi/acpica/nsxfeval.c
index 6ee1e52b903d..429f0d27bef0 100644
--- a/drivers/acpi/acpica/nsxfeval.c
+++ b/drivers/acpi/acpica/nsxfeval.c
@@ -750,8 +750,8 @@ acpi_ns_get_device_callback(acpi_handle obj_handle,
750 750
751 /* We have a valid device, invoke the user function */ 751 /* We have a valid device, invoke the user function */
752 752
753 status = info->user_function(obj_handle, nesting_level, info->context, 753 status = info->user_function(obj_handle, nesting_level,
754 return_value); 754 info->context, return_value);
755 return (status); 755 return (status);
756} 756}
757 757
diff --git a/drivers/acpi/acpica/nsxfname.c b/drivers/acpi/acpica/nsxfname.c
index 138cf5e9f98e..c19d86c195b0 100644
--- a/drivers/acpi/acpica/nsxfname.c
+++ b/drivers/acpi/acpica/nsxfname.c
@@ -591,6 +591,7 @@ acpi_status acpi_install_method(u8 *buffer)
591 parser_state.aml += acpi_ps_get_opcode_size(opcode); 591 parser_state.aml += acpi_ps_get_opcode_size(opcode);
592 parser_state.pkg_end = acpi_ps_get_next_package_end(&parser_state); 592 parser_state.pkg_end = acpi_ps_get_next_package_end(&parser_state);
593 path = acpi_ps_get_next_namestring(&parser_state); 593 path = acpi_ps_get_next_namestring(&parser_state);
594
594 method_flags = *parser_state.aml++; 595 method_flags = *parser_state.aml++;
595 aml_start = parser_state.aml; 596 aml_start = parser_state.aml;
596 aml_length = ACPI_PTR_DIFF(parser_state.pkg_end, aml_start); 597 aml_length = ACPI_PTR_DIFF(parser_state.pkg_end, aml_start);
diff --git a/drivers/acpi/acpica/nsxfobj.c b/drivers/acpi/acpica/nsxfobj.c
index 793383501f81..6e1389babb47 100644
--- a/drivers/acpi/acpica/nsxfobj.c
+++ b/drivers/acpi/acpica/nsxfobj.c
@@ -74,10 +74,8 @@ acpi_status acpi_get_type(acpi_handle handle, acpi_object_type * ret_type)
74 return (AE_BAD_PARAMETER); 74 return (AE_BAD_PARAMETER);
75 } 75 }
76 76
77 /* 77 /* Special case for the predefined Root Node (return type ANY) */
78 * Special case for the predefined Root Node 78
79 * (return type ANY)
80 */
81 if (handle == ACPI_ROOT_OBJECT) { 79 if (handle == ACPI_ROOT_OBJECT) {
82 *ret_type = ACPI_TYPE_ANY; 80 *ret_type = ACPI_TYPE_ANY;
83 return (AE_OK); 81 return (AE_OK);
diff --git a/drivers/acpi/acpica/psargs.c b/drivers/acpi/acpica/psargs.c
index 29d8b7b01dca..3f0ffeef4137 100644
--- a/drivers/acpi/acpica/psargs.c
+++ b/drivers/acpi/acpica/psargs.c
@@ -733,6 +733,7 @@ acpi_ps_get_next_arg(struct acpi_walk_state *walk_state,
733 if (!arg) { 733 if (!arg) {
734 return_ACPI_STATUS(AE_NO_MEMORY); 734 return_ACPI_STATUS(AE_NO_MEMORY);
735 } 735 }
736
736 acpi_ps_get_next_simple_arg(parser_state, arg_type, arg); 737 acpi_ps_get_next_simple_arg(parser_state, arg_type, arg);
737 break; 738 break;
738 739
diff --git a/drivers/acpi/acpica/psloop.c b/drivers/acpi/acpica/psloop.c
index 03ac8c9a67ab..c660006f13ee 100644
--- a/drivers/acpi/acpica/psloop.c
+++ b/drivers/acpi/acpica/psloop.c
@@ -124,8 +124,8 @@ acpi_ps_get_arguments(struct acpi_walk_state *walk_state,
124 /* 124 /*
125 * Op is not a constant or string, append each argument to the Op 125 * Op is not a constant or string, append each argument to the Op
126 */ 126 */
127 while (GET_CURRENT_ARG_TYPE(walk_state->arg_types) 127 while (GET_CURRENT_ARG_TYPE(walk_state->arg_types) &&
128 && !walk_state->arg_count) { 128 !walk_state->arg_count) {
129 walk_state->aml = walk_state->parser_state.aml; 129 walk_state->aml = walk_state->parser_state.aml;
130 130
131 status = 131 status =
diff --git a/drivers/acpi/acpica/psparse.c b/drivers/acpi/acpica/psparse.c
index 98001d7f6f80..b729d9b291d0 100644
--- a/drivers/acpi/acpica/psparse.c
+++ b/drivers/acpi/acpica/psparse.c
@@ -526,8 +526,8 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state)
526 } 526 }
527 527
528 /* 528 /*
529 * If the transfer to the new method method call worked, a new walk 529 * If the transfer to the new method method call worked
530 * state was created -- get it 530 *, a new walk state was created -- get it
531 */ 531 */
532 walk_state = acpi_ds_get_current_walk_state(thread); 532 walk_state = acpi_ds_get_current_walk_state(thread);
533 continue; 533 continue;
@@ -544,8 +544,8 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state)
544 /* Check for possible multi-thread reentrancy problem */ 544 /* Check for possible multi-thread reentrancy problem */
545 545
546 if ((status == AE_ALREADY_EXISTS) && 546 if ((status == AE_ALREADY_EXISTS) &&
547 (!(walk_state->method_desc->method. 547 (!(walk_state->method_desc->method.info_flags &
548 info_flags & ACPI_METHOD_SERIALIZED))) { 548 ACPI_METHOD_SERIALIZED))) {
549 /* 549 /*
550 * Method is not serialized and tried to create an object 550 * Method is not serialized and tried to create an object
551 * twice. The probable cause is that the method cannot 551 * twice. The probable cause is that the method cannot
diff --git a/drivers/acpi/acpica/psutils.c b/drivers/acpi/acpica/psutils.c
index 71d2877cd2ce..6cb02a2a1468 100644
--- a/drivers/acpi/acpica/psutils.c
+++ b/drivers/acpi/acpica/psutils.c
@@ -175,8 +175,8 @@ void acpi_ps_free_op(union acpi_parse_object *op)
175 ACPI_FUNCTION_NAME(ps_free_op); 175 ACPI_FUNCTION_NAME(ps_free_op);
176 176
177 if (op->common.aml_opcode == AML_INT_RETURN_VALUE_OP) { 177 if (op->common.aml_opcode == AML_INT_RETURN_VALUE_OP) {
178 ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS, "Free retval op: %p\n", 178 ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS,
179 op)); 179 "Free retval op: %p\n", op));
180 } 180 }
181 181
182 if (op->common.flags & ACPI_PARSEOP_GENERIC) { 182 if (op->common.flags & ACPI_PARSEOP_GENERIC) {
diff --git a/drivers/acpi/acpica/pswalk.c b/drivers/acpi/acpica/pswalk.c
index ba5f69171288..f620d4395b66 100644
--- a/drivers/acpi/acpica/pswalk.c
+++ b/drivers/acpi/acpica/pswalk.c
@@ -99,6 +99,7 @@ void acpi_ps_delete_parse_tree(union acpi_parse_object *subtree_root)
99 if (op == subtree_root) { 99 if (op == subtree_root) {
100 return_VOID; 100 return_VOID;
101 } 101 }
102
102 if (next) { 103 if (next) {
103 op = next; 104 op = next;
104 } else { 105 } else {
diff --git a/drivers/acpi/acpica/rsaddr.c b/drivers/acpi/acpica/rsaddr.c
index 66d406e8fe36..bdb7e73cdf4a 100644
--- a/drivers/acpi/acpica/rsaddr.c
+++ b/drivers/acpi/acpica/rsaddr.c
@@ -312,8 +312,8 @@ acpi_rs_get_address_common(struct acpi_resource *resource,
312 312
313 /* Validate the Resource Type */ 313 /* Validate the Resource Type */
314 314
315 if ((aml->address.resource_type > 2) 315 if ((aml->address.resource_type > 2) &&
316 && (aml->address.resource_type < 0xC0)) { 316 (aml->address.resource_type < 0xC0)) {
317 return (FALSE); 317 return (FALSE);
318 } 318 }
319 319
diff --git a/drivers/acpi/acpica/rscalc.c b/drivers/acpi/acpica/rscalc.c
index cb739a694931..88fce58cc545 100644
--- a/drivers/acpi/acpica/rscalc.c
+++ b/drivers/acpi/acpica/rscalc.c
@@ -143,16 +143,17 @@ acpi_rs_stream_option_length(u32 resource_length,
143 ACPI_FUNCTION_ENTRY(); 143 ACPI_FUNCTION_ENTRY();
144 144
145 /* 145 /*
146 * The resource_source_index and resource_source are optional elements of some 146 * The resource_source_index and resource_source are optional elements of
147 * Large-type resource descriptors. 147 * some Large-type resource descriptors.
148 */ 148 */
149 149
150 /* 150 /*
151 * If the length of the actual resource descriptor is greater than the ACPI 151 * If the length of the actual resource descriptor is greater than the
152 * spec-defined minimum length, it means that a resource_source_index exists 152 * ACPI spec-defined minimum length, it means that a resource_source_index
153 * and is followed by a (required) null terminated string. The string length 153 * exists and is followed by a (required) null terminated string. The
154 * (including the null terminator) is the resource length minus the minimum 154 * string length (including the null terminator) is the resource length
155 * length, minus one byte for the resource_source_index itself. 155 * minus the minimum length, minus one byte for the resource_source_index
156 * itself.
156 */ 157 */
157 if (resource_length > minimum_aml_resource_length) { 158 if (resource_length > minimum_aml_resource_length) {
158 159
@@ -277,11 +278,11 @@ acpi_rs_get_aml_length(struct acpi_resource *resource,
277 * 16-Bit Address Resource: 278 * 16-Bit Address Resource:
278 * Add the size of the optional resource_source info 279 * Add the size of the optional resource_source info
279 */ 280 */
280 total_size = (acpi_rs_length) 281 total_size = (acpi_rs_length) (total_size +
281 (total_size + 282 acpi_rs_struct_option_length
282 acpi_rs_struct_option_length(&resource->data. 283 (&resource->data.
283 address16. 284 address16.
284 resource_source)); 285 resource_source));
285 break; 286 break;
286 287
287 case ACPI_RESOURCE_TYPE_ADDRESS32: 288 case ACPI_RESOURCE_TYPE_ADDRESS32:
@@ -289,11 +290,11 @@ acpi_rs_get_aml_length(struct acpi_resource *resource,
289 * 32-Bit Address Resource: 290 * 32-Bit Address Resource:
290 * Add the size of the optional resource_source info 291 * Add the size of the optional resource_source info
291 */ 292 */
292 total_size = (acpi_rs_length) 293 total_size = (acpi_rs_length) (total_size +
293 (total_size + 294 acpi_rs_struct_option_length
294 acpi_rs_struct_option_length(&resource->data. 295 (&resource->data.
295 address32. 296 address32.
296 resource_source)); 297 resource_source));
297 break; 298 break;
298 299
299 case ACPI_RESOURCE_TYPE_ADDRESS64: 300 case ACPI_RESOURCE_TYPE_ADDRESS64:
@@ -301,11 +302,11 @@ acpi_rs_get_aml_length(struct acpi_resource *resource,
301 * 64-Bit Address Resource: 302 * 64-Bit Address Resource:
302 * Add the size of the optional resource_source info 303 * Add the size of the optional resource_source info
303 */ 304 */
304 total_size = (acpi_rs_length) 305 total_size = (acpi_rs_length) (total_size +
305 (total_size + 306 acpi_rs_struct_option_length
306 acpi_rs_struct_option_length(&resource->data. 307 (&resource->data.
307 address64. 308 address64.
308 resource_source)); 309 resource_source));
309 break; 310 break;
310 311
311 case ACPI_RESOURCE_TYPE_EXTENDED_IRQ: 312 case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
@@ -314,26 +315,28 @@ acpi_rs_get_aml_length(struct acpi_resource *resource,
314 * Add the size of each additional optional interrupt beyond the 315 * Add the size of each additional optional interrupt beyond the
315 * required 1 (4 bytes for each u32 interrupt number) 316 * required 1 (4 bytes for each u32 interrupt number)
316 */ 317 */
317 total_size = (acpi_rs_length) 318 total_size = (acpi_rs_length) (total_size +
318 (total_size + 319 ((resource->data.
319 ((resource->data.extended_irq.interrupt_count - 320 extended_irq.
320 1) * 4) + 321 interrupt_count -
321 /* Add the size of the optional resource_source info */ 322 1) * 4) +
322 acpi_rs_struct_option_length(&resource->data. 323 /* Add the size of the optional resource_source info */
323 extended_irq. 324 acpi_rs_struct_option_length
324 resource_source)); 325 (&resource->data.
326 extended_irq.
327 resource_source));
325 break; 328 break;
326 329
327 case ACPI_RESOURCE_TYPE_GPIO: 330 case ACPI_RESOURCE_TYPE_GPIO:
328 331
329 total_size = 332 total_size = (acpi_rs_length) (total_size +
330 (acpi_rs_length) (total_size + 333 (resource->data.gpio.
331 (resource->data.gpio. 334 pin_table_length * 2) +
332 pin_table_length * 2) + 335 resource->data.gpio.
333 resource->data.gpio. 336 resource_source.
334 resource_source.string_length + 337 string_length +
335 resource->data.gpio. 338 resource->data.gpio.
336 vendor_length); 339 vendor_length);
337 340
338 break; 341 break;
339 342
@@ -566,8 +569,8 @@ acpi_rs_get_list_length(u8 * aml_buffer,
566 acpi_gbl_resource_struct_sizes[resource_index] + 569 acpi_gbl_resource_struct_sizes[resource_index] +
567 extra_struct_bytes; 570 extra_struct_bytes;
568 } 571 }
569 buffer_size = (u32)ACPI_ROUND_UP_TO_NATIVE_WORD(buffer_size);
570 572
573 buffer_size = (u32)ACPI_ROUND_UP_TO_NATIVE_WORD(buffer_size);
571 *size_needed += buffer_size; 574 *size_needed += buffer_size;
572 575
573 ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, 576 ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES,
diff --git a/drivers/acpi/acpica/rscreate.c b/drivers/acpi/acpica/rscreate.c
index a5344428f3ae..603e544e3f64 100644
--- a/drivers/acpi/acpica/rscreate.c
+++ b/drivers/acpi/acpica/rscreate.c
@@ -81,8 +81,9 @@ acpi_buffer_to_resource(u8 *aml_buffer,
81 81
82 /* Get the required length for the converted resource */ 82 /* Get the required length for the converted resource */
83 83
84 status = acpi_rs_get_list_length(aml_buffer, aml_buffer_length, 84 status =
85 &list_size_needed); 85 acpi_rs_get_list_length(aml_buffer, aml_buffer_length,
86 &list_size_needed);
86 if (status == AE_AML_NO_RESOURCE_END_TAG) { 87 if (status == AE_AML_NO_RESOURCE_END_TAG) {
87 status = AE_OK; 88 status = AE_OK;
88 } 89 }
@@ -232,8 +233,9 @@ acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object,
232 233
233 /* Get the required buffer length */ 234 /* Get the required buffer length */
234 235
235 status = acpi_rs_get_pci_routing_table_length(package_object, 236 status =
236 &buffer_size_needed); 237 acpi_rs_get_pci_routing_table_length(package_object,
238 &buffer_size_needed);
237 if (ACPI_FAILURE(status)) { 239 if (ACPI_FAILURE(status)) {
238 return_ACPI_STATUS(status); 240 return_ACPI_STATUS(status);
239 } 241 }
@@ -270,9 +272,9 @@ acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object,
270 user_prt = ACPI_CAST_PTR(struct acpi_pci_routing_table, buffer); 272 user_prt = ACPI_CAST_PTR(struct acpi_pci_routing_table, buffer);
271 273
272 /* 274 /*
273 * Fill in the Length field with the information we have at this point. 275 * Fill in the Length field with the information we have at this
274 * The minus four is to subtract the size of the u8 Source[4] member 276 * point. The minus four is to subtract the size of the u8
275 * because it is added below. 277 * Source[4] member because it is added below.
276 */ 278 */
277 user_prt->length = (sizeof(struct acpi_pci_routing_table) - 4); 279 user_prt->length = (sizeof(struct acpi_pci_routing_table) - 4);
278 280
@@ -345,11 +347,7 @@ acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object,
345 (u8 *) output_buffer->pointer); 347 (u8 *) output_buffer->pointer);
346 path_buffer.pointer = user_prt->source; 348 path_buffer.pointer = user_prt->source;
347 349
348 status = 350 status = acpi_ns_handle_to_pathname((acpi_handle) node, &path_buffer, FALSE);
349 acpi_ns_handle_to_pathname((acpi_handle)
350 node,
351 &path_buffer,
352 FALSE);
353 351
354 /* +1 to include null terminator */ 352 /* +1 to include null terminator */
355 353
@@ -371,8 +369,8 @@ acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object,
371 369
372 case ACPI_TYPE_INTEGER: 370 case ACPI_TYPE_INTEGER:
373 /* 371 /*
374 * If this is a number, then the Source Name is NULL, since the 372 * If this is a number, then the Source Name is NULL, since
375 * entire buffer was zeroed out, we can leave this alone. 373 * the entire buffer was zeroed out, we can leave this alone.
376 * 374 *
377 * Add to the Length field the length of the u32 NULL 375 * Add to the Length field the length of the u32 NULL
378 */ 376 */
@@ -451,9 +449,9 @@ acpi_rs_create_aml_resources(struct acpi_buffer *resource_list,
451 449
452 /* Get the buffer size needed for the AML byte stream */ 450 /* Get the buffer size needed for the AML byte stream */
453 451
454 status = acpi_rs_get_aml_length(resource_list->pointer, 452 status =
455 resource_list->length, 453 acpi_rs_get_aml_length(resource_list->pointer,
456 &aml_size_needed); 454 resource_list->length, &aml_size_needed);
457 455
458 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "AmlSizeNeeded=%X, %s\n", 456 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "AmlSizeNeeded=%X, %s\n",
459 (u32)aml_size_needed, acpi_format_exception(status))); 457 (u32)aml_size_needed, acpi_format_exception(status)));
diff --git a/drivers/acpi/acpica/rsdump.c b/drivers/acpi/acpica/rsdump.c
index 2a09288e7c57..05cc560699e1 100644
--- a/drivers/acpi/acpica/rsdump.c
+++ b/drivers/acpi/acpica/rsdump.c
@@ -483,6 +483,7 @@ static void acpi_rs_dump_address_common(union acpi_resource_data *resource)
483 483
484static void acpi_rs_out_string(char *title, char *value) 484static void acpi_rs_out_string(char *title, char *value)
485{ 485{
486
486 acpi_os_printf("%27s : %s", title, value); 487 acpi_os_printf("%27s : %s", title, value);
487 if (!*value) { 488 if (!*value) {
488 acpi_os_printf("[NULL NAMESTRING]"); 489 acpi_os_printf("[NULL NAMESTRING]");
@@ -497,21 +498,25 @@ static void acpi_rs_out_integer8(char *title, u8 value)
497 498
498static void acpi_rs_out_integer16(char *title, u16 value) 499static void acpi_rs_out_integer16(char *title, u16 value)
499{ 500{
501
500 acpi_os_printf("%27s : %4.4X\n", title, value); 502 acpi_os_printf("%27s : %4.4X\n", title, value);
501} 503}
502 504
503static void acpi_rs_out_integer32(char *title, u32 value) 505static void acpi_rs_out_integer32(char *title, u32 value)
504{ 506{
507
505 acpi_os_printf("%27s : %8.8X\n", title, value); 508 acpi_os_printf("%27s : %8.8X\n", title, value);
506} 509}
507 510
508static void acpi_rs_out_integer64(char *title, u64 value) 511static void acpi_rs_out_integer64(char *title, u64 value)
509{ 512{
513
510 acpi_os_printf("%27s : %8.8X%8.8X\n", title, ACPI_FORMAT_UINT64(value)); 514 acpi_os_printf("%27s : %8.8X%8.8X\n", title, ACPI_FORMAT_UINT64(value));
511} 515}
512 516
513static void acpi_rs_out_title(char *title) 517static void acpi_rs_out_title(char *title)
514{ 518{
519
515 acpi_os_printf("%27s : ", title); 520 acpi_os_printf("%27s : ", title);
516} 521}
517 522
@@ -544,6 +549,7 @@ static void acpi_rs_dump_short_byte_list(u8 length, u8 * data)
544 for (i = 0; i < length; i++) { 549 for (i = 0; i < length; i++) {
545 acpi_os_printf("%X ", data[i]); 550 acpi_os_printf("%X ", data[i]);
546 } 551 }
552
547 acpi_os_printf("\n"); 553 acpi_os_printf("\n");
548} 554}
549 555
diff --git a/drivers/acpi/acpica/rslist.c b/drivers/acpi/acpica/rslist.c
index 50d5be2ee062..286ccb461a20 100644
--- a/drivers/acpi/acpica/rslist.c
+++ b/drivers/acpi/acpica/rslist.c
@@ -89,6 +89,7 @@ acpi_rs_convert_aml_to_resources(u8 * aml,
89 /* Get the appropriate conversion info table */ 89 /* Get the appropriate conversion info table */
90 90
91 aml_resource = ACPI_CAST_PTR(union aml_resource, aml); 91 aml_resource = ACPI_CAST_PTR(union aml_resource, aml);
92
92 if (acpi_ut_get_resource_type(aml) == ACPI_RESOURCE_NAME_SERIAL_BUS) { 93 if (acpi_ut_get_resource_type(aml) == ACPI_RESOURCE_NAME_SERIAL_BUS) {
93 if (aml_resource->common_serial_bus.type > 94 if (aml_resource->common_serial_bus.type >
94 AML_RESOURCE_MAX_SERIALBUSTYPE) { 95 AML_RESOURCE_MAX_SERIALBUSTYPE) {
@@ -225,10 +226,10 @@ acpi_rs_convert_resources_to_aml(struct acpi_resource *resource,
225 226
226 /* Perform final sanity check on the new AML resource descriptor */ 227 /* Perform final sanity check on the new AML resource descriptor */
227 228
228 status = acpi_ut_validate_resource(NULL, 229 status =
229 ACPI_CAST_PTR(union 230 acpi_ut_validate_resource(NULL,
230 aml_resource, 231 ACPI_CAST_PTR(union aml_resource,
231 aml), NULL); 232 aml), NULL);
232 if (ACPI_FAILURE(status)) { 233 if (ACPI_FAILURE(status)) {
233 return_ACPI_STATUS(status); 234 return_ACPI_STATUS(status);
234 } 235 }
diff --git a/drivers/acpi/acpica/rsmisc.c b/drivers/acpi/acpica/rsmisc.c
index b528ed903fb2..b112c7b1abbf 100644
--- a/drivers/acpi/acpica/rsmisc.c
+++ b/drivers/acpi/acpica/rsmisc.c
@@ -189,8 +189,8 @@ acpi_rs_convert_aml_to_resource(struct acpi_resource *resource,
189 item_count = ACPI_GET8(source); 189 item_count = ACPI_GET8(source);
190 ACPI_SET8(destination, item_count); 190 ACPI_SET8(destination, item_count);
191 191
192 resource->length = resource->length + 192 resource->length =
193 (info->value * item_count); 193 resource->length + (info->value * item_count);
194 break; 194 break;
195 195
196 case ACPI_RSC_COUNT_GPIO_RES: 196 case ACPI_RSC_COUNT_GPIO_RES:
@@ -445,8 +445,8 @@ exit:
445 445
446 /* Round the resource struct length up to the next boundary (32 or 64) */ 446 /* Round the resource struct length up to the next boundary (32 or 64) */
447 447
448 resource->length = 448 resource->length = (u32)
449 (u32)ACPI_ROUND_UP_TO_NATIVE_WORD(resource->length); 449 ACPI_ROUND_UP_TO_NATIVE_WORD(resource->length);
450 } 450 }
451 return_ACPI_STATUS(AE_OK); 451 return_ACPI_STATUS(AE_OK);
452} 452}
@@ -550,9 +550,8 @@ acpi_rs_convert_resource_to_aml(struct acpi_resource *resource,
550 item_count = ACPI_GET8(source); 550 item_count = ACPI_GET8(source);
551 ACPI_SET8(destination, item_count); 551 ACPI_SET8(destination, item_count);
552 552
553 aml_length = 553 aml_length = (u16)
554 (u16)(aml_length + 554 (aml_length + (info->value * (item_count - 1)));
555 (info->value * (item_count - 1)));
556 break; 555 break;
557 556
558 case ACPI_RSC_COUNT16: 557 case ACPI_RSC_COUNT16:
@@ -723,11 +722,10 @@ acpi_rs_convert_resource_to_aml(struct acpi_resource *resource,
723 /* 722 /*
724 * 16-bit encoded bitmask (IRQ macro) 723 * 16-bit encoded bitmask (IRQ macro)
725 */ 724 */
726 temp16 = acpi_rs_encode_bitmask(source, 725 temp16 =
727 *ACPI_ADD_PTR(u8, 726 acpi_rs_encode_bitmask(source,
728 resource, 727 *ACPI_ADD_PTR(u8, resource,
729 info-> 728 info->value));
730 value));
731 ACPI_MOVE_16_TO_16(destination, &temp16); 729 ACPI_MOVE_16_TO_16(destination, &temp16);
732 break; 730 break;
733 731
diff --git a/drivers/acpi/acpica/rsutils.c b/drivers/acpi/acpica/rsutils.c
index 9486992edbb8..33e558c9434f 100644
--- a/drivers/acpi/acpica/rsutils.c
+++ b/drivers/acpi/acpica/rsutils.c
@@ -221,14 +221,13 @@ acpi_rs_set_resource_length(acpi_rsdesc_size total_length,
221 ACPI_MOVE_16_TO_16(&aml->large_header.resource_length, 221 ACPI_MOVE_16_TO_16(&aml->large_header.resource_length,
222 &resource_length); 222 &resource_length);
223 } else { 223 } else {
224 /* Small descriptor -- bits 2:0 of byte 0 contain the length */ 224 /*
225 225 * Small descriptor -- bits 2:0 of byte 0 contain the length
226 * Clear any existing length, preserving descriptor type bits
227 */
226 aml->small_header.descriptor_type = (u8) 228 aml->small_header.descriptor_type = (u8)
227 229 ((aml->small_header.descriptor_type &
228 /* Clear any existing length, preserving descriptor type bits */ 230 ~ACPI_RESOURCE_NAME_SMALL_LENGTH_MASK)
229 ((aml->small_header.
230 descriptor_type & ~ACPI_RESOURCE_NAME_SMALL_LENGTH_MASK)
231
232 | resource_length); 231 | resource_length);
233 } 232 }
234} 233}
@@ -333,8 +332,8 @@ acpi_rs_get_resource_source(acpi_rs_length resource_length,
333 aml_resource_source = ACPI_ADD_PTR(u8, aml, minimum_length); 332 aml_resource_source = ACPI_ADD_PTR(u8, aml, minimum_length);
334 333
335 /* 334 /*
336 * resource_source is present if the length of the descriptor is longer than 335 * resource_source is present if the length of the descriptor is longer
337 * the minimum length. 336 * than the minimum length.
338 * 337 *
339 * Note: Some resource descriptors will have an additional null, so 338 * Note: Some resource descriptors will have an additional null, so
340 * we add 1 to the minimum length. 339 * we add 1 to the minimum length.
@@ -366,6 +365,7 @@ acpi_rs_get_resource_source(acpi_rs_length resource_length,
366 total_length = 365 total_length =
367 (u32)strlen(ACPI_CAST_PTR(char, &aml_resource_source[1])) + 366 (u32)strlen(ACPI_CAST_PTR(char, &aml_resource_source[1])) +
368 1; 367 1;
368
369 total_length = (u32)ACPI_ROUND_UP_TO_NATIVE_WORD(total_length); 369 total_length = (u32)ACPI_ROUND_UP_TO_NATIVE_WORD(total_length);
370 370
371 memset(resource_source->string_ptr, 0, total_length); 371 memset(resource_source->string_ptr, 0, total_length);
@@ -438,8 +438,8 @@ acpi_rs_set_resource_source(union aml_resource * aml,
438 * Add the length of the string (+ 1 for null terminator) to the 438 * Add the length of the string (+ 1 for null terminator) to the
439 * final descriptor length 439 * final descriptor length
440 */ 440 */
441 descriptor_length += 441 descriptor_length += ((acpi_rsdesc_size)
442 ((acpi_rsdesc_size) resource_source->string_length + 1); 442 resource_source->string_length + 1);
443 } 443 }
444 444
445 /* Return the new total length of the AML descriptor */ 445 /* Return the new total length of the AML descriptor */
@@ -478,8 +478,9 @@ acpi_rs_get_prt_method_data(struct acpi_namespace_node * node,
478 478
479 /* Execute the method, no parameters */ 479 /* Execute the method, no parameters */
480 480
481 status = acpi_ut_evaluate_object(node, METHOD_NAME__PRT, 481 status =
482 ACPI_BTYPE_PACKAGE, &obj_desc); 482 acpi_ut_evaluate_object(node, METHOD_NAME__PRT, ACPI_BTYPE_PACKAGE,
483 &obj_desc);
483 if (ACPI_FAILURE(status)) { 484 if (ACPI_FAILURE(status)) {
484 return_ACPI_STATUS(status); 485 return_ACPI_STATUS(status);
485 } 486 }
@@ -527,8 +528,9 @@ acpi_rs_get_crs_method_data(struct acpi_namespace_node *node,
527 528
528 /* Execute the method, no parameters */ 529 /* Execute the method, no parameters */
529 530
530 status = acpi_ut_evaluate_object(node, METHOD_NAME__CRS, 531 status =
531 ACPI_BTYPE_BUFFER, &obj_desc); 532 acpi_ut_evaluate_object(node, METHOD_NAME__CRS, ACPI_BTYPE_BUFFER,
533 &obj_desc);
532 if (ACPI_FAILURE(status)) { 534 if (ACPI_FAILURE(status)) {
533 return_ACPI_STATUS(status); 535 return_ACPI_STATUS(status);
534 } 536 }
@@ -577,8 +579,9 @@ acpi_rs_get_prs_method_data(struct acpi_namespace_node *node,
577 579
578 /* Execute the method, no parameters */ 580 /* Execute the method, no parameters */
579 581
580 status = acpi_ut_evaluate_object(node, METHOD_NAME__PRS, 582 status =
581 ACPI_BTYPE_BUFFER, &obj_desc); 583 acpi_ut_evaluate_object(node, METHOD_NAME__PRS, ACPI_BTYPE_BUFFER,
584 &obj_desc);
582 if (ACPI_FAILURE(status)) { 585 if (ACPI_FAILURE(status)) {
583 return_ACPI_STATUS(status); 586 return_ACPI_STATUS(status);
584 } 587 }
@@ -627,8 +630,9 @@ acpi_rs_get_aei_method_data(struct acpi_namespace_node *node,
627 630
628 /* Execute the method, no parameters */ 631 /* Execute the method, no parameters */
629 632
630 status = acpi_ut_evaluate_object(node, METHOD_NAME__AEI, 633 status =
631 ACPI_BTYPE_BUFFER, &obj_desc); 634 acpi_ut_evaluate_object(node, METHOD_NAME__AEI, ACPI_BTYPE_BUFFER,
635 &obj_desc);
632 if (ACPI_FAILURE(status)) { 636 if (ACPI_FAILURE(status)) {
633 return_ACPI_STATUS(status); 637 return_ACPI_STATUS(status);
634 } 638 }
diff --git a/drivers/acpi/acpica/rsxface.c b/drivers/acpi/acpica/rsxface.c
index 1e8cd5723326..308bfd6bff5f 100644
--- a/drivers/acpi/acpica/rsxface.c
+++ b/drivers/acpi/acpica/rsxface.c
@@ -53,7 +53,7 @@ ACPI_MODULE_NAME("rsxface")
53 53
54/* Local macros for 16,32-bit to 64-bit conversion */ 54/* Local macros for 16,32-bit to 64-bit conversion */
55#define ACPI_COPY_FIELD(out, in, field) ((out)->field = (in)->field) 55#define ACPI_COPY_FIELD(out, in, field) ((out)->field = (in)->field)
56#define ACPI_COPY_ADDRESS(out, in) \ 56#define ACPI_COPY_ADDRESS(out, in) \
57 ACPI_COPY_FIELD(out, in, resource_type); \ 57 ACPI_COPY_FIELD(out, in, resource_type); \
58 ACPI_COPY_FIELD(out, in, producer_consumer); \ 58 ACPI_COPY_FIELD(out, in, producer_consumer); \
59 ACPI_COPY_FIELD(out, in, decode); \ 59 ACPI_COPY_FIELD(out, in, decode); \
diff --git a/drivers/acpi/acpica/tbdata.c b/drivers/acpi/acpica/tbdata.c
index 5c9d5abf1588..4a8152777767 100644
--- a/drivers/acpi/acpica/tbdata.c
+++ b/drivers/acpi/acpica/tbdata.c
@@ -407,6 +407,7 @@ acpi_tb_verify_temp_table(struct acpi_table_desc * table_desc, char *signature)
407 table_desc->signature.ascii : "????", 407 table_desc->signature.ascii : "????",
408 ACPI_FORMAT_UINT64(table_desc-> 408 ACPI_FORMAT_UINT64(table_desc->
409 address))); 409 address)));
410
410 goto invalidate_and_exit; 411 goto invalidate_and_exit;
411 } 412 }
412 } 413 }
diff --git a/drivers/acpi/acpica/tbinstal.c b/drivers/acpi/acpica/tbinstal.c
index 6319b42420c6..bd87801acedf 100644
--- a/drivers/acpi/acpica/tbinstal.c
+++ b/drivers/acpi/acpica/tbinstal.c
@@ -337,8 +337,8 @@ acpi_tb_install_standard_table(acpi_physical_address address,
337 * need to be unregistered when they are unloaded, and slots in the 337 * need to be unregistered when they are unloaded, and slots in the
338 * root table list should be reused when empty. 338 * root table list should be reused when empty.
339 */ 339 */
340 if (acpi_gbl_root_table_list.tables[i]. 340 if (acpi_gbl_root_table_list.tables[i].flags &
341 flags & ACPI_TABLE_IS_LOADED) { 341 ACPI_TABLE_IS_LOADED) {
342 342
343 /* Table is still loaded, this is an error */ 343 /* Table is still loaded, this is an error */
344 344
diff --git a/drivers/acpi/acpica/tbprint.c b/drivers/acpi/acpica/tbprint.c
index 709d5112fc16..d0d12596cfc9 100644
--- a/drivers/acpi/acpica/tbprint.c
+++ b/drivers/acpi/acpica/tbprint.c
@@ -76,6 +76,7 @@ static void acpi_tb_fix_string(char *string, acpi_size length)
76 if (!isprint((int)*string)) { 76 if (!isprint((int)*string)) {
77 *string = '?'; 77 *string = '?';
78 } 78 }
79
79 string++; 80 string++;
80 length--; 81 length--;
81 } 82 }
diff --git a/drivers/acpi/acpica/tbutils.c b/drivers/acpi/acpica/tbutils.c
index d8ddef38c947..72bcccf1b7c4 100644
--- a/drivers/acpi/acpica/tbutils.c
+++ b/drivers/acpi/acpica/tbutils.c
@@ -121,6 +121,7 @@ void acpi_tb_check_dsdt_header(void)
121 ACPI_BIOS_ERROR((AE_INFO, 121 ACPI_BIOS_ERROR((AE_INFO,
122 "The DSDT has been corrupted or replaced - " 122 "The DSDT has been corrupted or replaced - "
123 "old, new headers below")); 123 "old, new headers below"));
124
124 acpi_tb_print_table_header(0, &acpi_gbl_original_dsdt_header); 125 acpi_tb_print_table_header(0, &acpi_gbl_original_dsdt_header);
125 acpi_tb_print_table_header(0, acpi_gbl_DSDT); 126 acpi_tb_print_table_header(0, acpi_gbl_DSDT);
126 127
@@ -379,7 +380,6 @@ next_table:
379 } 380 }
380 381
381 acpi_os_unmap_memory(table, length); 382 acpi_os_unmap_memory(table, length);
382
383 return_ACPI_STATUS(AE_OK); 383 return_ACPI_STATUS(AE_OK);
384} 384}
385 385
diff --git a/drivers/acpi/acpica/tbxfload.c b/drivers/acpi/acpica/tbxfload.c
index 55ee14ca9418..9a7d72b75355 100644
--- a/drivers/acpi/acpica/tbxfload.c
+++ b/drivers/acpi/acpica/tbxfload.c
@@ -191,6 +191,7 @@ acpi_status acpi_tb_load_namespace(void)
191 "(%4.4s:%8.8s) while loading table", 191 "(%4.4s:%8.8s) while loading table",
192 table->signature.ascii, 192 table->signature.ascii,
193 table->pointer->oem_table_id)); 193 table->pointer->oem_table_id));
194
194 tables_failed++; 195 tables_failed++;
195 196
196 ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT, 197 ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,
diff --git a/drivers/acpi/acpica/utcopy.c b/drivers/acpi/acpica/utcopy.c
index 257221d452c8..ade8acf3f3a5 100644
--- a/drivers/acpi/acpica/utcopy.c
+++ b/drivers/acpi/acpica/utcopy.c
@@ -257,9 +257,9 @@ acpi_ut_copy_ielement_to_eelement(u8 object_type,
257 ACPI_FUNCTION_ENTRY(); 257 ACPI_FUNCTION_ENTRY();
258 258
259 this_index = state->pkg.index; 259 this_index = state->pkg.index;
260 target_object = (union acpi_object *) 260 target_object = (union acpi_object *)&((union acpi_object *)
261 &((union acpi_object *)(state->pkg.dest_object))->package. 261 (state->pkg.dest_object))->
262 elements[this_index]; 262 package.elements[this_index];
263 263
264 switch (object_type) { 264 switch (object_type) {
265 case ACPI_COPY_TYPE_SIMPLE: 265 case ACPI_COPY_TYPE_SIMPLE:
@@ -348,15 +348,15 @@ acpi_ut_copy_ipackage_to_epackage(union acpi_operand_object *internal_object,
348 * Free space begins right after the first package 348 * Free space begins right after the first package
349 */ 349 */
350 info.length = ACPI_ROUND_UP_TO_NATIVE_WORD(sizeof(union acpi_object)); 350 info.length = ACPI_ROUND_UP_TO_NATIVE_WORD(sizeof(union acpi_object));
351 info.free_space = 351 info.free_space = buffer +
352 buffer + ACPI_ROUND_UP_TO_NATIVE_WORD(sizeof(union acpi_object)); 352 ACPI_ROUND_UP_TO_NATIVE_WORD(sizeof(union acpi_object));
353 info.object_space = 0; 353 info.object_space = 0;
354 info.num_packages = 1; 354 info.num_packages = 1;
355 355
356 external_object->type = internal_object->common.type; 356 external_object->type = internal_object->common.type;
357 external_object->package.count = internal_object->package.count; 357 external_object->package.count = internal_object->package.count;
358 external_object->package.elements = ACPI_CAST_PTR(union acpi_object, 358 external_object->package.elements =
359 info.free_space); 359 ACPI_CAST_PTR(union acpi_object, info.free_space);
360 360
361 /* 361 /*
362 * Leave room for an array of ACPI_OBJECTS in the buffer 362 * Leave room for an array of ACPI_OBJECTS in the buffer
@@ -593,8 +593,8 @@ acpi_ut_copy_epackage_to_ipackage(union acpi_object *external_object,
593 package_elements = package_object->package.elements; 593 package_elements = package_object->package.elements;
594 594
595 /* 595 /*
596 * Recursive implementation. Probably ok, since nested external packages 596 * Recursive implementation. Probably ok, since nested external
597 * as parameters should be very rare. 597 * packages as parameters should be very rare.
598 */ 598 */
599 for (i = 0; i < external_object->package.count; i++) { 599 for (i = 0; i < external_object->package.count; i++) {
600 status = 600 status =
@@ -649,9 +649,8 @@ acpi_ut_copy_eobject_to_iobject(union acpi_object *external_object,
649 /* 649 /*
650 * Build a simple object (no nested objects) 650 * Build a simple object (no nested objects)
651 */ 651 */
652 status = 652 status = acpi_ut_copy_esimple_to_isimple(external_object,
653 acpi_ut_copy_esimple_to_isimple(external_object, 653 internal_object);
654 internal_object);
655 } 654 }
656 655
657 return_ACPI_STATUS(status); 656 return_ACPI_STATUS(status);
diff --git a/drivers/acpi/acpica/utdecode.c b/drivers/acpi/acpica/utdecode.c
index 7e14400d8020..3533135dbd4d 100644
--- a/drivers/acpi/acpica/utdecode.c
+++ b/drivers/acpi/acpica/utdecode.c
@@ -180,7 +180,8 @@ const char *acpi_ut_get_event_name(u32 event_id)
180 * 180 *
181 * The type ACPI_TYPE_ANY (Untyped) is used as a "don't care" when searching; 181 * The type ACPI_TYPE_ANY (Untyped) is used as a "don't care" when searching;
182 * when stored in a table it really means that we have thus far seen no 182 * when stored in a table it really means that we have thus far seen no
183 * evidence to indicate what type is actually going to be stored for this entry. 183 * evidence to indicate what type is actually going to be stored for this
184 & entry.
184 */ 185 */
185static const char acpi_gbl_bad_type[] = "UNDEFINED"; 186static const char acpi_gbl_bad_type[] = "UNDEFINED";
186 187
diff --git a/drivers/acpi/acpica/utdelete.c b/drivers/acpi/acpica/utdelete.c
index 1638312e3d8f..1afd7427a90c 100644
--- a/drivers/acpi/acpica/utdelete.c
+++ b/drivers/acpi/acpica/utdelete.c
@@ -209,6 +209,7 @@ static void acpi_ut_delete_internal_obj(union acpi_operand_object *object)
209 acpi_ut_delete_object_desc(object->method.mutex); 209 acpi_ut_delete_object_desc(object->method.mutex);
210 object->method.mutex = NULL; 210 object->method.mutex = NULL;
211 } 211 }
212
212 if (object->method.node) { 213 if (object->method.node) {
213 object->method.node = NULL; 214 object->method.node = NULL;
214 } 215 }
@@ -515,8 +516,8 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action)
515 } 516 }
516 517
517 /* 518 /*
518 * All sub-objects must have their reference count incremented also. 519 * All sub-objects must have their reference count incremented
519 * Different object types have different subobjects. 520 * also. Different object types have different subobjects.
520 */ 521 */
521 switch (object->common.type) { 522 switch (object->common.type) {
522 case ACPI_TYPE_DEVICE: 523 case ACPI_TYPE_DEVICE:
diff --git a/drivers/acpi/acpica/uterror.c b/drivers/acpi/acpica/uterror.c
index 9ef80f2828e3..f93bb90ea72a 100644
--- a/drivers/acpi/acpica/uterror.c
+++ b/drivers/acpi/acpica/uterror.c
@@ -217,8 +217,9 @@ acpi_ut_namespace_error(const char *module_name,
217 } else { 217 } else {
218 /* Convert path to external format */ 218 /* Convert path to external format */
219 219
220 status = acpi_ns_externalize_name(ACPI_UINT32_MAX, 220 status =
221 internal_name, NULL, &name); 221 acpi_ns_externalize_name(ACPI_UINT32_MAX, internal_name,
222 NULL, &name);
222 223
223 /* Print target name */ 224 /* Print target name */
224 225
@@ -271,9 +272,8 @@ acpi_ut_method_error(const char *module_name,
271 acpi_os_printf(ACPI_MSG_ERROR); 272 acpi_os_printf(ACPI_MSG_ERROR);
272 273
273 if (path) { 274 if (path) {
274 status = 275 status = acpi_ns_get_node(prefix_node, path,
275 acpi_ns_get_node(prefix_node, path, ACPI_NS_NO_UPSEARCH, 276 ACPI_NS_NO_UPSEARCH, &node);
276 &node);
277 if (ACPI_FAILURE(status)) { 277 if (ACPI_FAILURE(status)) {
278 acpi_os_printf("[Could not get node by pathname]"); 278 acpi_os_printf("[Could not get node by pathname]");
279 } 279 }
diff --git a/drivers/acpi/acpica/utfileio.c b/drivers/acpi/acpica/utfileio.c
index d435b7b7eb94..be49c719f1f5 100644
--- a/drivers/acpi/acpica/utfileio.c
+++ b/drivers/acpi/acpica/utfileio.c
@@ -106,6 +106,7 @@ acpi_ut_check_text_mode_corruption(u8 *table, u32 table_length, u32 file_length)
106 106
107 pairs++; 107 pairs++;
108 } 108 }
109
109 i++; 110 i++;
110 } 111 }
111 } 112 }
@@ -125,6 +126,7 @@ acpi_ut_check_text_mode_corruption(u8 *table, u32 table_length, u32 file_length)
125 acpi_os_printf("Table has been corrupted by text mode conversion\n"); 126 acpi_os_printf("Table has been corrupted by text mode conversion\n");
126 acpi_os_printf("All LFs (%u) were changed to CR/LF pairs\n", pairs); 127 acpi_os_printf("All LFs (%u) were changed to CR/LF pairs\n", pairs);
127 acpi_os_printf("Table cannot be repaired!\n"); 128 acpi_os_printf("Table cannot be repaired!\n");
129
128 return (AE_BAD_VALUE); 130 return (AE_BAD_VALUE);
129} 131}
130 132
diff --git a/drivers/acpi/acpica/utmath.c b/drivers/acpi/acpica/utmath.c
index f9ff100f0159..58b5d4236429 100644
--- a/drivers/acpi/acpica/utmath.c
+++ b/drivers/acpi/acpica/utmath.c
@@ -111,6 +111,7 @@ acpi_ut_short_divide(u64 dividend,
111 */ 111 */
112 ACPI_DIV_64_BY_32(0, dividend_ovl.part.hi, divisor, 112 ACPI_DIV_64_BY_32(0, dividend_ovl.part.hi, divisor,
113 quotient.part.hi, remainder32); 113 quotient.part.hi, remainder32);
114
114 ACPI_DIV_64_BY_32(remainder32, dividend_ovl.part.lo, divisor, 115 ACPI_DIV_64_BY_32(remainder32, dividend_ovl.part.lo, divisor,
115 quotient.part.lo, remainder32); 116 quotient.part.lo, remainder32);
116 117
@@ -179,6 +180,7 @@ acpi_ut_divide(u64 in_dividend,
179 */ 180 */
180 ACPI_DIV_64_BY_32(0, dividend.part.hi, divisor.part.lo, 181 ACPI_DIV_64_BY_32(0, dividend.part.hi, divisor.part.lo,
181 quotient.part.hi, partial1); 182 quotient.part.hi, partial1);
183
182 ACPI_DIV_64_BY_32(partial1, dividend.part.lo, divisor.part.lo, 184 ACPI_DIV_64_BY_32(partial1, dividend.part.lo, divisor.part.lo,
183 quotient.part.lo, remainder.part.lo); 185 quotient.part.lo, remainder.part.lo);
184 } 186 }
@@ -206,12 +208,12 @@ acpi_ut_divide(u64 in_dividend,
206 208
207 ACPI_DIV_64_BY_32(normalized_dividend.part.hi, 209 ACPI_DIV_64_BY_32(normalized_dividend.part.hi,
208 normalized_dividend.part.lo, 210 normalized_dividend.part.lo,
209 normalized_divisor.part.lo, 211 normalized_divisor.part.lo, quotient.part.lo,
210 quotient.part.lo, partial1); 212 partial1);
211 213
212 /* 214 /*
213 * The quotient is always 32 bits, and simply requires adjustment. 215 * The quotient is always 32 bits, and simply requires
214 * The 64-bit remainder must be generated. 216 * adjustment. The 64-bit remainder must be generated.
215 */ 217 */
216 partial1 = quotient.part.lo * divisor.part.hi; 218 partial1 = quotient.part.lo * divisor.part.hi;
217 partial2.full = (u64) quotient.part.lo * divisor.part.lo; 219 partial2.full = (u64) quotient.part.lo * divisor.part.lo;
diff --git a/drivers/acpi/acpica/utmisc.c b/drivers/acpi/acpica/utmisc.c
index bd4443bdcbad..eab1cfeb52cc 100644
--- a/drivers/acpi/acpica/utmisc.c
+++ b/drivers/acpi/acpica/utmisc.c
@@ -264,8 +264,8 @@ acpi_ut_walk_package_tree(union acpi_operand_object *source_object,
264 */ 264 */
265 if ((!this_source_obj) || 265 if ((!this_source_obj) ||
266 (ACPI_GET_DESCRIPTOR_TYPE(this_source_obj) != 266 (ACPI_GET_DESCRIPTOR_TYPE(this_source_obj) !=
267 ACPI_DESC_TYPE_OPERAND) 267 ACPI_DESC_TYPE_OPERAND) ||
268 || (this_source_obj->common.type != ACPI_TYPE_PACKAGE)) { 268 (this_source_obj->common.type != ACPI_TYPE_PACKAGE)) {
269 status = 269 status =
270 walk_callback(ACPI_COPY_TYPE_SIMPLE, 270 walk_callback(ACPI_COPY_TYPE_SIMPLE,
271 this_source_obj, state, context); 271 this_source_obj, state, context);
@@ -318,9 +318,10 @@ acpi_ut_walk_package_tree(union acpi_operand_object *source_object,
318 * The callback above returned a new target package object. 318 * The callback above returned a new target package object.
319 */ 319 */
320 acpi_ut_push_generic_state(&state_list, state); 320 acpi_ut_push_generic_state(&state_list, state);
321 state = acpi_ut_create_pkg_state(this_source_obj, 321 state =
322 state->pkg. 322 acpi_ut_create_pkg_state(this_source_obj,
323 this_target_obj, 0); 323 state->pkg.this_target_obj,
324 0);
324 if (!state) { 325 if (!state) {
325 326
326 /* Free any stacked Update State objects */ 327 /* Free any stacked Update State objects */
diff --git a/drivers/acpi/acpica/utmutex.c b/drivers/acpi/acpica/utmutex.c
index ea0c207ff572..038ff849ad20 100644
--- a/drivers/acpi/acpica/utmutex.c
+++ b/drivers/acpi/acpica/utmutex.c
@@ -273,8 +273,9 @@ acpi_status acpi_ut_acquire_mutex(acpi_mutex_handle mutex_id)
273 (u32)this_thread_id, 273 (u32)this_thread_id,
274 acpi_ut_get_mutex_name(mutex_id))); 274 acpi_ut_get_mutex_name(mutex_id)));
275 275
276 status = acpi_os_acquire_mutex(acpi_gbl_mutex_info[mutex_id].mutex, 276 status =
277 ACPI_WAIT_FOREVER); 277 acpi_os_acquire_mutex(acpi_gbl_mutex_info[mutex_id].mutex,
278 ACPI_WAIT_FOREVER);
278 if (ACPI_SUCCESS(status)) { 279 if (ACPI_SUCCESS(status)) {
279 ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, 280 ACPI_DEBUG_PRINT((ACPI_DB_MUTEX,
280 "Thread %u acquired Mutex [%s]\n", 281 "Thread %u acquired Mutex [%s]\n",
diff --git a/drivers/acpi/acpica/utnonansi.c b/drivers/acpi/acpica/utnonansi.c
index 1d5f6b17b766..9c3cadc27fb8 100644
--- a/drivers/acpi/acpica/utnonansi.c
+++ b/drivers/acpi/acpica/utnonansi.c
@@ -282,8 +282,8 @@ acpi_status acpi_ut_strtoul64(char *string, u32 base, u64 *ret_integer)
282 282
283 /* Divide the digit into the correct position */ 283 /* Divide the digit into the correct position */
284 284
285 (void)acpi_ut_short_divide((dividend - (u64)this_digit), 285 (void)acpi_ut_short_divide((dividend - (u64)this_digit), base,
286 base, &quotient, NULL); 286 &quotient, NULL);
287 287
288 if (return_value > quotient) { 288 if (return_value > quotient) {
289 if (to_integer_op) { 289 if (to_integer_op) {
diff --git a/drivers/acpi/acpica/utobject.c b/drivers/acpi/acpica/utobject.c
index c7e11ccb09ba..787eccf6a1d5 100644
--- a/drivers/acpi/acpica/utobject.c
+++ b/drivers/acpi/acpica/utobject.c
@@ -112,9 +112,9 @@ union acpi_operand_object *acpi_ut_create_internal_object_dbg(const char
112 112
113 /* These types require a secondary object */ 113 /* These types require a secondary object */
114 114
115 second_object = acpi_ut_allocate_object_desc_dbg(module_name, 115 second_object =
116 line_number, 116 acpi_ut_allocate_object_desc_dbg(module_name, line_number,
117 component_id); 117 component_id);
118 if (!second_object) { 118 if (!second_object) {
119 acpi_ut_delete_object_desc(object); 119 acpi_ut_delete_object_desc(object);
120 return_PTR(NULL); 120 return_PTR(NULL);
@@ -254,6 +254,7 @@ union acpi_operand_object *acpi_ut_create_buffer_object(acpi_size buffer_size)
254 if (!buffer) { 254 if (!buffer) {
255 ACPI_ERROR((AE_INFO, "Could not allocate size %u", 255 ACPI_ERROR((AE_INFO, "Could not allocate size %u",
256 (u32)buffer_size)); 256 (u32)buffer_size));
257
257 acpi_ut_remove_reference(buffer_desc); 258 acpi_ut_remove_reference(buffer_desc);
258 return_PTR(NULL); 259 return_PTR(NULL);
259 } 260 }
@@ -306,6 +307,7 @@ union acpi_operand_object *acpi_ut_create_string_object(acpi_size string_size)
306 if (!string) { 307 if (!string) {
307 ACPI_ERROR((AE_INFO, "Could not allocate size %u", 308 ACPI_ERROR((AE_INFO, "Could not allocate size %u",
308 (u32)string_size)); 309 (u32)string_size));
310
309 acpi_ut_remove_reference(string_desc); 311 acpi_ut_remove_reference(string_desc);
310 return_PTR(NULL); 312 return_PTR(NULL);
311 } 313 }
@@ -649,8 +651,9 @@ acpi_ut_get_package_object_size(union acpi_operand_object *internal_object,
649 info.object_space = 0; 651 info.object_space = 0;
650 info.num_packages = 1; 652 info.num_packages = 1;
651 653
652 status = acpi_ut_walk_package_tree(internal_object, NULL, 654 status =
653 acpi_ut_get_element_length, &info); 655 acpi_ut_walk_package_tree(internal_object, NULL,
656 acpi_ut_get_element_length, &info);
654 if (ACPI_FAILURE(status)) { 657 if (ACPI_FAILURE(status)) {
655 return_ACPI_STATUS(status); 658 return_ACPI_STATUS(status);
656 } 659 }
@@ -660,7 +663,8 @@ acpi_ut_get_package_object_size(union acpi_operand_object *internal_object,
660 * just add the length of the package objects themselves. 663 * just add the length of the package objects themselves.
661 * Round up to the next machine word. 664 * Round up to the next machine word.
662 */ 665 */
663 info.length += ACPI_ROUND_UP_TO_NATIVE_WORD(sizeof(union acpi_object)) * 666 info.length +=
667 ACPI_ROUND_UP_TO_NATIVE_WORD(sizeof(union acpi_object)) *
664 (acpi_size) info.num_packages; 668 (acpi_size) info.num_packages;
665 669
666 /* Return the total package length */ 670 /* Return the total package length */
@@ -692,8 +696,8 @@ acpi_ut_get_object_size(union acpi_operand_object *internal_object,
692 ACPI_FUNCTION_ENTRY(); 696 ACPI_FUNCTION_ENTRY();
693 697
694 if ((ACPI_GET_DESCRIPTOR_TYPE(internal_object) == 698 if ((ACPI_GET_DESCRIPTOR_TYPE(internal_object) ==
695 ACPI_DESC_TYPE_OPERAND) 699 ACPI_DESC_TYPE_OPERAND) &&
696 && (internal_object->common.type == ACPI_TYPE_PACKAGE)) { 700 (internal_object->common.type == ACPI_TYPE_PACKAGE)) {
697 status = 701 status =
698 acpi_ut_get_package_object_size(internal_object, 702 acpi_ut_get_package_object_size(internal_object,
699 obj_length); 703 obj_length);
diff --git a/drivers/acpi/acpica/utosi.c b/drivers/acpi/acpica/utosi.c
index 8f3d203aed79..0809d73193e1 100644
--- a/drivers/acpi/acpica/utosi.c
+++ b/drivers/acpi/acpica/utosi.c
@@ -269,9 +269,10 @@ acpi_status acpi_ut_remove_interface(acpi_string interface_name)
269 previous_interface = next_interface = acpi_gbl_supported_interfaces; 269 previous_interface = next_interface = acpi_gbl_supported_interfaces;
270 while (next_interface) { 270 while (next_interface) {
271 if (!strcmp(interface_name, next_interface->name)) { 271 if (!strcmp(interface_name, next_interface->name)) {
272 272 /*
273 /* Found: name is in either the static list or was added at runtime */ 273 * Found: name is in either the static list
274 274 * or was added at runtime
275 */
275 if (next_interface->flags & ACPI_OSI_DYNAMIC) { 276 if (next_interface->flags & ACPI_OSI_DYNAMIC) {
276 277
277 /* Interface was added dynamically, remove and free it */ 278 /* Interface was added dynamically, remove and free it */
@@ -288,8 +289,8 @@ acpi_status acpi_ut_remove_interface(acpi_string interface_name)
288 ACPI_FREE(next_interface); 289 ACPI_FREE(next_interface);
289 } else { 290 } else {
290 /* 291 /*
291 * Interface is in static list. If marked invalid, then it 292 * Interface is in static list. If marked invalid, then
292 * does not actually exist. Else, mark it invalid. 293 * it does not actually exist. Else, mark it invalid.
293 */ 294 */
294 if (next_interface->flags & ACPI_OSI_INVALID) { 295 if (next_interface->flags & ACPI_OSI_INVALID) {
295 return (AE_NOT_EXIST); 296 return (AE_NOT_EXIST);
diff --git a/drivers/acpi/acpica/utownerid.c b/drivers/acpi/acpica/utownerid.c
index 2959217067cb..ebb811c43c89 100644
--- a/drivers/acpi/acpica/utownerid.c
+++ b/drivers/acpi/acpica/utownerid.c
@@ -73,8 +73,8 @@ acpi_status acpi_ut_allocate_owner_id(acpi_owner_id * owner_id)
73 /* Guard against multiple allocations of ID to the same location */ 73 /* Guard against multiple allocations of ID to the same location */
74 74
75 if (*owner_id) { 75 if (*owner_id) {
76 ACPI_ERROR((AE_INFO, "Owner ID [0x%2.2X] already exists", 76 ACPI_ERROR((AE_INFO,
77 *owner_id)); 77 "Owner ID [0x%2.2X] already exists", *owner_id));
78 return_ACPI_STATUS(AE_ALREADY_EXISTS); 78 return_ACPI_STATUS(AE_ALREADY_EXISTS);
79 } 79 }
80 80
@@ -87,8 +87,8 @@ acpi_status acpi_ut_allocate_owner_id(acpi_owner_id * owner_id)
87 87
88 /* 88 /*
89 * Find a free owner ID, cycle through all possible IDs on repeated 89 * Find a free owner ID, cycle through all possible IDs on repeated
90 * allocations. (ACPI_NUM_OWNERID_MASKS + 1) because first index may have 90 * allocations. (ACPI_NUM_OWNERID_MASKS + 1) because first index
91 * to be scanned twice. 91 * may have to be scanned twice.
92 */ 92 */
93 for (i = 0, j = acpi_gbl_last_owner_id_index; 93 for (i = 0, j = acpi_gbl_last_owner_id_index;
94 i < (ACPI_NUM_OWNERID_MASKS + 1); i++, j++) { 94 i < (ACPI_NUM_OWNERID_MASKS + 1); i++, j++) {
@@ -141,8 +141,8 @@ acpi_status acpi_ut_allocate_owner_id(acpi_owner_id * owner_id)
141 * they are released when a table is unloaded or a method completes 141 * they are released when a table is unloaded or a method completes
142 * execution. 142 * execution.
143 * 143 *
144 * If this error happens, there may be very deep nesting of invoked control 144 * If this error happens, there may be very deep nesting of invoked
145 * methods, or there may be a bug where the IDs are not released. 145 * control methods, or there may be a bug where the IDs are not released.
146 */ 146 */
147 status = AE_OWNER_ID_LIMIT; 147 status = AE_OWNER_ID_LIMIT;
148 ACPI_ERROR((AE_INFO, 148 ACPI_ERROR((AE_INFO,
diff --git a/drivers/acpi/acpica/utpredef.c b/drivers/acpi/acpica/utpredef.c
index 97898ed71b4b..9f8e415bf0af 100644
--- a/drivers/acpi/acpica/utpredef.c
+++ b/drivers/acpi/acpica/utpredef.c
@@ -225,8 +225,10 @@ const union acpi_predefined_info *acpi_ut_match_resource_name(char *name)
225{ 225{
226 const union acpi_predefined_info *this_name; 226 const union acpi_predefined_info *this_name;
227 227
228 /* Quick check for a predefined name, first character must be underscore */ 228 /*
229 229 * Quick check for a predefined name, first character must
230 * be underscore
231 */
230 if (name[0] != '_') { 232 if (name[0] != '_') {
231 return (NULL); 233 return (NULL);
232 } 234 }
diff --git a/drivers/acpi/acpica/utprint.c b/drivers/acpi/acpica/utprint.c
index b26297c5de49..01f04da779c5 100644
--- a/drivers/acpi/acpica/utprint.c
+++ b/drivers/acpi/acpica/utprint.c
@@ -314,8 +314,9 @@ static char *acpi_ut_format_number(char *string,
314 if (need_prefix) { 314 if (need_prefix) {
315 string = acpi_ut_bound_string_output(string, end, '0'); 315 string = acpi_ut_bound_string_output(string, end, '0');
316 if (base == 16) { 316 if (base == 16) {
317 string = acpi_ut_bound_string_output(string, end, 317 string =
318 upper ? 'X' : 'x'); 318 acpi_ut_bound_string_output(string, end,
319 upper ? 'X' : 'x');
319 } 320 }
320 } 321 }
321 if (!(type & ACPI_FORMAT_LEFT)) { 322 if (!(type & ACPI_FORMAT_LEFT)) {
@@ -400,6 +401,7 @@ acpi_ut_vsnprintf(char *string,
400 } else { 401 } else {
401 break; 402 break;
402 } 403 }
404
403 } while (1); 405 } while (1);
404 406
405 /* Process width */ 407 /* Process width */
@@ -429,6 +431,7 @@ acpi_ut_vsnprintf(char *string,
429 ++format; 431 ++format;
430 precision = va_arg(args, int); 432 precision = va_arg(args, int);
431 } 433 }
434
432 if (precision < 0) { 435 if (precision < 0) {
433 precision = 0; 436 precision = 0;
434 } 437 }
@@ -488,10 +491,12 @@ acpi_ut_vsnprintf(char *string,
488 ' '); 491 ' ');
489 } 492 }
490 } 493 }
494
491 for (i = 0; i < length; ++i) { 495 for (i = 0; i < length; ++i) {
492 pos = acpi_ut_bound_string_output(pos, end, *s); 496 pos = acpi_ut_bound_string_output(pos, end, *s);
493 ++s; 497 ++s;
494 } 498 }
499
495 while (length < width--) { 500 while (length < width--) {
496 pos = 501 pos =
497 acpi_ut_bound_string_output(pos, end, ' '); 502 acpi_ut_bound_string_output(pos, end, ' ');
@@ -529,9 +534,9 @@ acpi_ut_vsnprintf(char *string,
529 } 534 }
530 535
531 p = va_arg(args, void *); 536 p = va_arg(args, void *);
532 pos = acpi_ut_format_number(pos, end, 537 pos =
533 ACPI_TO_INTEGER(p), 16, 538 acpi_ut_format_number(pos, end, ACPI_TO_INTEGER(p),
534 width, precision, type); 539 16, width, precision, type);
535 continue; 540 continue;
536 541
537 default: 542 default:
diff --git a/drivers/acpi/acpica/utresrc.c b/drivers/acpi/acpica/utresrc.c
index b3505dbc715e..d50b41c4daa7 100644
--- a/drivers/acpi/acpica/utresrc.c
+++ b/drivers/acpi/acpica/utresrc.c
@@ -441,8 +441,8 @@ acpi_ut_walk_aml_resources(struct acpi_walk_state *walk_state,
441 acpi_ut_validate_resource(walk_state, aml, &resource_index); 441 acpi_ut_validate_resource(walk_state, aml, &resource_index);
442 if (ACPI_FAILURE(status)) { 442 if (ACPI_FAILURE(status)) {
443 /* 443 /*
444 * Exit on failure. Cannot continue because the descriptor length 444 * Exit on failure. Cannot continue because the descriptor
445 * may be bogus also. 445 * length may be bogus also.
446 */ 446 */
447 return_ACPI_STATUS(status); 447 return_ACPI_STATUS(status);
448 } 448 }
@@ -568,8 +568,8 @@ acpi_ut_validate_resource(struct acpi_walk_state *walk_state,
568 } 568 }
569 569
570 /* 570 /*
571 * Check validity of the resource type, via acpi_gbl_resource_types. Zero 571 * Check validity of the resource type, via acpi_gbl_resource_types.
572 * indicates an invalid resource. 572 * Zero indicates an invalid resource.
573 */ 573 */
574 if (!acpi_gbl_resource_types[resource_index]) { 574 if (!acpi_gbl_resource_types[resource_index]) {
575 goto invalid_resource; 575 goto invalid_resource;
diff --git a/drivers/acpi/acpica/utstate.c b/drivers/acpi/acpica/utstate.c
index f201171c5dda..0050e00997ed 100644
--- a/drivers/acpi/acpica/utstate.c
+++ b/drivers/acpi/acpica/utstate.c
@@ -246,6 +246,7 @@ union acpi_generic_state *acpi_ut_create_pkg_state(void *internal_object,
246 state->pkg.dest_object = external_object; 246 state->pkg.dest_object = external_object;
247 state->pkg.index = index; 247 state->pkg.index = index;
248 state->pkg.num_packages = 1; 248 state->pkg.num_packages = 1;
249
249 return (state); 250 return (state);
250} 251}
251 252
@@ -279,6 +280,7 @@ union acpi_generic_state *acpi_ut_create_control_state(void)
279 280
280 state->common.descriptor_type = ACPI_DESC_TYPE_STATE_CONTROL; 281 state->common.descriptor_type = ACPI_DESC_TYPE_STATE_CONTROL;
281 state->common.state = ACPI_CONTROL_CONDITIONAL_EXECUTING; 282 state->common.state = ACPI_CONTROL_CONDITIONAL_EXECUTING;
283
282 return (state); 284 return (state);
283} 285}
284 286
@@ -304,5 +306,6 @@ void acpi_ut_delete_generic_state(union acpi_generic_state *state)
304 if (state) { 306 if (state) {
305 (void)acpi_os_release_object(acpi_gbl_state_cache, state); 307 (void)acpi_os_release_object(acpi_gbl_state_cache, state);
306 } 308 }
309
307 return; 310 return;
308} 311}
diff --git a/drivers/acpi/acpica/utstring.c b/drivers/acpi/acpica/utstring.c
index 4ddd105d9741..0c2e2d23aa8d 100644
--- a/drivers/acpi/acpica/utstring.c
+++ b/drivers/acpi/acpica/utstring.c
@@ -135,6 +135,7 @@ void acpi_ut_print_string(char *string, u16 max_length)
135 break; 135 break;
136 } 136 }
137 } 137 }
138
138 acpi_os_printf("\""); 139 acpi_os_printf("\"");
139 140
140 if (i == max_length && string[i]) { 141 if (i == max_length && string[i]) {
diff --git a/drivers/acpi/acpica/uttrack.c b/drivers/acpi/acpica/uttrack.c
index 9a7dc8196a5d..ea698e98442e 100644
--- a/drivers/acpi/acpica/uttrack.c
+++ b/drivers/acpi/acpica/uttrack.c
@@ -150,9 +150,9 @@ void *acpi_ut_allocate_and_track(acpi_size size,
150 return (NULL); 150 return (NULL);
151 } 151 }
152 152
153 status = acpi_ut_track_allocation(allocation, size, 153 status =
154 ACPI_MEM_MALLOC, component, module, 154 acpi_ut_track_allocation(allocation, size, ACPI_MEM_MALLOC,
155 line); 155 component, module, line);
156 if (ACPI_FAILURE(status)) { 156 if (ACPI_FAILURE(status)) {
157 acpi_os_free(allocation); 157 acpi_os_free(allocation);
158 return (NULL); 158 return (NULL);
@@ -161,6 +161,7 @@ void *acpi_ut_allocate_and_track(acpi_size size,
161 acpi_gbl_global_list->total_allocated++; 161 acpi_gbl_global_list->total_allocated++;
162 acpi_gbl_global_list->total_size += (u32)size; 162 acpi_gbl_global_list->total_size += (u32)size;
163 acpi_gbl_global_list->current_total_size += (u32)size; 163 acpi_gbl_global_list->current_total_size += (u32)size;
164
164 if (acpi_gbl_global_list->current_total_size > 165 if (acpi_gbl_global_list->current_total_size >
165 acpi_gbl_global_list->max_occupied) { 166 acpi_gbl_global_list->max_occupied) {
166 acpi_gbl_global_list->max_occupied = 167 acpi_gbl_global_list->max_occupied =
@@ -223,6 +224,7 @@ void *acpi_ut_allocate_zeroed_and_track(acpi_size size,
223 acpi_gbl_global_list->total_allocated++; 224 acpi_gbl_global_list->total_allocated++;
224 acpi_gbl_global_list->total_size += (u32)size; 225 acpi_gbl_global_list->total_size += (u32)size;
225 acpi_gbl_global_list->current_total_size += (u32)size; 226 acpi_gbl_global_list->current_total_size += (u32)size;
227
226 if (acpi_gbl_global_list->current_total_size > 228 if (acpi_gbl_global_list->current_total_size >
227 acpi_gbl_global_list->max_occupied) { 229 acpi_gbl_global_list->max_occupied) {
228 acpi_gbl_global_list->max_occupied = 230 acpi_gbl_global_list->max_occupied =
@@ -269,8 +271,8 @@ acpi_ut_free_and_track(void *allocation,
269 acpi_gbl_global_list->total_freed++; 271 acpi_gbl_global_list->total_freed++;
270 acpi_gbl_global_list->current_total_size -= debug_block->size; 272 acpi_gbl_global_list->current_total_size -= debug_block->size;
271 273
272 status = acpi_ut_remove_allocation(debug_block, 274 status =
273 component, module, line); 275 acpi_ut_remove_allocation(debug_block, component, module, line);
274 if (ACPI_FAILURE(status)) { 276 if (ACPI_FAILURE(status)) {
275 ACPI_EXCEPTION((AE_INFO, status, "Could not free memory")); 277 ACPI_EXCEPTION((AE_INFO, status, "Could not free memory"));
276 } 278 }
@@ -525,35 +527,35 @@ void acpi_ut_dump_allocation_info(void)
525 527
526/* 528/*
527 ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES, 529 ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
528 ("%30s: %4d (%3d Kb)\n", "Current allocations", 530 ("%30s: %4d (%3d Kb)\n", "Current allocations",
529 mem_list->current_count, 531 mem_list->current_count,
530 ROUND_UP_TO_1K (mem_list->current_size))); 532 ROUND_UP_TO_1K (mem_list->current_size)));
531 533
532 ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES, 534 ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
533 ("%30s: %4d (%3d Kb)\n", "Max concurrent allocations", 535 ("%30s: %4d (%3d Kb)\n", "Max concurrent allocations",
534 mem_list->max_concurrent_count, 536 mem_list->max_concurrent_count,
535 ROUND_UP_TO_1K (mem_list->max_concurrent_size))); 537 ROUND_UP_TO_1K (mem_list->max_concurrent_size)));
536 538
537 ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES, 539 ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
538 ("%30s: %4d (%3d Kb)\n", "Total (all) internal objects", 540 ("%30s: %4d (%3d Kb)\n", "Total (all) internal objects",
539 running_object_count, 541 running_object_count,
540 ROUND_UP_TO_1K (running_object_size))); 542 ROUND_UP_TO_1K (running_object_size)));
541 543
542 ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES, 544 ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
543 ("%30s: %4d (%3d Kb)\n", "Total (all) allocations", 545 ("%30s: %4d (%3d Kb)\n", "Total (all) allocations",
544 running_alloc_count, 546 running_alloc_count,
545 ROUND_UP_TO_1K (running_alloc_size))); 547 ROUND_UP_TO_1K (running_alloc_size)));
546 548
547 ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES, 549 ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
548 ("%30s: %4d (%3d Kb)\n", "Current Nodes", 550 ("%30s: %4d (%3d Kb)\n", "Current Nodes",
549 acpi_gbl_current_node_count, 551 acpi_gbl_current_node_count,
550 ROUND_UP_TO_1K (acpi_gbl_current_node_size))); 552 ROUND_UP_TO_1K (acpi_gbl_current_node_size)));
551 553
552 ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES, 554 ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
553 ("%30s: %4d (%3d Kb)\n", "Max Nodes", 555 ("%30s: %4d (%3d Kb)\n", "Max Nodes",
554 acpi_gbl_max_concurrent_node_count, 556 acpi_gbl_max_concurrent_node_count,
555 ROUND_UP_TO_1K ((acpi_gbl_max_concurrent_node_count * 557 ROUND_UP_TO_1K ((acpi_gbl_max_concurrent_node_count *
556 sizeof (struct acpi_namespace_node))))); 558 sizeof (struct acpi_namespace_node)))));
557*/ 559*/
558 return_VOID; 560 return_VOID;
559} 561}
diff --git a/drivers/acpi/acpica/utxface.c b/drivers/acpi/acpica/utxface.c
index f9c8f9ce1f0f..9f3f0a1591f6 100644
--- a/drivers/acpi/acpica/utxface.c
+++ b/drivers/acpi/acpica/utxface.c
@@ -154,7 +154,6 @@ acpi_status acpi_get_system_info(struct acpi_buffer * out_buffer)
154 * Populate the return buffer 154 * Populate the return buffer
155 */ 155 */
156 info_ptr = (struct acpi_system_info *)out_buffer->pointer; 156 info_ptr = (struct acpi_system_info *)out_buffer->pointer;
157
158 info_ptr->acpi_ca_version = ACPI_CA_VERSION; 157 info_ptr->acpi_ca_version = ACPI_CA_VERSION;
159 158
160 /* System flags (ACPI capabilities) */ 159 /* System flags (ACPI capabilities) */
@@ -216,7 +215,6 @@ acpi_status acpi_get_statistics(struct acpi_statistics *stats)
216 /* Other counters */ 215 /* Other counters */
217 216
218 stats->method_count = acpi_method_count; 217 stats->method_count = acpi_method_count;
219
220 return_ACPI_STATUS(AE_OK); 218 return_ACPI_STATUS(AE_OK);
221} 219}
222 220
diff --git a/drivers/acpi/acpica/utxferror.c b/drivers/acpi/acpica/utxferror.c
index 98d578753101..f6cbaf451dbf 100644
--- a/drivers/acpi/acpica/utxferror.c
+++ b/drivers/acpi/acpica/utxferror.c
@@ -117,6 +117,7 @@ acpi_exception(const char *module_name,
117 acpi_os_printf(ACPI_MSG_EXCEPTION "%s, ", 117 acpi_os_printf(ACPI_MSG_EXCEPTION "%s, ",
118 acpi_format_exception(status)); 118 acpi_format_exception(status));
119 } 119 }
120
120 va_start(arg_list, format); 121 va_start(arg_list, format);
121 acpi_os_vprintf(format, arg_list); 122 acpi_os_vprintf(format, arg_list);
122 ACPI_MSG_SUFFIX; 123 ACPI_MSG_SUFFIX;
diff --git a/drivers/acpi/acpica/utxfmutex.c b/drivers/acpi/acpica/utxfmutex.c
index f2606af3364c..95d6123a7010 100644
--- a/drivers/acpi/acpica/utxfmutex.c
+++ b/drivers/acpi/acpica/utxfmutex.c
@@ -89,9 +89,9 @@ acpi_ut_get_mutex_object(acpi_handle handle,
89 89
90 mutex_node = handle; 90 mutex_node = handle;
91 if (pathname != NULL) { 91 if (pathname != NULL) {
92 status = acpi_get_handle(handle, pathname, 92 status =
93 ACPI_CAST_PTR(acpi_handle, 93 acpi_get_handle(handle, pathname,
94 &mutex_node)); 94 ACPI_CAST_PTR(acpi_handle, &mutex_node));
95 if (ACPI_FAILURE(status)) { 95 if (ACPI_FAILURE(status)) {
96 return (status); 96 return (status);
97 } 97 }