Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/kern KNF
details: https://anonhg.NetBSD.org/src/rev/055f8e6e3436
branches: trunk
changeset: 342152:055f8e6e3436
user: maxv <maxv%NetBSD.org@localhost>
date: Wed Dec 09 16:26:16 2015 +0000
description:
KNF
diffstat:
sys/kern/kern_ksyms.c | 39 ++++++++++++++++++---------------------
sys/kern/kern_module.c | 10 +++++-----
2 files changed, 23 insertions(+), 26 deletions(-)
diffs (186 lines):
diff -r ecbd30eff954 -r 055f8e6e3436 sys/kern/kern_ksyms.c
--- a/sys/kern/kern_ksyms.c Wed Dec 09 08:30:03 2015 +0000
+++ b/sys/kern/kern_ksyms.c Wed Dec 09 16:26:16 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_ksyms.c,v 1.81 2015/08/30 01:46:02 uebayasi Exp $ */
+/* $NetBSD: kern_ksyms.c,v 1.82 2015/12/09 16:26:16 maxv Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -73,7 +73,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_ksyms.c,v 1.81 2015/08/30 01:46:02 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_ksyms.c,v 1.82 2015/12/09 16:26:16 maxv Exp $");
#if defined(_KERNEL) && defined(_KERNEL_OPT)
#include "opt_copy_symtab.h"
@@ -336,7 +336,7 @@
nglob = 0;
for (i = n = 0; i < nsyms; i++) {
- /* This breaks CTF mapping, so don't do it when
+ /* This breaks CTF mapping, so don't do it when
* DTrace is enabled
*/
#ifndef KDTRACE_HOOKS
@@ -401,7 +401,7 @@
panic("addsymtab");
#ifdef KDTRACE_HOOKS
- /*
+ /*
* Build the mapping from original symbol id to new symbol table.
* Deleted symbols will have a zero map, indices will be one based
* instead of zero based.
@@ -493,7 +493,7 @@
shdr[ehdr->e_shstrndx].sh_offset;
for (i = 1; i < ehdr->e_shnum; i++) {
#ifdef DEBUG
- printf("ksyms: checking %s\n", &shstr[shdr[i].sh_name]);
+ printf("ksyms: checking %s\n", &shstr[shdr[i].sh_name]);
#endif
if (shdr[i].sh_type != SHT_PROGBITS)
continue;
@@ -511,7 +511,7 @@
}
#ifdef DEBUG
} else {
- printf("ksyms: e_shstrndx == 0\n");
+ printf("ksyms: e_shstrndx == 0\n");
#endif
}
#endif
@@ -539,9 +539,8 @@
*/
void
ksyms_addsyms_explicit(void *ehdr, void *symstart, size_t symsize,
- void *strstart, size_t strsize)
+ void *strstart, size_t strsize)
{
-
if (!ksyms_verify(symstart, strstart))
return;
@@ -561,7 +560,7 @@
*/
int
ksyms_getval_unlocked(const char *mod, const char *sym, unsigned long *val,
- int type)
+ int type)
{
struct ksyms_symtab *st;
Elf_Sym *es;
@@ -729,7 +728,7 @@
*/
void
ksyms_modload(const char *name, void *symstart, vsize_t symsize,
- char *strstart, vsize_t strsize)
+ char *strstart, vsize_t strsize)
{
struct ksyms_symtab *st;
@@ -839,20 +838,20 @@
static void
ksyms_sizes_calc(void)
{
- struct ksyms_symtab *st;
+ struct ksyms_symtab *st;
int i, delta;
- ksyms_symsz = ksyms_strsz = 0;
- TAILQ_FOREACH(st, &ksyms_symtabs, sd_queue) {
+ ksyms_symsz = ksyms_strsz = 0;
+ TAILQ_FOREACH(st, &ksyms_symtabs, sd_queue) {
delta = ksyms_strsz - st->sd_usroffset;
if (delta != 0) {
for (i = 0; i < st->sd_symsize/sizeof(Elf_Sym); i++)
st->sd_symstart[i].st_name += delta;
st->sd_usroffset = ksyms_strsz;
}
- ksyms_symsz += st->sd_symsize;
- ksyms_strsz += st->sd_strsize;
- }
+ ksyms_symsz += st->sd_symsize;
+ ksyms_strsz += st->sd_strsize;
+ }
}
static void
@@ -949,7 +948,6 @@
static int
ksymsopen(dev_t dev, int oflags, int devtype, struct lwp *l)
{
-
if (minor(dev) != 0 || !ksyms_loaded)
return ENXIO;
@@ -978,7 +976,7 @@
struct ksyms_symtab *st, *next;
bool resize;
- /* Discard refernces to symbol tables. */
+ /* Discard references to symbol tables. */
mutex_enter(&ksyms_lock);
ksyms_isopen = false;
resize = false;
@@ -1074,7 +1072,6 @@
static int
ksymswrite(dev_t dev, struct uio *uio, int ioflag)
{
-
return EROFS;
}
@@ -1097,8 +1094,8 @@
/* Read ksyms_maxlen only once while not holding the lock. */
len = ksyms_maxlen;
- if (cmd == OKIOCGVALUE || cmd == OKIOCGSYMBOL
- || cmd == KIOCGVALUE || cmd == KIOCGSYMBOL) {
+ if (cmd == OKIOCGVALUE || cmd == OKIOCGSYMBOL ||
+ cmd == KIOCGVALUE || cmd == KIOCGSYMBOL) {
str = kmem_alloc(len, KM_SLEEP);
if ((error = copyinstr(kg->kg_name, str, len, NULL)) != 0) {
kmem_free(str, len);
diff -r ecbd30eff954 -r 055f8e6e3436 sys/kern/kern_module.c
--- a/sys/kern/kern_module.c Wed Dec 09 08:30:03 2015 +0000
+++ b/sys/kern/kern_module.c Wed Dec 09 16:26:16 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_module.c,v 1.108 2015/11/03 03:33:43 pgoyette Exp $ */
+/* $NetBSD: kern_module.c,v 1.109 2015/12/09 16:26:16 maxv 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.108 2015/11/03 03:33:43 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_module.c,v 1.109 2015/12/09 16:26:16 maxv Exp $");
#define _MODULE_INTERNAL
@@ -950,7 +950,7 @@
depth--;
return 0;
}
- }
+ }
mod = module_newmodule(MODULE_SOURCE_FILESYS);
if (mod == NULL) {
module_error("out of memory for `%s'", name);
@@ -1050,10 +1050,10 @@
continue;
}
if (strcmp(mod2->mod_info->mi_name, mi->mi_name) == 0) {
- error = EDEADLK;
+ error = EDEADLK;
module_error("circular dependency detected for `%s'",
mi->mi_name);
- goto fail;
+ goto fail;
}
}
Home |
Main Index |
Thread Index |
Old Index