Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 May 2014 00:46:03 +0000 (UTC)
From:      Don Lewis <truckman@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r266523 - stable/8/sys/kern
Message-ID:  <201405220046.s4M0k334008697@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: truckman
Date: Thu May 22 00:46:03 2014
New Revision: 266523
URL: http://svnweb.freebsd.org/changeset/base/266523

Log:
  MFC r266426
  
  Slightly restructure the final loop in rman_reserve_resource_bound().
  Replace with the existing loop termination test with a similar
  condition from the nested "if" that may terminate the loop a bit
  sooner, but still not too early.   This condition can then be removed
  from the nested "if".  Relocate an operator to be style(9) compliant.

Modified:
  stable/8/sys/kern/subr_rman.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/kern/   (props changed)

Modified: stable/8/sys/kern/subr_rman.c
==============================================================================
--- stable/8/sys/kern/subr_rman.c	Thu May 22 00:44:14 2014	(r266522)
+++ stable/8/sys/kern/subr_rman.c	Thu May 22 00:46:03 2014	(r266523)
@@ -597,13 +597,10 @@ rman_reserve_resource_bound(struct rman 
 	if ((flags & (RF_SHAREABLE | RF_TIMESHARE)) == 0)
 		goto out;
 
-	for (s = r; s; s = TAILQ_NEXT(s, r_link)) {
-		if (s->r_start > end)
-			break;
-		if ((s->r_flags & flags) != flags)
-			continue;
-		if (s->r_start >= start && s->r_end <= end
-		    && (s->r_end - s->r_start + 1) == count &&
+	for (s = r; s && s->r_end <= end; s = TAILQ_NEXT(s, r_link)) {
+		if ((s->r_flags & flags) == flags &&
+		    s->r_start >= start &&
+		    (s->r_end - s->r_start + 1) == count &&
 		    (s->r_start & amask) == 0 &&
 		    ((s->r_start ^ s->r_end) & bmask) == 0) {
 			rv = int_alloc_resource(M_NOWAIT);



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