Source-Changes-HG archive

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

[src/trunk]: src/sys/kern Use the qtype_FOREACH macros. Print out address of...



details:   https://anonhg.NetBSD.org/src/rev/4e5104f30169
branches:  trunk
changeset: 535626:4e5104f30169
user:      matt <matt%NetBSD.org@localhost>
date:      Fri Aug 23 20:50:25 2002 +0000

description:
Use the qtype_FOREACH macros.  Print out address of hook that could not
be disestablished.

diffstat:

 sys/kern/kern_subr.c |  22 +++++++++++-----------
 1 files changed, 11 insertions(+), 11 deletions(-)

diffs (77 lines):

diff -r 9e085c20b7cb -r 4e5104f30169 sys/kern/kern_subr.c
--- a/sys/kern/kern_subr.c      Fri Aug 23 18:00:46 2002 +0000
+++ b/sys/kern/kern_subr.c      Fri Aug 23 20:50:25 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_subr.c,v 1.82 2002/07/20 03:58:24 thorpej Exp $   */
+/*     $NetBSD: kern_subr.c,v 1.83 2002/08/23 20:50:25 matt Exp $      */
 
 /*-
  * Copyright (c) 1997, 1998, 1999, 2002 The NetBSD Foundation, Inc.
@@ -90,7 +90,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_subr.c,v 1.82 2002/07/20 03:58:24 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_subr.c,v 1.83 2002/08/23 20:50:25 matt Exp $");
 
 #include "opt_ddb.h"
 #include "opt_md.h"
@@ -408,11 +408,13 @@
 #ifdef DIAGNOSTIC
        struct hook_desc *hd;
 
-       for (hd = list->lh_first; hd != NULL; hd = hd->hk_list.le_next)
+       LIST_FOREACH(hd, list, hk_list) {
                 if (hd == vhook)
                        break;
+       }
+
        if (hd == NULL)
-               panic("hook_disestablish: hook not established");
+               panic("hook_disestablish: hook %p not established", vhook);
 #endif
        LIST_REMOVE((struct hook_desc *)vhook, hk_list);
        free(vhook, M_DEVBUF);
@@ -533,8 +535,7 @@
 {
        struct hook_desc *hd;
 
-       for (hd = mountroothook_list.lh_first; hd != NULL;
-           hd = hd->hk_list.le_next) {
+       LIST_FOREACH(hd, &mountroothook_list, hk_list) {
                if (hd->hk_arg == (void *)root_device) {
                        (*hd->hk_fn)(hd->hk_arg);
                        return;
@@ -641,7 +642,7 @@
        CIRCLEQ_FOREACH(dp, &powerhook_list, sfd_list)
                 if (dp == vhook)
                        goto found;
-       panic("powerhook_disestablish: hook not established");
+       panic("powerhook_disestablish: hook %p not established", vhook);
  found:
 #endif
 
@@ -738,11 +739,11 @@
        if (vops != NULL && vops->vfs_mountroot == mountroot &&
            rootspec == NULL &&
            (bootdv == NULL || bootdv->dv_class != DV_IFNET)) {
-               for (ifp = ifnet.tqh_first; ifp != NULL;
-                   ifp = ifp->if_list.tqe_next)
+               TAILQ_FOREACH(ifp, &ifnet, if_list) {
                        if ((ifp->if_flags &
                             (IFF_LOOPBACK|IFF_POINTOPOINT)) == 0)
                                break;
+               }
                if (ifp == NULL) {
                        /*
                         * Can't find a suitable interface; ask the
@@ -1099,8 +1100,7 @@
                                printf(" %s[a-%c]", raidrootdev[j].dv_xname,
                                    'a' + MAXPARTITIONS - 1);
 #endif
-               for (dv = alldevs.tqh_first; dv != NULL;
-                   dv = dv->dv_list.tqe_next) {
+               TAILQ_FOREACH(dv, &alldevs, dv_list) {
                        if (dv->dv_class == DV_DISK)
                                printf(" %s[a-%c]", dv->dv_xname,
                                    'a' + MAXPARTITIONS - 1);



Home | Main Index | Thread Index | Old Index