If we failed to find an ACPI device to correspond to an ANDD record, we
would fail to increment our pointer and would just process the same record
over and over again, with predictable results.
Turn it from a while() loop into a for() loop to let the 'continue' in
the error paths work correctly.
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
if (dmar_tbl == NULL)
return -ENODEV;
- andd = (void *)dmar_tbl + sizeof(struct acpi_table_dmar);
-
- while (((unsigned long)andd) <
- ((unsigned long)dmar_tbl) + dmar_tbl->length) {
+ for (andd = (void *)dmar_tbl + sizeof(struct acpi_table_dmar);
+ ((unsigned long)andd) < ((unsigned long)dmar_tbl) + dmar_tbl->length;
+ andd = ((void *)andd) + andd->header.length) {
if (andd->header.type == ACPI_DMAR_TYPE_ANDD) {
acpi_handle h;
struct acpi_device *adev;
}
dmar_acpi_insert_dev_scope(andd->device_number, adev);
}
- andd = ((void *)andd) + andd->header.length;
}
return 0;
}