aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2008-06-10 02:27:55 -0400
committerAndi Kleen <andi@basil.nowhere.org>2008-07-16 17:27:04 -0400
commitfd0a43276dc986e186eb27e5755a18e97e07a7eb (patch)
tree900a6c92ac01cf03270eb274fffeac799e2dcf2c
parent71d993e115706a4108bdc7e3cb3cf25309f17aa6 (diff)
ACPICA: Cleanup of _PRT parsing code
Removed extraneous else clauses, other general cleanup. 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> Signed-off-by: Andi Kleen <ak@linux.intel.com>
-rw-r--r--drivers/acpi/resources/rscreate.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/acpi/resources/rscreate.c b/drivers/acpi/resources/rscreate.c
index 70c84ece87f1..7804a8c40e7a 100644
--- a/drivers/acpi/resources/rscreate.c
+++ b/drivers/acpi/resources/rscreate.c
@@ -181,9 +181,9 @@ acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object,
181 } 181 }
182 182
183 /* 183 /*
184 * Loop through the ACPI_INTERNAL_OBJECTS - Each object 184 * Loop through the ACPI_INTERNAL_OBJECTS - Each object should be a
185 * should be a package that in turn contains an 185 * package that in turn contains an acpi_integer Address, a u8 Pin,
186 * acpi_integer Address, a u8 Pin, a Name and a u8 source_index. 186 * a Name, and a u8 source_index.
187 */ 187 */
188 top_object_list = package_object->package.elements; 188 top_object_list = package_object->package.elements;
189 number_of_elements = package_object->package.count; 189 number_of_elements = package_object->package.count;
@@ -240,9 +240,7 @@ acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object,
240 /* 1) First subobject: Dereference the PRT.Address */ 240 /* 1) First subobject: Dereference the PRT.Address */
241 241
242 obj_desc = sub_object_list[0]; 242 obj_desc = sub_object_list[0];
243 if (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_INTEGER) { 243 if (ACPI_GET_OBJECT_TYPE(obj_desc) != ACPI_TYPE_INTEGER) {
244 user_prt->address = obj_desc->integer.value;
245 } else {
246 ACPI_ERROR((AE_INFO, 244 ACPI_ERROR((AE_INFO,
247 "(PRT[%X].Address) Need Integer, found %s", 245 "(PRT[%X].Address) Need Integer, found %s",
248 index, 246 index,
@@ -250,12 +248,12 @@ acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object,
250 return_ACPI_STATUS(AE_BAD_DATA); 248 return_ACPI_STATUS(AE_BAD_DATA);
251 } 249 }
252 250
251 user_prt->address = obj_desc->integer.value;
252
253 /* 2) Second subobject: Dereference the PRT.Pin */ 253 /* 2) Second subobject: Dereference the PRT.Pin */
254 254
255 obj_desc = sub_object_list[1]; 255 obj_desc = sub_object_list[1];
256 if (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_INTEGER) { 256 if (ACPI_GET_OBJECT_TYPE(obj_desc) != ACPI_TYPE_INTEGER) {
257 user_prt->pin = (u32) obj_desc->integer.value;
258 } else {
259 ACPI_ERROR((AE_INFO, 257 ACPI_ERROR((AE_INFO,
260 "(PRT[%X].Pin) Need Integer, found %s", 258 "(PRT[%X].Pin) Need Integer, found %s",
261 index, 259 index,
@@ -284,6 +282,8 @@ acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object,
284 } 282 }
285 } 283 }
286 284
285 user_prt->pin = (u32) obj_desc->integer.value;
286
287 /* 287 /*
288 * If the BIOS has erroneously reversed the _PRT source_name (index 2) 288 * If the BIOS has erroneously reversed the _PRT source_name (index 2)
289 * and the source_index (index 3), fix it. _PRT is important enough to 289 * and the source_index (index 3), fix it. _PRT is important enough to
@@ -381,9 +381,7 @@ acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object,
381 /* 4) Fourth subobject: Dereference the PRT.source_index */ 381 /* 4) Fourth subobject: Dereference the PRT.source_index */
382 382
383 obj_desc = sub_object_list[source_index_index]; 383 obj_desc = sub_object_list[source_index_index];
384 if (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_INTEGER) { 384 if (ACPI_GET_OBJECT_TYPE(obj_desc) != ACPI_TYPE_INTEGER) {
385 user_prt->source_index = (u32) obj_desc->integer.value;
386 } else {
387 ACPI_ERROR((AE_INFO, 385 ACPI_ERROR((AE_INFO,
388 "(PRT[%X].SourceIndex) Need Integer, found %s", 386 "(PRT[%X].SourceIndex) Need Integer, found %s",
389 index, 387 index,
@@ -391,6 +389,8 @@ acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object,
391 return_ACPI_STATUS(AE_BAD_DATA); 389 return_ACPI_STATUS(AE_BAD_DATA);
392 } 390 }
393 391
392 user_prt->source_index = (u32) obj_desc->integer.value;
393
394 /* Point to the next union acpi_operand_object in the top level package */ 394 /* Point to the next union acpi_operand_object in the top level package */
395 395
396 top_object_list++; 396 top_object_list++;