Simplify the code a bit.

Replace clumsy for(;;) { if (foo) break; ...} with simpler
while (!foo) { ... }.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D13546
This commit is contained in:
Warner Losh 2017-12-20 19:14:16 +00:00
parent 9b94cc2482
commit 4571c92f4b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=327037

View File

@ -1014,10 +1014,7 @@ acpi_hint_device_unit(device_t acdev, device_t child, const char *name,
* name to see if one's resources are a subset of this device.
*/
line = 0;
for (;;) {
if (resource_find_dev(&line, name, &unit, "at", NULL) != 0)
break;
while (resource_find_dev(&line, name, &unit, "at", NULL) == 0) {
/* Must have an "at" for acpi or isa. */
resource_string_value(name, unit, "at", &s);
if (!(strcmp(s, "acpi0") == 0 || strcmp(s, "acpi") == 0 ||