summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_rman.c
diff options
context:
space:
mode:
authortruckman <truckman@FreeBSD.org>2014-05-22 00:39:49 +0000
committertruckman <truckman@FreeBSD.org>2014-05-22 00:39:49 +0000
commit9993a9886384af1f50f9273ee660fca9787239ea (patch)
tree9cd3de14ee664a495444f7d58af4baf90072f5a7 /sys/kern/subr_rman.c
parentb8b04794bc5c51907aa5c96dc439d9100ba6a9cd (diff)
downloadFreeBSD-src-9993a9886384af1f50f9273ee660fca9787239ea.zip
FreeBSD-src-9993a9886384af1f50f9273ee660fca9787239ea.tar.gz
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.
Diffstat (limited to 'sys/kern/subr_rman.c')
-rw-r--r--sys/kern/subr_rman.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/sys/kern/subr_rman.c b/sys/kern/subr_rman.c
index 4101c86..5ae96e9 100644
--- a/sys/kern/subr_rman.c
+++ b/sys/kern/subr_rman.c
@@ -602,13 +602,10 @@ rman_reserve_resource_bound(struct rman *rm, u_long start, u_long end,
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);
OpenPOWER on IntegriCloud