Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Dec 2017 19:14:16 +0000 (UTC)
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r327037 - head/sys/dev/acpica
Message-ID:  <201712201914.vBKJEG68087359@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: imp
Date: Wed Dec 20 19:14:16 2017
New Revision: 327037
URL: https://svnweb.freebsd.org/changeset/base/327037

Log:
  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

Modified:
  head/sys/dev/acpica/acpi.c

Modified: head/sys/dev/acpica/acpi.c
==============================================================================
--- head/sys/dev/acpica/acpi.c	Wed Dec 20 19:14:11 2017	(r327036)
+++ head/sys/dev/acpica/acpi.c	Wed Dec 20 19:14:16 2017	(r327037)
@@ -1014,10 +1014,7 @@ acpi_hint_device_unit(device_t acdev, device_t child, 
      * 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 ||



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201712201914.vBKJEG68087359>