aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2009-03-05 21:05:18 -0500
committerLen Brown <len.brown@intel.com>2009-03-27 12:11:02 -0400
commitd4913dc6d0c680aa106d1d80b5ad2a9325367afd (patch)
tree4ce6e658b21a2bc69e7c57caa6f7dfa1ff8ec53b /drivers
parent768aaaf196e8a40f5cfc792d9d365795cc52ed13 (diff)
ACPICA: Formatting update - no functional changes
Split long lines, update comments. Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lin Ming <ming.m.lin@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/acpi/acpica/evgpe.c7
-rw-r--r--drivers/acpi/acpica/evgpeblk.c64
-rw-r--r--drivers/acpi/acpica/evmisc.c11
-rw-r--r--drivers/acpi/acpica/evregion.c3
-rw-r--r--drivers/acpi/acpica/evrgnini.c22
-rw-r--r--drivers/acpi/acpica/evxface.c3
-rw-r--r--drivers/acpi/acpica/evxfregn.c3
-rw-r--r--drivers/acpi/acpica/hwacpi.c3
-rw-r--r--drivers/acpi/acpica/hwgpe.c21
-rw-r--r--drivers/acpi/acpica/hwsleep.c14
-rw-r--r--drivers/acpi/acpica/hwxface.c3
-rw-r--r--drivers/acpi/acpica/nsaccess.c51
-rw-r--r--drivers/acpi/acpica/nsalloc.c24
-rw-r--r--drivers/acpi/acpica/nsdump.c16
-rw-r--r--drivers/acpi/acpica/nsinit.c19
-rw-r--r--drivers/acpi/acpica/nsload.c4
-rw-r--r--drivers/acpi/acpica/nsparse.c10
-rw-r--r--drivers/acpi/acpica/nspredef.c6
-rw-r--r--drivers/acpi/acpica/nssearch.c14
-rw-r--r--drivers/acpi/acpica/nsutils.c25
-rw-r--r--drivers/acpi/acpica/nswalk.c12
21 files changed, 161 insertions, 174 deletions
diff --git a/drivers/acpi/acpica/evgpe.c b/drivers/acpi/acpica/evgpe.c
index f345ced36477..b9d8ee69ca6c 100644
--- a/drivers/acpi/acpica/evgpe.c
+++ b/drivers/acpi/acpica/evgpe.c
@@ -88,10 +88,10 @@ acpi_ev_set_gpe_type(struct acpi_gpe_event_info *gpe_event_info, u8 type)
88 88
89 status = acpi_ev_disable_gpe(gpe_event_info); 89 status = acpi_ev_disable_gpe(gpe_event_info);
90 90
91 /* Type was validated above */ 91 /* Clear the type bits and insert the new Type */
92 92
93 gpe_event_info->flags &= ~ACPI_GPE_TYPE_MASK; /* Clear type bits */ 93 gpe_event_info->flags &= ~ACPI_GPE_TYPE_MASK;
94 gpe_event_info->flags |= type; /* Insert type */ 94 gpe_event_info->flags |= type;
95 return_ACPI_STATUS(status); 95 return_ACPI_STATUS(status);
96} 96}
97 97
@@ -122,6 +122,7 @@ acpi_ev_update_gpe_enable_masks(struct acpi_gpe_event_info *gpe_event_info,
122 if (!gpe_register_info) { 122 if (!gpe_register_info) {
123 return_ACPI_STATUS(AE_NOT_EXIST); 123 return_ACPI_STATUS(AE_NOT_EXIST);
124 } 124 }
125
125 register_bit = (u8) 126 register_bit = (u8)
126 (1 << 127 (1 <<
127 (gpe_event_info->gpe_number - gpe_register_info->base_gpe_number)); 128 (gpe_event_info->gpe_number - gpe_register_info->base_gpe_number));
diff --git a/drivers/acpi/acpica/evgpeblk.c b/drivers/acpi/acpica/evgpeblk.c
index f7b3d2af9401..7b3463639422 100644
--- a/drivers/acpi/acpica/evgpeblk.c
+++ b/drivers/acpi/acpica/evgpeblk.c
@@ -104,9 +104,9 @@ u8 acpi_ev_valid_gpe_event(struct acpi_gpe_event_info *gpe_event_info)
104 104
105 while (gpe_block) { 105 while (gpe_block) {
106 if ((&gpe_block->event_info[0] <= gpe_event_info) && 106 if ((&gpe_block->event_info[0] <= gpe_event_info) &&
107 (&gpe_block-> 107 (&gpe_block->event_info[((acpi_size)
108 event_info[((acpi_size) gpe_block-> 108 gpe_block->
109 register_count) * 8] > 109 register_count) * 8] >
110 gpe_event_info)) { 110 gpe_event_info)) {
111 return (TRUE); 111 return (TRUE);
112 } 112 }
@@ -210,10 +210,9 @@ acpi_ev_delete_gpe_handlers(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
210 /* Now look at the individual GPEs in this byte register */ 210 /* Now look at the individual GPEs in this byte register */
211 211
212 for (j = 0; j < ACPI_GPE_REGISTER_WIDTH; j++) { 212 for (j = 0; j < ACPI_GPE_REGISTER_WIDTH; j++) {
213 gpe_event_info = 213 gpe_event_info = &gpe_block->event_info[((acpi_size) i *
214 &gpe_block-> 214 ACPI_GPE_REGISTER_WIDTH)
215 event_info[((acpi_size) i * 215 + j];
216 ACPI_GPE_REGISTER_WIDTH) + j];
217 216
218 if ((gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) == 217 if ((gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) ==
219 ACPI_GPE_DISPATCH_HANDLER) { 218 ACPI_GPE_DISPATCH_HANDLER) {
@@ -293,8 +292,8 @@ acpi_ev_save_method_info(acpi_handle obj_handle,
293 /* Unknown method type, just ignore it! */ 292 /* Unknown method type, just ignore it! */
294 293
295 ACPI_DEBUG_PRINT((ACPI_DB_LOAD, 294 ACPI_DEBUG_PRINT((ACPI_DB_LOAD,
296 "Ignoring unknown GPE method type: %s (name not of form _Lxx or _Exx)", 295 "Ignoring unknown GPE method type: %s "
297 name)); 296 "(name not of form _Lxx or _Exx)", name));
298 return_ACPI_STATUS(AE_OK); 297 return_ACPI_STATUS(AE_OK);
299 } 298 }
300 299
@@ -306,17 +305,16 @@ acpi_ev_save_method_info(acpi_handle obj_handle,
306 /* Conversion failed; invalid method, just ignore it */ 305 /* Conversion failed; invalid method, just ignore it */
307 306
308 ACPI_DEBUG_PRINT((ACPI_DB_LOAD, 307 ACPI_DEBUG_PRINT((ACPI_DB_LOAD,
309 "Could not extract GPE number from name: %s (name is not of form _Lxx or _Exx)", 308 "Could not extract GPE number from name: %s "
310 name)); 309 "(name is not of form _Lxx or _Exx)", name));
311 return_ACPI_STATUS(AE_OK); 310 return_ACPI_STATUS(AE_OK);
312 } 311 }
313 312
314 /* Ensure that we have a valid GPE number for this GPE block */ 313 /* Ensure that we have a valid GPE number for this GPE block */
315 314
316 if ((gpe_number < gpe_block->block_base_number) || 315 if ((gpe_number < gpe_block->block_base_number) ||
317 (gpe_number >= 316 (gpe_number >= (gpe_block->block_base_number +
318 (gpe_block->block_base_number + 317 (gpe_block->register_count * 8)))) {
319 (gpe_block->register_count * 8)))) {
320 /* 318 /*
321 * Not valid for this GPE block, just ignore it. However, it may be 319 * Not valid for this GPE block, just ignore it. However, it may be
322 * valid for a different GPE block, since GPE0 and GPE1 methods both 320 * valid for a different GPE block, since GPE0 and GPE1 methods both
@@ -423,9 +421,9 @@ acpi_ev_match_prw_and_gpe(acpi_handle obj_handle,
423 421
424 if ((obj_desc->package.count < 2) || 422 if ((obj_desc->package.count < 2) ||
425 ((obj_desc->package.elements[0])->common.type != 423 ((obj_desc->package.elements[0])->common.type !=
426 ACPI_TYPE_LOCAL_REFERENCE) 424 ACPI_TYPE_LOCAL_REFERENCE) ||
427 || ((obj_desc->package.elements[1])->common.type != 425 ((obj_desc->package.elements[1])->common.type !=
428 ACPI_TYPE_INTEGER)) { 426 ACPI_TYPE_INTEGER)) {
429 goto cleanup; 427 goto cleanup;
430 } 428 }
431 429
@@ -450,11 +448,11 @@ acpi_ev_match_prw_and_gpe(acpi_handle obj_handle,
450 */ 448 */
451 if ((gpe_device == target_gpe_device) && 449 if ((gpe_device == target_gpe_device) &&
452 (gpe_number >= gpe_block->block_base_number) && 450 (gpe_number >= gpe_block->block_base_number) &&
453 (gpe_number < 451 (gpe_number < gpe_block->block_base_number +
454 gpe_block->block_base_number + (gpe_block->register_count * 8))) { 452 (gpe_block->register_count * 8))) {
455 gpe_event_info = 453 gpe_event_info = &gpe_block->event_info[gpe_number -
456 &gpe_block->event_info[gpe_number - 454 gpe_block->
457 gpe_block->block_base_number]; 455 block_base_number];
458 456
459 /* Mark GPE for WAKE-ONLY but WAKE_DISABLED */ 457 /* Mark GPE for WAKE-ONLY but WAKE_DISABLED */
460 458
@@ -1033,8 +1031,8 @@ acpi_ev_initialize_gpe_block(struct acpi_namespace_node *gpe_device,
1033 * 1) are "runtime" or "run/wake" GPEs, and 1031 * 1) are "runtime" or "run/wake" GPEs, and
1034 * 2) have a corresponding _Lxx or _Exx method 1032 * 2) have a corresponding _Lxx or _Exx method
1035 * 1033 *
1036 * Any other GPEs within this block must be enabled via the acpi_enable_gpe() 1034 * Any other GPEs within this block must be enabled via the
1037 * external interface. 1035 * acpi_enable_gpe() external interface.
1038 */ 1036 */
1039 wake_gpe_count = 0; 1037 wake_gpe_count = 0;
1040 gpe_enabled_count = 0; 1038 gpe_enabled_count = 0;
@@ -1044,14 +1042,13 @@ acpi_ev_initialize_gpe_block(struct acpi_namespace_node *gpe_device,
1044 1042
1045 /* Get the info block for this particular GPE */ 1043 /* Get the info block for this particular GPE */
1046 1044
1047 gpe_event_info = 1045 gpe_event_info = &gpe_block->event_info[((acpi_size) i *
1048 &gpe_block-> 1046 ACPI_GPE_REGISTER_WIDTH)
1049 event_info[((acpi_size) i * 1047 + j];
1050 ACPI_GPE_REGISTER_WIDTH) + j];
1051 1048
1052 if (((gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) == 1049 if (((gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) ==
1053 ACPI_GPE_DISPATCH_METHOD) 1050 ACPI_GPE_DISPATCH_METHOD) &&
1054 && (gpe_event_info->flags & ACPI_GPE_TYPE_RUNTIME)) { 1051 (gpe_event_info->flags & ACPI_GPE_TYPE_RUNTIME)) {
1055 gpe_enabled_count++; 1052 gpe_enabled_count++;
1056 } 1053 }
1057 1054
@@ -1105,8 +1102,8 @@ acpi_status acpi_ev_gpe_initialize(void)
1105 /* 1102 /*
1106 * Initialize the GPE Block(s) defined in the FADT 1103 * Initialize the GPE Block(s) defined in the FADT
1107 * 1104 *
1108 * Why the GPE register block lengths are divided by 2: From the ACPI Spec, 1105 * Why the GPE register block lengths are divided by 2: From the ACPI
1109 * section "General-Purpose Event Registers", we have: 1106 * Spec, section "General-Purpose Event Registers", we have:
1110 * 1107 *
1111 * "Each register block contains two registers of equal length 1108 * "Each register block contains two registers of equal length
1112 * GPEx_STS and GPEx_EN (where x is 0 or 1). The length of the 1109 * GPEx_STS and GPEx_EN (where x is 0 or 1). The length of the
@@ -1163,7 +1160,8 @@ acpi_status acpi_ev_gpe_initialize(void)
1163 if ((register_count0) && 1160 if ((register_count0) &&
1164 (gpe_number_max >= acpi_gbl_FADT.gpe1_base)) { 1161 (gpe_number_max >= acpi_gbl_FADT.gpe1_base)) {
1165 ACPI_ERROR((AE_INFO, 1162 ACPI_ERROR((AE_INFO,
1166 "GPE0 block (GPE 0 to %d) overlaps the GPE1 block (GPE %d to %d) - Ignoring GPE1", 1163 "GPE0 block (GPE 0 to %d) overlaps the GPE1 block "
1164 "(GPE %d to %d) - Ignoring GPE1",
1167 gpe_number_max, acpi_gbl_FADT.gpe1_base, 1165 gpe_number_max, acpi_gbl_FADT.gpe1_base,
1168 acpi_gbl_FADT.gpe1_base + 1166 acpi_gbl_FADT.gpe1_base +
1169 ((register_count1 * 1167 ((register_count1 *
diff --git a/drivers/acpi/acpica/evmisc.c b/drivers/acpi/acpica/evmisc.c
index 417a9b920dd3..ce224e1eaa89 100644
--- a/drivers/acpi/acpica/evmisc.c
+++ b/drivers/acpi/acpica/evmisc.c
@@ -163,10 +163,10 @@ acpi_ev_queue_notify_request(struct acpi_namespace_node * node,
163 * 2) Global device notify handler 163 * 2) Global device notify handler
164 * 3) Per-device notify handler 164 * 3) Per-device notify handler
165 */ 165 */
166 if ((acpi_gbl_system_notify.handler 166 if ((acpi_gbl_system_notify.handler &&
167 && (notify_value <= ACPI_MAX_SYS_NOTIFY)) 167 (notify_value <= ACPI_MAX_SYS_NOTIFY)) ||
168 || (acpi_gbl_device_notify.handler 168 (acpi_gbl_device_notify.handler &&
169 && (notify_value > ACPI_MAX_SYS_NOTIFY)) || handler_obj) { 169 (notify_value > ACPI_MAX_SYS_NOTIFY)) || handler_obj) {
170 notify_info = acpi_ut_create_generic_state(); 170 notify_info = acpi_ut_create_generic_state();
171 if (!notify_info) { 171 if (!notify_info) {
172 return (AE_NO_MEMORY); 172 return (AE_NO_MEMORY);
@@ -174,7 +174,8 @@ acpi_ev_queue_notify_request(struct acpi_namespace_node * node,
174 174
175 if (!handler_obj) { 175 if (!handler_obj) {
176 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 176 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
177 "Executing system notify handler for Notify (%4.4s, %X) node %p\n", 177 "Executing system notify handler for Notify (%4.4s, %X) "
178 "node %p\n",
178 acpi_ut_get_node_name(node), 179 acpi_ut_get_node_name(node),
179 notify_value, node)); 180 notify_value, node));
180 } 181 }
diff --git a/drivers/acpi/acpica/evregion.c b/drivers/acpi/acpica/evregion.c
index 86cbbdbfc5cd..538d63264555 100644
--- a/drivers/acpi/acpica/evregion.c
+++ b/drivers/acpi/acpica/evregion.c
@@ -703,7 +703,8 @@ acpi_ev_install_handler(acpi_handle obj_handle,
703 if (next_handler_obj->address_space.space_id == 703 if (next_handler_obj->address_space.space_id ==
704 handler_obj->address_space.space_id) { 704 handler_obj->address_space.space_id) {
705 ACPI_DEBUG_PRINT((ACPI_DB_OPREGION, 705 ACPI_DEBUG_PRINT((ACPI_DB_OPREGION,
706 "Found handler for region [%s] in device %p(%p) handler %p\n", 706 "Found handler for region [%s] in device %p(%p) "
707 "handler %p\n",
707 acpi_ut_get_region_name 708 acpi_ut_get_region_name
708 (handler_obj->address_space. 709 (handler_obj->address_space.
709 space_id), obj_desc, 710 space_id), obj_desc,
diff --git a/drivers/acpi/acpica/evrgnini.c b/drivers/acpi/acpica/evrgnini.c
index f3f1fb45c3dc..284a7becbe96 100644
--- a/drivers/acpi/acpica/evrgnini.c
+++ b/drivers/acpi/acpica/evrgnini.c
@@ -241,7 +241,8 @@ acpi_ev_pci_config_region_setup(acpi_handle handle,
241 status = AE_OK; 241 status = AE_OK;
242 } else { 242 } else {
243 ACPI_EXCEPTION((AE_INFO, status, 243 ACPI_EXCEPTION((AE_INFO, status,
244 "Could not install PciConfig handler for Root Bridge %4.4s", 244 "Could not install PciConfig handler "
245 "for Root Bridge %4.4s",
245 acpi_ut_get_node_name 246 acpi_ut_get_node_name
246 (pci_root_node))); 247 (pci_root_node)));
247 } 248 }
@@ -293,9 +294,8 @@ acpi_ev_pci_config_region_setup(acpi_handle handle,
293 * Get the PCI device and function numbers from the _ADR object contained 294 * Get the PCI device and function numbers from the _ADR object contained
294 * in the parent's scope. 295 * in the parent's scope.
295 */ 296 */
296 status = 297 status = acpi_ut_evaluate_numeric_object(METHOD_NAME__ADR,
297 acpi_ut_evaluate_numeric_object(METHOD_NAME__ADR, pci_device_node, 298 pci_device_node, &pci_value);
298 &pci_value);
299 299
300 /* 300 /*
301 * The default is zero, and since the allocation above zeroed the data, 301 * The default is zero, and since the allocation above zeroed the data,
@@ -308,18 +308,16 @@ acpi_ev_pci_config_region_setup(acpi_handle handle,
308 308
309 /* The PCI segment number comes from the _SEG method */ 309 /* The PCI segment number comes from the _SEG method */
310 310
311 status = 311 status = acpi_ut_evaluate_numeric_object(METHOD_NAME__SEG,
312 acpi_ut_evaluate_numeric_object(METHOD_NAME__SEG, pci_root_node, 312 pci_root_node, &pci_value);
313 &pci_value);
314 if (ACPI_SUCCESS(status)) { 313 if (ACPI_SUCCESS(status)) {
315 pci_id->segment = ACPI_LOWORD(pci_value); 314 pci_id->segment = ACPI_LOWORD(pci_value);
316 } 315 }
317 316
318 /* The PCI bus number comes from the _BBN method */ 317 /* The PCI bus number comes from the _BBN method */
319 318
320 status = 319 status = acpi_ut_evaluate_numeric_object(METHOD_NAME__BBN,
321 acpi_ut_evaluate_numeric_object(METHOD_NAME__BBN, pci_root_node, 320 pci_root_node, &pci_value);
322 &pci_value);
323 if (ACPI_SUCCESS(status)) { 321 if (ACPI_SUCCESS(status)) {
324 pci_id->bus = ACPI_LOWORD(pci_value); 322 pci_id->bus = ACPI_LOWORD(pci_value);
325 } 323 }
@@ -632,8 +630,8 @@ acpi_ev_initialize_region(union acpi_operand_object *region_obj,
632 acpi_ns_locked); 630 acpi_ns_locked);
633 631
634 /* 632 /*
635 * Tell all users that this region is usable by running the _REG 633 * Tell all users that this region is usable by
636 * method 634 * running the _REG method
637 */ 635 */
638 if (acpi_ns_locked) { 636 if (acpi_ns_locked) {
639 status = 637 status =
diff --git a/drivers/acpi/acpica/evxface.c b/drivers/acpi/acpica/evxface.c
index 3aca9010a11e..10b8543dd466 100644
--- a/drivers/acpi/acpica/evxface.c
+++ b/drivers/acpi/acpica/evxface.c
@@ -631,7 +631,8 @@ acpi_install_gpe_handler(acpi_handle gpe_device,
631 631
632 /* Setup up dispatch flags to indicate handler (vs. method) */ 632 /* Setup up dispatch flags to indicate handler (vs. method) */
633 633
634 gpe_event_info->flags &= ~(ACPI_GPE_XRUPT_TYPE_MASK | ACPI_GPE_DISPATCH_MASK); /* Clear bits */ 634 gpe_event_info->flags &=
635 ~(ACPI_GPE_XRUPT_TYPE_MASK | ACPI_GPE_DISPATCH_MASK);
635 gpe_event_info->flags |= (u8) (type | ACPI_GPE_DISPATCH_HANDLER); 636 gpe_event_info->flags |= (u8) (type | ACPI_GPE_DISPATCH_HANDLER);
636 637
637 acpi_os_release_lock(acpi_gbl_gpe_lock, flags); 638 acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
diff --git a/drivers/acpi/acpica/evxfregn.c b/drivers/acpi/acpica/evxfregn.c
index 479e7a3721be..7c3d2d356ffb 100644
--- a/drivers/acpi/acpica/evxfregn.c
+++ b/drivers/acpi/acpica/evxfregn.c
@@ -193,7 +193,8 @@ acpi_remove_address_space_handler(acpi_handle device,
193 /* Matched space_id, first dereference this in the Regions */ 193 /* Matched space_id, first dereference this in the Regions */
194 194
195 ACPI_DEBUG_PRINT((ACPI_DB_OPREGION, 195 ACPI_DEBUG_PRINT((ACPI_DB_OPREGION,
196 "Removing address handler %p(%p) for region %s on Device %p(%p)\n", 196 "Removing address handler %p(%p) for region %s "
197 "on Device %p(%p)\n",
197 handler_obj, handler, 198 handler_obj, handler,
198 acpi_ut_get_region_name(space_id), 199 acpi_ut_get_region_name(space_id),
199 node, obj_desc)); 200 node, obj_desc));
diff --git a/drivers/acpi/acpica/hwacpi.c b/drivers/acpi/acpica/hwacpi.c
index 8902db8c670f..e7949b133365 100644
--- a/drivers/acpi/acpica/hwacpi.c
+++ b/drivers/acpi/acpica/hwacpi.c
@@ -86,7 +86,8 @@ acpi_status acpi_hw_set_mode(u32 mode)
86 */ 86 */
87 if (!acpi_gbl_FADT.acpi_enable && !acpi_gbl_FADT.acpi_disable) { 87 if (!acpi_gbl_FADT.acpi_enable && !acpi_gbl_FADT.acpi_disable) {
88 ACPI_ERROR((AE_INFO, 88 ACPI_ERROR((AE_INFO,
89 "No ACPI mode transition supported in this system (enable/disable both zero)")); 89 "No ACPI mode transition supported in this system "
90 "(enable/disable both zero)"));
90 return_ACPI_STATUS(AE_OK); 91 return_ACPI_STATUS(AE_OK);
91 } 92 }
92 93
diff --git a/drivers/acpi/acpica/hwgpe.c b/drivers/acpi/acpica/hwgpe.c
index 2013b66745d2..d3b7e37c9eed 100644
--- a/drivers/acpi/acpica/hwgpe.c
+++ b/drivers/acpi/acpica/hwgpe.c
@@ -89,10 +89,9 @@ acpi_status acpi_hw_low_disable_gpe(struct acpi_gpe_event_info *gpe_event_info)
89 89
90 /* Clear just the bit that corresponds to this GPE */ 90 /* Clear just the bit that corresponds to this GPE */
91 91
92 ACPI_CLEAR_BIT(enable_mask, 92 ACPI_CLEAR_BIT(enable_mask, ((u32)1 <<
93 ((u32) 1 << 93 (gpe_event_info->gpe_number -
94 (gpe_event_info->gpe_number - 94 gpe_register_info->base_gpe_number)));
95 gpe_register_info->base_gpe_number)));
96 95
97 /* Write the updated enable mask */ 96 /* Write the updated enable mask */
98 97
@@ -156,10 +155,9 @@ acpi_status acpi_hw_clear_gpe(struct acpi_gpe_event_info * gpe_event_info)
156 155
157 ACPI_FUNCTION_ENTRY(); 156 ACPI_FUNCTION_ENTRY();
158 157
159 register_bit = (u8) 158 register_bit = (u8)(1 <<
160 (1 << 159 (gpe_event_info->gpe_number -
161 (gpe_event_info->gpe_number - 160 gpe_event_info->register_info->base_gpe_number));
162 gpe_event_info->register_info->base_gpe_number));
163 161
164 /* 162 /*
165 * Write a one to the appropriate bit in the status register to 163 * Write a one to the appropriate bit in the status register to
@@ -206,10 +204,9 @@ acpi_hw_get_gpe_status(struct acpi_gpe_event_info * gpe_event_info,
206 204
207 /* Get the register bitmask for this GPE */ 205 /* Get the register bitmask for this GPE */
208 206
209 register_bit = (u8) 207 register_bit = (u8)(1 <<
210 (1 << 208 (gpe_event_info->gpe_number -
211 (gpe_event_info->gpe_number - 209 gpe_event_info->register_info->base_gpe_number));
212 gpe_event_info->register_info->base_gpe_number));
213 210
214 /* GPE currently enabled? (enabled for runtime?) */ 211 /* GPE currently enabled? (enabled for runtime?) */
215 212
diff --git a/drivers/acpi/acpica/hwsleep.c b/drivers/acpi/acpica/hwsleep.c
index 4d14b49a0f6c..2ea4c59e8838 100644
--- a/drivers/acpi/acpica/hwsleep.c
+++ b/drivers/acpi/acpica/hwsleep.c
@@ -349,8 +349,8 @@ acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state)
349 * Wait ten seconds, then try again. This is to get S4/S5 to work on 349 * Wait ten seconds, then try again. This is to get S4/S5 to work on
350 * all machines. 350 * all machines.
351 * 351 *
352 * We wait so long to allow chipsets that poll this reg very slowly to 352 * We wait so long to allow chipsets that poll this reg very slowly
353 * still read the right value. Ideally, this block would go 353 * to still read the right value. Ideally, this block would go
354 * away entirely. 354 * away entirely.
355 */ 355 */
356 acpi_os_stall(10000000); 356 acpi_os_stall(10000000);
@@ -501,12 +501,10 @@ acpi_status acpi_leave_sleep_state_prep(u8 sleep_state)
501 501
502 /* Insert the SLP_TYP bits */ 502 /* Insert the SLP_TYP bits */
503 503
504 pm1a_control |= 504 pm1a_control |= (acpi_gbl_sleep_type_a <<
505 (acpi_gbl_sleep_type_a << sleep_type_reg_info-> 505 sleep_type_reg_info->bit_position);
506 bit_position); 506 pm1b_control |= (acpi_gbl_sleep_type_b <<
507 pm1b_control |= 507 sleep_type_reg_info->bit_position);
508 (acpi_gbl_sleep_type_b << sleep_type_reg_info->
509 bit_position);
510 508
511 /* Write the control registers and ignore any errors */ 509 /* Write the control registers and ignore any errors */
512 510
diff --git a/drivers/acpi/acpica/hwxface.c b/drivers/acpi/acpica/hwxface.c
index caad51680bd6..26e66427f4ff 100644
--- a/drivers/acpi/acpica/hwxface.c
+++ b/drivers/acpi/acpica/hwxface.c
@@ -494,7 +494,8 @@ acpi_get_sleep_type_data(u8 sleep_state, u8 *sleep_type_a, u8 *sleep_type_b)
494 ((info->return_object->package.elements[1])->common.type 494 ((info->return_object->package.elements[1])->common.type
495 != ACPI_TYPE_INTEGER)) { 495 != ACPI_TYPE_INTEGER)) {
496 ACPI_ERROR((AE_INFO, 496 ACPI_ERROR((AE_INFO,
497 "Sleep State return package elements are not both Integers (%s, %s)", 497 "Sleep State return package elements are not both Integers "
498 "(%s, %s)",
498 acpi_ut_get_object_type_name(info->return_object-> 499 acpi_ut_get_object_type_name(info->return_object->
499 package.elements[0]), 500 package.elements[0]),
500 acpi_ut_get_object_type_name(info->return_object-> 501 acpi_ut_get_object_type_name(info->return_object->
diff --git a/drivers/acpi/acpica/nsaccess.c b/drivers/acpi/acpica/nsaccess.c
index b6968a65cd4f..9c3cdbe2d82a 100644
--- a/drivers/acpi/acpica/nsaccess.c
+++ b/drivers/acpi/acpica/nsaccess.c
@@ -118,9 +118,8 @@ acpi_status acpi_ns_root_initialize(void)
118 } 118 }
119 119
120 /* 120 /*
121 * Name entered successfully. 121 * Name entered successfully. If entry in pre_defined_names[] specifies
122 * If entry in pre_defined_names[] specifies an 122 * an initial value, create the initial value.
123 * initial value, create the initial value.
124 */ 123 */
125 if (init_val->val) { 124 if (init_val->val) {
126 status = acpi_os_predefined_override(init_val, &val); 125 status = acpi_os_predefined_override(init_val, &val);
@@ -178,9 +177,8 @@ acpi_status acpi_ns_root_initialize(void)
178 177
179 case ACPI_TYPE_STRING: 178 case ACPI_TYPE_STRING:
180 179
181 /* 180 /* Build an object around the static string */
182 * Build an object around the static string 181
183 */
184 obj_desc->string.length = 182 obj_desc->string.length =
185 (u32) ACPI_STRLEN(val); 183 (u32) ACPI_STRLEN(val);
186 obj_desc->string.pointer = val; 184 obj_desc->string.pointer = val;
@@ -314,10 +312,8 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
314 return_ACPI_STATUS(AE_NO_NAMESPACE); 312 return_ACPI_STATUS(AE_NO_NAMESPACE);
315 } 313 }
316 314
317 /* 315 /* Get the prefix scope. A null scope means use the root scope */
318 * Get the prefix scope. 316
319 * A null scope means use the root scope
320 */
321 if ((!scope_info) || (!scope_info->scope.node)) { 317 if ((!scope_info) || (!scope_info->scope.node)) {
322 ACPI_DEBUG_PRINT((ACPI_DB_NAMES, 318 ACPI_DEBUG_PRINT((ACPI_DB_NAMES,
323 "Null scope prefix, using root node (%p)\n", 319 "Null scope prefix, using root node (%p)\n",
@@ -337,8 +333,8 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
337 if (!(flags & ACPI_NS_PREFIX_IS_SCOPE)) { 333 if (!(flags & ACPI_NS_PREFIX_IS_SCOPE)) {
338 /* 334 /*
339 * This node might not be a actual "scope" node (such as a 335 * This node might not be a actual "scope" node (such as a
340 * Device/Method, etc.) It could be a Package or other object node. 336 * Device/Method, etc.) It could be a Package or other object
341 * Backup up the tree to find the containing scope node. 337 * node. Backup up the tree to find the containing scope node.
342 */ 338 */
343 while (!acpi_ns_opens_scope(prefix_node->type) && 339 while (!acpi_ns_opens_scope(prefix_node->type) &&
344 prefix_node->type != ACPI_TYPE_ANY) { 340 prefix_node->type != ACPI_TYPE_ANY) {
@@ -348,7 +344,7 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
348 } 344 }
349 } 345 }
350 346
351 /* Save type TBD: may be no longer necessary */ 347 /* Save type. TBD: may be no longer necessary */
352 348
353 type_to_check_for = type; 349 type_to_check_for = type;
354 350
@@ -413,6 +409,7 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
413 /* Name is fully qualified, no search rules apply */ 409 /* Name is fully qualified, no search rules apply */
414 410
415 search_parent_flag = ACPI_NS_NO_UPSEARCH; 411 search_parent_flag = ACPI_NS_NO_UPSEARCH;
412
416 /* 413 /*
417 * Point past this prefix to the name segment 414 * Point past this prefix to the name segment
418 * part or the next Parent Prefix 415 * part or the next Parent Prefix
@@ -428,7 +425,8 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
428 /* Current scope has no parent scope */ 425 /* Current scope has no parent scope */
429 426
430 ACPI_ERROR((AE_INFO, 427 ACPI_ERROR((AE_INFO,
431 "ACPI path has too many parent prefixes (^) - reached beyond root node")); 428 "ACPI path has too many parent prefixes (^) "
429 "- reached beyond root node"));
432 return_ACPI_STATUS(AE_NOT_FOUND); 430 return_ACPI_STATUS(AE_NOT_FOUND);
433 } 431 }
434 } 432 }
@@ -530,9 +528,9 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
530 while (num_segments && current_node) { 528 while (num_segments && current_node) {
531 num_segments--; 529 num_segments--;
532 if (!num_segments) { 530 if (!num_segments) {
533 /* 531
534 * This is the last segment, enable typechecking 532 /* This is the last segment, enable typechecking */
535 */ 533
536 this_search_type = type; 534 this_search_type = type;
537 535
538 /* 536 /*
@@ -583,9 +581,9 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
583 if (num_segments > 0) { 581 if (num_segments > 0) {
584 /* 582 /*
585 * If we have an alias to an object that opens a scope (such as a 583 * If we have an alias to an object that opens a scope (such as a
586 * device or processor), we need to dereference the alias here so that 584 * device or processor), we need to dereference the alias here so
587 * we can access any children of the original node (via the remaining 585 * that we can access any children of the original node (via the
588 * segments). 586 * remaining segments).
589 */ 587 */
590 if (this_node->type == ACPI_TYPE_LOCAL_ALIAS) { 588 if (this_node->type == ACPI_TYPE_LOCAL_ALIAS) {
591 if (!this_node->object) { 589 if (!this_node->object) {
@@ -593,8 +591,8 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
593 } 591 }
594 592
595 if (acpi_ns_opens_scope 593 if (acpi_ns_opens_scope
596 (((struct acpi_namespace_node *)this_node-> 594 (((struct acpi_namespace_node *)
597 object)->type)) { 595 this_node->object)->type)) {
598 this_node = 596 this_node =
599 (struct acpi_namespace_node *) 597 (struct acpi_namespace_node *)
600 this_node->object; 598 this_node->object;
@@ -638,8 +636,8 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
638 636
639 /* 637 /*
640 * If this is the last name segment and we are not looking for a 638 * If this is the last name segment and we are not looking for a
641 * specific type, but the type of found object is known, use that type 639 * specific type, but the type of found object is known, use that
642 * to (later) see if it opens a scope. 640 * type to (later) see if it opens a scope.
643 */ 641 */
644 if (type == ACPI_TYPE_ANY) { 642 if (type == ACPI_TYPE_ANY) {
645 type = this_node->type; 643 type = this_node->type;
@@ -652,9 +650,8 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
652 current_node = this_node; 650 current_node = this_node;
653 } 651 }
654 652
655 /* 653 /* Always check if we need to open a new scope */
656 * Always check if we need to open a new scope 654
657 */
658 if (!(flags & ACPI_NS_DONT_OPEN_SCOPE) && (walk_state)) { 655 if (!(flags & ACPI_NS_DONT_OPEN_SCOPE) && (walk_state)) {
659 /* 656 /*
660 * If entry is a type which opens a scope, push the new scope on the 657 * If entry is a type which opens a scope, push the new scope on the
diff --git a/drivers/acpi/acpica/nsalloc.c b/drivers/acpi/acpica/nsalloc.c
index f976d848fe82..aceb93111967 100644
--- a/drivers/acpi/acpica/nsalloc.c
+++ b/drivers/acpi/acpica/nsalloc.c
@@ -76,8 +76,7 @@ struct acpi_namespace_node *acpi_ns_create_node(u32 name)
76 ACPI_MEM_TRACKING(acpi_gbl_ns_node_list->total_allocated++); 76 ACPI_MEM_TRACKING(acpi_gbl_ns_node_list->total_allocated++);
77 77
78#ifdef ACPI_DBG_TRACK_ALLOCATIONS 78#ifdef ACPI_DBG_TRACK_ALLOCATIONS
79 temp = 79 temp = acpi_gbl_ns_node_list->total_allocated -
80 acpi_gbl_ns_node_list->total_allocated -
81 acpi_gbl_ns_node_list->total_freed; 80 acpi_gbl_ns_node_list->total_freed;
82 if (temp > acpi_gbl_ns_node_list->max_occupied) { 81 if (temp > acpi_gbl_ns_node_list->max_occupied) {
83 acpi_gbl_ns_node_list->max_occupied = temp; 82 acpi_gbl_ns_node_list->max_occupied = temp;
@@ -145,9 +144,8 @@ void acpi_ns_delete_node(struct acpi_namespace_node *node)
145 144
146 ACPI_MEM_TRACKING(acpi_gbl_ns_node_list->total_freed++); 145 ACPI_MEM_TRACKING(acpi_gbl_ns_node_list->total_freed++);
147 146
148 /* 147 /* Detach an object if there is one, then delete the node */
149 * Detach an object if there is one, then delete the node 148
150 */
151 acpi_ns_detach_object(node); 149 acpi_ns_detach_object(node);
152 (void)acpi_os_release_object(acpi_gbl_namespace_cache, node); 150 (void)acpi_os_release_object(acpi_gbl_namespace_cache, node);
153 return_VOID; 151 return_VOID;
@@ -183,9 +181,8 @@ void acpi_ns_install_node(struct acpi_walk_state *walk_state, struct acpi_namesp
183 ACPI_FUNCTION_TRACE(ns_install_node); 181 ACPI_FUNCTION_TRACE(ns_install_node);
184 182
185 /* 183 /*
186 * Get the owner ID from the Walk state 184 * Get the owner ID from the Walk state. The owner ID is used to track
187 * The owner ID is used to track table deletion and 185 * table deletion and deletion of objects created by methods.
188 * deletion of objects created by methods
189 */ 186 */
190 if (walk_state) { 187 if (walk_state) {
191 owner_id = walk_state->owner_id; 188 owner_id = walk_state->owner_id;
@@ -260,9 +257,8 @@ void acpi_ns_delete_children(struct acpi_namespace_node *parent_node)
260 return_VOID; 257 return_VOID;
261 } 258 }
262 259
263 /* 260 /* Deallocate all children at this level */
264 * Deallocate all children at this level 261
265 */
266 do { 262 do {
267 263
268 /* Get the things we need */ 264 /* Get the things we need */
@@ -285,9 +281,8 @@ void acpi_ns_delete_children(struct acpi_namespace_node *parent_node)
285 "Object %p, Remaining %X\n", child_node, 281 "Object %p, Remaining %X\n", child_node,
286 acpi_gbl_current_node_count)); 282 acpi_gbl_current_node_count));
287 283
288 /* 284 /* Detach an object if there is one, then free the child node */
289 * Detach an object if there is one, then free the child node 285
290 */
291 acpi_ns_detach_object(child_node); 286 acpi_ns_detach_object(child_node);
292 287
293 /* Now we can delete the node */ 288 /* Now we can delete the node */
@@ -304,7 +299,6 @@ void acpi_ns_delete_children(struct acpi_namespace_node *parent_node)
304 /* Clear the parent's child pointer */ 299 /* Clear the parent's child pointer */
305 300
306 parent_node->child = NULL; 301 parent_node->child = NULL;
307
308 return_VOID; 302 return_VOID;
309} 303}
310 304
diff --git a/drivers/acpi/acpica/nsdump.c b/drivers/acpi/acpica/nsdump.c
index 7bfa6c1286f1..2bad613db73a 100644
--- a/drivers/acpi/acpica/nsdump.c
+++ b/drivers/acpi/acpica/nsdump.c
@@ -220,9 +220,8 @@ acpi_ns_dump_one_object(acpi_handle obj_handle,
220 acpi_os_printf("%4.4s", acpi_ut_get_node_name(this_node)); 220 acpi_os_printf("%4.4s", acpi_ut_get_node_name(this_node));
221 } 221 }
222 222
223 /* 223 /* Now we can print out the pertinent information */
224 * Now we can print out the pertinent information 224
225 */
226 acpi_os_printf(" %-12s %p %2.2X ", 225 acpi_os_printf(" %-12s %p %2.2X ",
227 acpi_ut_get_type_name(type), this_node, 226 acpi_ut_get_type_name(type), this_node,
228 this_node->owner_id); 227 this_node->owner_id);
@@ -545,9 +544,8 @@ acpi_ns_dump_one_object(acpi_handle obj_handle,
545 goto cleanup; 544 goto cleanup;
546 } 545 }
547 546
548 /* 547 /* Valid object, get the pointer to next level, if any */
549 * Valid object, get the pointer to next level, if any 548
550 */
551 switch (obj_type) { 549 switch (obj_type) {
552 case ACPI_TYPE_BUFFER: 550 case ACPI_TYPE_BUFFER:
553 case ACPI_TYPE_STRING: 551 case ACPI_TYPE_STRING:
@@ -608,14 +606,14 @@ acpi_ns_dump_one_object(acpi_handle obj_handle,
608 * display_type - 0 or ACPI_DISPLAY_SUMMARY 606 * display_type - 0 or ACPI_DISPLAY_SUMMARY
609 * max_depth - Maximum depth of dump. Use ACPI_UINT32_MAX 607 * max_depth - Maximum depth of dump. Use ACPI_UINT32_MAX
610 * for an effectively unlimited depth. 608 * for an effectively unlimited depth.
611 * owner_id - Dump only objects owned by this ID. Use 609 * owner_id - Dump only objects owned by this ID. Use
612 * ACPI_UINT32_MAX to match all owners. 610 * ACPI_UINT32_MAX to match all owners.
613 * start_handle - Where in namespace to start/end search 611 * start_handle - Where in namespace to start/end search
614 * 612 *
615 * RETURN: None 613 * RETURN: None
616 * 614 *
617 * DESCRIPTION: Dump typed objects within the loaded namespace. 615 * DESCRIPTION: Dump typed objects within the loaded namespace. Uses
618 * Uses acpi_ns_walk_namespace in conjunction with acpi_ns_dump_one_object. 616 * acpi_ns_walk_namespace in conjunction with acpi_ns_dump_one_object.
619 * 617 *
620 ******************************************************************************/ 618 ******************************************************************************/
621 619
diff --git a/drivers/acpi/acpica/nsinit.c b/drivers/acpi/acpica/nsinit.c
index 13501cb81863..2adfcf329e15 100644
--- a/drivers/acpi/acpica/nsinit.c
+++ b/drivers/acpi/acpica/nsinit.c
@@ -103,7 +103,8 @@ acpi_status acpi_ns_initialize_objects(void)
103 } 103 }
104 104
105 ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT, 105 ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,
106 "\nInitialized %hd/%hd Regions %hd/%hd Fields %hd/%hd Buffers %hd/%hd Packages (%hd nodes)\n", 106 "\nInitialized %hd/%hd Regions %hd/%hd Fields %hd/%hd "
107 "Buffers %hd/%hd Packages (%hd nodes)\n",
107 info.op_region_init, info.op_region_count, 108 info.op_region_init, info.op_region_count,
108 info.field_init, info.field_count, 109 info.field_init, info.field_count,
109 info.buffer_init, info.buffer_count, 110 info.buffer_init, info.buffer_count,
@@ -148,7 +149,8 @@ acpi_status acpi_ns_initialize_devices(void)
148 info.num_INI = 0; 149 info.num_INI = 0;
149 150
150 ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT, 151 ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,
151 "Initializing Device/Processor/Thermal objects by executing _INI methods:")); 152 "Initializing Device/Processor/Thermal objects "
153 "by executing _INI methods:"));
152 154
153 /* Tree analysis: find all subtrees that contain _INI methods */ 155 /* Tree analysis: find all subtrees that contain _INI methods */
154 156
@@ -180,7 +182,8 @@ acpi_status acpi_ns_initialize_devices(void)
180 } 182 }
181 183
182 ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT, 184 ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,
183 "\nExecuted %hd _INI methods requiring %hd _STA executions (examined %hd objects)\n", 185 "\nExecuted %hd _INI methods requiring %hd _STA executions "
186 "(examined %hd objects)\n",
184 info.num_INI, info.num_STA, info.device_count)); 187 info.num_INI, info.num_STA, info.device_count));
185 188
186 return_ACPI_STATUS(status); 189 return_ACPI_STATUS(status);
@@ -263,16 +266,14 @@ acpi_ns_init_one_object(acpi_handle obj_handle,
263 return (AE_OK); 266 return (AE_OK);
264 } 267 }
265 268
266 /* 269 /* If the object is already initialized, nothing else to do */
267 * If the object is already initialized, nothing else to do 270
268 */
269 if (obj_desc->common.flags & AOPOBJ_DATA_VALID) { 271 if (obj_desc->common.flags & AOPOBJ_DATA_VALID) {
270 return (AE_OK); 272 return (AE_OK);
271 } 273 }
272 274
273 /* 275 /* Must lock the interpreter before executing AML code */
274 * Must lock the interpreter before executing AML code 276
275 */
276 acpi_ex_enter_interpreter(); 277 acpi_ex_enter_interpreter();
277 278
278 /* 279 /*
diff --git a/drivers/acpi/acpica/nsload.c b/drivers/acpi/acpica/nsload.c
index a0ba9e12379e..dcd7a6adbbbc 100644
--- a/drivers/acpi/acpica/nsload.c
+++ b/drivers/acpi/acpica/nsload.c
@@ -128,12 +128,12 @@ acpi_ns_load_table(u32 table_index, struct acpi_namespace_node *node)
128 * parse trees. 128 * parse trees.
129 */ 129 */
130 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 130 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
131 "**** Begin Table Method Parsing and Object Initialization ****\n")); 131 "**** Begin Table Method Parsing and Object Initialization\n"));
132 132
133 status = acpi_ds_initialize_objects(table_index, node); 133 status = acpi_ds_initialize_objects(table_index, node);
134 134
135 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 135 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
136 "**** Completed Table Method Parsing and Object Initialization ****\n")); 136 "**** Completed Table Method Parsing and Object Initialization\n"));
137 137
138 return_ACPI_STATUS(status); 138 return_ACPI_STATUS(status);
139} 139}
diff --git a/drivers/acpi/acpica/nsparse.c b/drivers/acpi/acpica/nsparse.c
index b9e8d0070b6f..662a4bd5b621 100644
--- a/drivers/acpi/acpica/nsparse.c
+++ b/drivers/acpi/acpica/nsparse.c
@@ -176,9 +176,8 @@ acpi_ns_parse_table(u32 table_index, struct acpi_namespace_node *start_node)
176 * performs another complete parse of the AML. 176 * performs another complete parse of the AML.
177 */ 177 */
178 ACPI_DEBUG_PRINT((ACPI_DB_PARSE, "**** Start pass 1\n")); 178 ACPI_DEBUG_PRINT((ACPI_DB_PARSE, "**** Start pass 1\n"));
179 status = 179 status = acpi_ns_one_complete_parse(ACPI_IMODE_LOAD_PASS1,
180 acpi_ns_one_complete_parse(ACPI_IMODE_LOAD_PASS1, table_index, 180 table_index, start_node);
181 start_node);
182 if (ACPI_FAILURE(status)) { 181 if (ACPI_FAILURE(status)) {
183 return_ACPI_STATUS(status); 182 return_ACPI_STATUS(status);
184 } 183 }
@@ -193,9 +192,8 @@ acpi_ns_parse_table(u32 table_index, struct acpi_namespace_node *start_node)
193 * parse objects are all cached. 192 * parse objects are all cached.
194 */ 193 */
195 ACPI_DEBUG_PRINT((ACPI_DB_PARSE, "**** Start pass 2\n")); 194 ACPI_DEBUG_PRINT((ACPI_DB_PARSE, "**** Start pass 2\n"));
196 status = 195 status = acpi_ns_one_complete_parse(ACPI_IMODE_LOAD_PASS2,
197 acpi_ns_one_complete_parse(ACPI_IMODE_LOAD_PASS2, table_index, 196 table_index, start_node);
198 start_node);
199 if (ACPI_FAILURE(status)) { 197 if (ACPI_FAILURE(status)) {
200 return_ACPI_STATUS(status); 198 return_ACPI_STATUS(status);
201 } 199 }
diff --git a/drivers/acpi/acpica/nspredef.c b/drivers/acpi/acpica/nspredef.c
index 72dd7b198520..0d0b4ee1358e 100644
--- a/drivers/acpi/acpica/nspredef.c
+++ b/drivers/acpi/acpica/nspredef.c
@@ -302,7 +302,8 @@ acpi_ns_check_parameter_count(char *pathname,
302 if ((user_param_count != required_params_current) && 302 if ((user_param_count != required_params_current) &&
303 (user_param_count != required_params_old)) { 303 (user_param_count != required_params_old)) {
304 ACPI_WARNING((AE_INFO, 304 ACPI_WARNING((AE_INFO,
305 "%s: Parameter count mismatch - caller passed %d, ACPI requires %d", 305 "%s: Parameter count mismatch - "
306 "caller passed %d, ACPI requires %d",
306 pathname, user_param_count, 307 pathname, user_param_count,
307 required_params_current)); 308 required_params_current));
308 } 309 }
@@ -974,7 +975,8 @@ acpi_ns_check_reference(char *pathname,
974 } 975 }
975 976
976 ACPI_WARNING((AE_INFO, 977 ACPI_WARNING((AE_INFO,
977 "%s: Return type mismatch - unexpected reference object type [%s] %2.2X", 978 "%s: Return type mismatch - "
979 "unexpected reference object type [%s] %2.2X",
978 pathname, acpi_ut_get_reference_name(return_object), 980 pathname, acpi_ut_get_reference_name(return_object),
979 return_object->reference.class)); 981 return_object->reference.class));
980 982
diff --git a/drivers/acpi/acpica/nssearch.c b/drivers/acpi/acpica/nssearch.c
index 6fea13f3f52d..f9b4f51bf8f2 100644
--- a/drivers/acpi/acpica/nssearch.c
+++ b/drivers/acpi/acpica/nssearch.c
@@ -167,7 +167,8 @@ acpi_ns_search_one_scope(u32 target_name,
167 /* Searched entire namespace level, not found */ 167 /* Searched entire namespace level, not found */
168 168
169 ACPI_DEBUG_PRINT((ACPI_DB_NAMES, 169 ACPI_DEBUG_PRINT((ACPI_DB_NAMES,
170 "Name [%4.4s] (%s) not found in search in scope [%4.4s] %p first child %p\n", 170 "Name [%4.4s] (%s) not found in search in scope [%4.4s] "
171 "%p first child %p\n",
171 ACPI_CAST_PTR(char, &target_name), 172 ACPI_CAST_PTR(char, &target_name),
172 acpi_ut_get_type_name(type), 173 acpi_ut_get_type_name(type),
173 acpi_ut_get_node_name(parent_node), parent_node, 174 acpi_ut_get_node_name(parent_node), parent_node,
@@ -239,9 +240,8 @@ acpi_ns_search_parent_tree(u32 target_name,
239 acpi_ut_get_node_name(parent_node), 240 acpi_ut_get_node_name(parent_node),
240 ACPI_CAST_PTR(char, &target_name))); 241 ACPI_CAST_PTR(char, &target_name)));
241 242
242 /* 243 /* Search parents until target is found or we have backed up to the root */
243 * Search parents until target is found or we have backed up to the root 244
244 */
245 while (parent_node) { 245 while (parent_node) {
246 /* 246 /*
247 * Search parent scope. Use TYPE_ANY because we don't care about the 247 * Search parent scope. Use TYPE_ANY because we don't care about the
@@ -395,9 +395,9 @@ acpi_ns_search_and_enter(u32 target_name,
395 return_ACPI_STATUS(AE_NO_MEMORY); 395 return_ACPI_STATUS(AE_NO_MEMORY);
396 } 396 }
397#ifdef ACPI_ASL_COMPILER 397#ifdef ACPI_ASL_COMPILER
398 /* 398
399 * Node is an object defined by an External() statement 399 /* Node is an object defined by an External() statement */
400 */ 400
401 if (flags & ACPI_NS_EXTERNAL) { 401 if (flags & ACPI_NS_EXTERNAL) {
402 new_node->flags |= ANOBJ_IS_EXTERNAL; 402 new_node->flags |= ANOBJ_IS_EXTERNAL;
403 } 403 }
diff --git a/drivers/acpi/acpica/nsutils.c b/drivers/acpi/acpica/nsutils.c
index d30b0e65ab3c..78277ed08339 100644
--- a/drivers/acpi/acpica/nsutils.c
+++ b/drivers/acpi/acpica/nsutils.c
@@ -325,9 +325,8 @@ void acpi_ns_get_internal_name_length(struct acpi_namestring_info *info)
325 next_external_char++; 325 next_external_char++;
326 } 326 }
327 } else { 327 } else {
328 /* 328 /* Handle Carat prefixes */
329 * Handle Carat prefixes 329
330 */
331 while (*next_external_char == '^') { 330 while (*next_external_char == '^') {
332 info->num_carats++; 331 info->num_carats++;
333 next_external_char++; 332 next_external_char++;
@@ -552,9 +551,8 @@ acpi_ns_externalize_name(u32 internal_name_length,
552 return_ACPI_STATUS(AE_BAD_PARAMETER); 551 return_ACPI_STATUS(AE_BAD_PARAMETER);
553 } 552 }
554 553
555 /* 554 /* Check for a prefix (one '\' | one or more '^') */
556 * Check for a prefix (one '\' | one or more '^'). 555
557 */
558 switch (internal_name[0]) { 556 switch (internal_name[0]) {
559 case '\\': 557 case '\\':
560 prefix_length = 1; 558 prefix_length = 1;
@@ -580,7 +578,7 @@ acpi_ns_externalize_name(u32 internal_name_length,
580 } 578 }
581 579
582 /* 580 /*
583 * Check for object names. Note that there could be 0-255 of these 581 * Check for object names. Note that there could be 0-255 of these
584 * 4-byte elements. 582 * 4-byte elements.
585 */ 583 */
586 if (prefix_length < internal_name_length) { 584 if (prefix_length < internal_name_length) {
@@ -637,9 +635,8 @@ acpi_ns_externalize_name(u32 internal_name_length,
637 return_ACPI_STATUS(AE_BAD_PATHNAME); 635 return_ACPI_STATUS(AE_BAD_PATHNAME);
638 } 636 }
639 637
640 /* 638 /* Build the converted_name */
641 * Build converted_name 639
642 */
643 *converted_name = ACPI_ALLOCATE_ZEROED(required_length); 640 *converted_name = ACPI_ALLOCATE_ZEROED(required_length);
644 if (!(*converted_name)) { 641 if (!(*converted_name)) {
645 return_ACPI_STATUS(AE_NO_MEMORY); 642 return_ACPI_STATUS(AE_NO_MEMORY);
@@ -685,6 +682,9 @@ acpi_ns_externalize_name(u32 internal_name_length,
685 * and keep all pointers within this subsystem - however this introduces 682 * and keep all pointers within this subsystem - however this introduces
686 * more (and perhaps unnecessary) overhead. 683 * more (and perhaps unnecessary) overhead.
687 * 684 *
685 * The current implemenation is basically a placeholder until such time comes
686 * that it is needed.
687 *
688 ******************************************************************************/ 688 ******************************************************************************/
689 689
690struct acpi_namespace_node *acpi_ns_map_handle_to_node(acpi_handle handle) 690struct acpi_namespace_node *acpi_ns_map_handle_to_node(acpi_handle handle)
@@ -692,9 +692,8 @@ struct acpi_namespace_node *acpi_ns_map_handle_to_node(acpi_handle handle)
692 692
693 ACPI_FUNCTION_ENTRY(); 693 ACPI_FUNCTION_ENTRY();
694 694
695 /* 695 /* Parameter validation */
696 * Simple implementation 696
697 */
698 if ((!handle) || (handle == ACPI_ROOT_OBJECT)) { 697 if ((!handle) || (handle == ACPI_ROOT_OBJECT)) {
699 return (acpi_gbl_root_node); 698 return (acpi_gbl_root_node);
700 } 699 }
diff --git a/drivers/acpi/acpica/nswalk.c b/drivers/acpi/acpica/nswalk.c
index 200895fa2728..83e3aa6d4b9b 100644
--- a/drivers/acpi/acpica/nswalk.c
+++ b/drivers/acpi/acpica/nswalk.c
@@ -135,8 +135,8 @@ struct acpi_namespace_node *acpi_ns_get_next_node(acpi_object_type type, struct
135 * starting (and ending) at the node specified by start_handle. 135 * starting (and ending) at the node specified by start_handle.
136 * The user_function is called whenever a node that matches 136 * The user_function is called whenever a node that matches
137 * the type parameter is found. If the user function returns 137 * the type parameter is found. If the user function returns
138 * a non-zero value, the search is terminated immediately and this 138 * a non-zero value, the search is terminated immediately and
139 * value is returned to the caller. 139 * this value is returned to the caller.
140 * 140 *
141 * The point of this procedure is to provide a generic namespace 141 * The point of this procedure is to provide a generic namespace
142 * walk routine that can be called from multiple places to 142 * walk routine that can be called from multiple places to
@@ -200,10 +200,10 @@ acpi_ns_walk_namespace(acpi_object_type type,
200 /* 200 /*
201 * Ignore all temporary namespace nodes (created during control 201 * Ignore all temporary namespace nodes (created during control
202 * method execution) unless told otherwise. These temporary nodes 202 * method execution) unless told otherwise. These temporary nodes
203 * can cause a race condition because they can be deleted during the 203 * can cause a race condition because they can be deleted during
204 * execution of the user function (if the namespace is unlocked before 204 * the execution of the user function (if the namespace is
205 * invocation of the user function.) Only the debugger namespace dump 205 * unlocked before invocation of the user function.) Only the
206 * will examine the temporary nodes. 206 * debugger namespace dump will examine the temporary nodes.
207 */ 207 */
208 if ((child_node->flags & ANOBJ_TEMPORARY) && 208 if ((child_node->flags & ANOBJ_TEMPORARY) &&
209 !(flags & ACPI_NS_WALK_TEMP_NODES)) { 209 !(flags & ACPI_NS_WALK_TEMP_NODES)) {