Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern avoid a goto.



details:   https://anonhg.NetBSD.org/src/rev/1e39a9550c77
branches:  trunk
changeset: 585077:1e39a9550c77
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Oct 16 00:28:04 2005 +0000

description:
avoid a goto.

diffstat:

 sys/kern/subr_pool.c |  13 ++++---------
 1 files changed, 4 insertions(+), 9 deletions(-)

diffs (41 lines):

diff -r d14670676433 -r 1e39a9550c77 sys/kern/subr_pool.c
--- a/sys/kern/subr_pool.c      Sun Oct 16 00:14:22 2005 +0000
+++ b/sys/kern/subr_pool.c      Sun Oct 16 00:28:04 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: subr_pool.c,v 1.103 2005/10/15 21:22:46 chs Exp $      */
+/*     $NetBSD: subr_pool.c,v 1.104 2005/10/16 00:28:04 christos Exp $ */
 
 /*-
  * Copyright (c) 1997, 1999, 2000 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_pool.c,v 1.103 2005/10/15 21:22:46 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_pool.c,v 1.104 2005/10/16 00:28:04 christos Exp $");
 
 #include "opt_pool.h"
 #include "opt_poollog.h"
@@ -2077,9 +2077,8 @@
        LOCK_ASSERT(simple_lock_held(&pc->pc_slock));
        LOCK_ASSERT(simple_lock_held(&pc->pc_pool->pr_slock));
 
-       for (pcg = LIST_FIRST(&pc->pc_fullgroups); pcg != NULL; pcg = npcg) {
-
-loop:
+       for (pcg = LIST_FIRST(&pc->pc_fullgroups); pcg != NULL;
+           pcg = npcg ? npcg : LIST_FIRST(&pc->pc_partgroups)) {
                npcg = LIST_NEXT(pcg, pcg_list);
                while (pcg->pcg_avail != 0) {
                        pc->pc_nitems--;
@@ -2092,10 +2091,6 @@
                LIST_REMOVE(pcg, pcg_list);
                LIST_INSERT_HEAD(pcgl, pcg, pcg_list);
        }
-       pcg = LIST_FIRST(&pc->pc_partgroups);
-       if (pcg != NULL) {
-               goto loop;
-       }
 
        KASSERT(LIST_EMPTY(&pc->pc_partgroups));
        KASSERT(LIST_EMPTY(&pc->pc_fullgroups));



Home | Main Index | Thread Index | Old Index