Source-Changes-HG archive

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

[src/trunk]: src/sys/kern Simplfy insertion of newly-activated modules into t...



details:   https://anonhg.NetBSD.org/src/rev/5f0a98bb8ceb
branches:  trunk
changeset: 346093:5f0a98bb8ceb
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Fri Jun 24 23:04:09 2016 +0000

description:
Simplfy insertion of newly-activated modules into the list.  There's no
good reason to treat modules without dependencies differently from those
which do require other modules.

diffstat:

 sys/kern/kern_module.c |  13 +++++--------
 1 files changed, 5 insertions(+), 8 deletions(-)

diffs (42 lines):

diff -r cf5c721106a1 -r 5f0a98bb8ceb sys/kern/kern_module.c
--- a/sys/kern/kern_module.c    Fri Jun 24 21:41:37 2016 +0000
+++ b/sys/kern/kern_module.c    Fri Jun 24 23:04:09 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_module.c,v 1.112 2016/06/23 04:41:03 pgoyette Exp $       */
+/*     $NetBSD: kern_module.c,v 1.113 2016/06/24 23:04:09 pgoyette Exp $       */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_module.c,v 1.112 2016/06/23 04:41:03 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_module.c,v 1.113 2016/06/24 23:04:09 pgoyette Exp $");
 
 #define _MODULE_INTERNAL
 
@@ -723,20 +723,17 @@
        KASSERT(kernconfig_is_held());
 
        /*
-        * If there are requisite modules, put at the head of the queue.
-        * This is so that autounload can unload requisite modules with
-        * only one pass through the queue.
+        * Put new entry at the head of the queue so autounload can unload
+        * requisite modules with only one pass through the queue.
         */
+       TAILQ_INSERT_HEAD(&module_list, mod, mod_chain);
        if (mod->mod_nrequired) {
-               TAILQ_INSERT_HEAD(&module_list, mod, mod_chain);
 
                /* Add references to the requisite modules. */
                for (i = 0; i < mod->mod_nrequired; i++) {
                        KASSERT(mod->mod_required[i] != NULL);
                        mod->mod_required[i]->mod_refcnt++;
                }
-       } else {
-               TAILQ_INSERT_TAIL(&module_list, mod, mod_chain);
        }
        module_count++;
        module_gen++;



Home | Main Index | Thread Index | Old Index