Source-Changes-HG archive

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

[src/pgoyette-compat]: src/sys/kern Use SET, CLR, ISSET macros from types.h



details:   https://anonhg.NetBSD.org/src/rev/ba2d905e80ed
branches:  pgoyette-compat
changeset: 320435:ba2d905e80ed
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Sun Jul 08 07:33:14 2018 +0000

description:
Use SET, CLR, ISSET macros from types.h

NFCI

diffstat:

 sys/kern/kern_module.c     |  18 +++++++++---------
 sys/kern/kern_module_vfs.c |   8 ++++----
 sys/kern/sys_module.c      |   7 ++++---
 3 files changed, 17 insertions(+), 16 deletions(-)

diffs (138 lines):

diff -r 20cf0987b7f1 -r ba2d905e80ed sys/kern/kern_module.c
--- a/sys/kern/kern_module.c    Mon Jun 25 11:22:57 2018 +0000
+++ b/sys/kern/kern_module.c    Sun Jul 08 07:33:14 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_module.c,v 1.130.2.10 2018/06/25 08:50:10 pgoyette Exp $  */
+/*     $NetBSD: kern_module.c,v 1.130.2.11 2018/07/08 07:33:14 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.130.2.10 2018/06/25 08:50:10 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_module.c,v 1.130.2.11 2018/07/08 07:33:14 pgoyette Exp $");
 
 #define _MODULE_INTERNAL
 
@@ -256,7 +256,7 @@
 static void
 module_require_force(struct module *mod)
 {
-       mod->mod_flags |= MODFLG_MUST_FORCE;
+       SET(mod->mod_flags, MODFLG_MUST_FORCE);
 }
 
 /*
@@ -577,7 +577,7 @@
                         * (If the module has previously been set to
                         * MODFLG_MUST_FORCE, don't try to override that!)
                         */
-                       if ((mod->mod_flags & MODFLG_MUST_FORCE) ||
+                       if (ISSET(mod->mod_flags, MODFLG_MUST_FORCE) ||
                            module_do_builtin(mod, mi->mi_name, NULL,
                            NULL) != 0) {
                                TAILQ_REMOVE(&module_builtins, mod, mod_chain);
@@ -1039,8 +1039,8 @@
                }
        }
        if (mod) {
-               if ((mod->mod_flags & MODFLG_MUST_FORCE) &&
-                   (flags & MODCTL_LOAD_FORCE) == 0) {
+               if (ISSET(mod->mod_flags, MODFLG_MUST_FORCE)) &&
+                   !ISSET(flags, MODCTL_LOAD_FORCE)) {
                        if (!autoload) {
                                module_error("use -f to reinstate "
                                    "builtin module `%s'", name);
@@ -1130,7 +1130,7 @@
        if (!module_compatible(mi->mi_version, __NetBSD_Version__)) {
                module_error("module `%s' built for `%d', system `%d'",
                    mi->mi_name, mi->mi_version, __NetBSD_Version__);
-               if ((flags & MODCTL_LOAD_FORCE) != 0) {
+               if (ISSET(flags, MODCTL_LOAD_FORCE)) {
                        module_error("forced load, system may be unstable");
                } else {
                        error = EPROGMISMATCH;
@@ -1311,7 +1311,7 @@
                 * a short delay unless auto-unload is disabled.
                 */
                mod->mod_autotime = time_second + module_autotime;
-               mod->mod_flags |= MODFLG_AUTO_LOADED;
+               SET(mod->mod_flags, MODFLG_AUTO_LOADED);
                module_thread_kick();
        }
        SLIST_REMOVE_HEAD(&pend_stack, pe_entry);
@@ -1544,7 +1544,7 @@
                        if (mod->mod_source == MODULE_SOURCE_KERNEL)
                                continue;
                        /* skip modules that weren't auto-loaded */
-                       if ((mod->mod_flags & MODFLG_AUTO_LOADED) == 0)
+                       if (!ISSET(mod->mod_flags, MODFLG_AUTO_LOADED))
                                continue;
 
                        if (uvmexp.free < uvmexp.freemin) {
diff -r 20cf0987b7f1 -r ba2d905e80ed sys/kern/kern_module_vfs.c
--- a/sys/kern/kern_module_vfs.c        Mon Jun 25 11:22:57 2018 +0000
+++ b/sys/kern/kern_module_vfs.c        Sun Jul 08 07:33:14 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_module_vfs.c,v 1.16 2017/06/01 02:45:13 chs Exp $ */
+/*     $NetBSD: kern_module_vfs.c,v 1.16.8.1 2018/07/08 07:33:14 pgoyette Exp $        */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_module_vfs.c,v 1.16 2017/06/01 02:45:13 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_module_vfs.c,v 1.16.8.1 2018/07/08 07:33:14 pgoyette Exp $");
 
 #define _MODULE_INTERNAL
 #include <sys/param.h>
@@ -106,7 +106,7 @@
        /*
         * Load and process <module>.plist if it exists.
         */
-       if (((flags & MODCTL_NO_PROP) == 0 && filedictp) || autoload) {
+       if ((!ISSET(flags, MODCTL_NO_PROP) && filedictp) || autoload) {
                error = module_load_plist_vfs(path, nochroot, &moduledict);
                if (error != 0) {
                        module_print("plist load returned error %d for `%s'",
@@ -124,7 +124,7 @@
                        }
                }
                if (error == 0) {       /* can get here if error == ENOENT */
-                       if ((flags & MODCTL_NO_PROP) == 0 && filedictp)
+                       if (!ISSET(flags, MODCTL_NO_PROP) && filedictp)
                                *filedictp = moduledict;
                        else 
                                prop_object_release(moduledict);
diff -r 20cf0987b7f1 -r ba2d905e80ed sys/kern/sys_module.c
--- a/sys/kern/sys_module.c     Mon Jun 25 11:22:57 2018 +0000
+++ b/sys/kern/sys_module.c     Sun Jul 08 07:33:14 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sys_module.c,v 1.23.2.6 2018/04/03 08:29:44 pgoyette Exp $     */
+/*     $NetBSD: sys_module.c,v 1.23.2.7 2018/07/08 07:33:14 pgoyette Exp $     */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sys_module.c,v 1.23.2.6 2018/04/03 08:29:44 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_module.c,v 1.23.2.7 2018/07/08 07:33:14 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_modular.h"
@@ -119,7 +119,8 @@
        strlcpy(ms->ms_name, *aliasp, sizeof(ms->ms_name));
        ms->ms_class = mi->mi_class;
        ms->ms_source = mod->mod_source;
-       ms->ms_flags = mod->mod_flags | MODFLG_IS_ALIAS;
+       ms->ms_flags = mod->mod_flags;
+       SET(ms->ms_flags, MODFLG_IS_ALIAS);
        ms->ms_reqoffset = 0;
 }
 



Home | Main Index | Thread Index | Old Index