Source-Changes-HG archive

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

[src/pgoyette-compat]: src/sys/kern Typos (new = old, not old = new!), whites...



details:   https://anonhg.NetBSD.org/src/rev/29d6d3a56ccb
branches:  pgoyette-compat
changeset: 830557:29d6d3a56ccb
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Mon Apr 02 00:18:43 2018 +0000

description:
Typos (new = old, not old = new!), whitespace, and consistency in
references to the dynamically allocated array of required modules.

diffstat:

 sys/kern/kern_module.c |  14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diffs (50 lines):

diff -r 6ec63c95e97e -r 29d6d3a56ccb sys/kern/kern_module.c
--- a/sys/kern/kern_module.c    Sun Apr 01 23:07:57 2018 +0000
+++ b/sys/kern/kern_module.c    Mon Apr 02 00:18:43 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_module.c,v 1.130.2.7 2018/04/01 23:06:11 pgoyette Exp $   */
+/*     $NetBSD: kern_module.c,v 1.130.2.8 2018/04/02 00:18:43 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.7 2018/04/01 23:06:11 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_module.c,v 1.130.2.8 2018/04/02 00:18:43 pgoyette Exp $");
 
 #define _MODULE_INTERNAL
 
@@ -787,10 +787,10 @@
 
        if (mod->mod_nrequired >= mod->mod_arequired) {
                areq = mod->mod_arequired + MAXMODDEPS;
-               old= mod->mod_required;
-               new= kmem_alloc(areq * sizeof(module_t *), KM_SLEEP);
+               old = mod->mod_required;
+               new = kmem_zalloc(areq * sizeof(module_t *), KM_SLEEP);
                for (i = 0; i< mod->mod_arequired; i++)
-                       (*old)[i] = (*new)[i];
+                       (*new)[i] = (*old)[i];
                mod->mod_required = new;
                if (old)
                        kmem_free(old, mod->mod_arequired * sizeof(module_t *));
@@ -870,7 +870,7 @@
                        error = module_do_builtin(mod, buf, &mod2, NULL);
                        if (error != 0)
                                goto fail;
-                       *mod->mod_required[mod->mod_nrequired++] = mod2;
+                       (*mod->mod_required)[mod->mod_nrequired++] = mod2;
                }
        }
 
@@ -1172,7 +1172,7 @@
                                    buf, error);
                                goto fail;
                        }
-                       *mod->mod_required[mod->mod_nrequired++] = mod2;
+                       (*mod->mod_required)[mod->mod_nrequired++] = mod2;
                }
        }
 



Home | Main Index | Thread Index | Old Index