Fri Apr 26 08:38:25 2019 UTC ()
Set the "required modules" to NULL, not to an empty string.

It really doesn't make that much difference to the code, but the output
from modstat(8) is different!  (With an empty string in the MODULE() macro
modstat reports an empty string, but with a NULL in the macro, modstat
prints a '-' just like it does for other "empty" fields.)


(pgoyette)
diff -r1.28 -r1.29 src/sys/dev/sysmon/sysmon.c
diff -r1.47 -r1.48 src/sys/kern/sys_ptrace_common.c
diff -r1.106 -r1.107 src/sys/net/if_loop.c
diff -r1.155 -r1.156 src/sys/net/if_tun.c

cvs diff -r1.28 -r1.29 src/sys/dev/sysmon/sysmon.c (expand / switch to unified diff)

--- src/sys/dev/sysmon/sysmon.c 2015/05/05 09:22:33 1.28
+++ src/sys/dev/sysmon/sysmon.c 2019/04/26 08:38:25 1.29
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: sysmon.c,v 1.28 2015/05/05 09:22:33 pgoyette Exp $ */ 1/* $NetBSD: sysmon.c,v 1.29 2019/04/26 08:38:25 pgoyette Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2000 Zembu Labs, Inc. 4 * Copyright (c) 2000 Zembu Labs, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Author: Jason R. Thorpe <thorpej@zembu.com> 7 * Author: Jason R. Thorpe <thorpej@zembu.com>
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -29,27 +29,27 @@ @@ -29,27 +29,27 @@
29 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 29 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 30 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 31 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 32 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
33 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 */ 34 */
35 35
36/* 36/*
37 * Clearing house for system monitoring hardware. We currently 37 * Clearing house for system monitoring hardware. We currently
38 * handle environmental sensors, watchdog timers, and power management. 38 * handle environmental sensors, watchdog timers, and power management.
39 */ 39 */
40 40
41#include <sys/cdefs.h> 41#include <sys/cdefs.h>
42__KERNEL_RCSID(0, "$NetBSD: sysmon.c,v 1.28 2015/05/05 09:22:33 pgoyette Exp $"); 42__KERNEL_RCSID(0, "$NetBSD: sysmon.c,v 1.29 2019/04/26 08:38:25 pgoyette Exp $");
43 43
44#include <sys/param.h> 44#include <sys/param.h>
45#include <sys/conf.h> 45#include <sys/conf.h>
46#include <sys/errno.h> 46#include <sys/errno.h>
47#include <sys/fcntl.h> 47#include <sys/fcntl.h>
48#include <sys/callout.h> 48#include <sys/callout.h>
49#include <sys/kernel.h> 49#include <sys/kernel.h>
50#include <sys/systm.h> 50#include <sys/systm.h>
51#include <sys/proc.h> 51#include <sys/proc.h>
52#include <sys/module.h> 52#include <sys/module.h>
53#include <sys/mutex.h> 53#include <sys/mutex.h>
54#include <sys/device.h> 54#include <sys/device.h>
55#include <sys/once.h> 55#include <sys/once.h>
@@ -297,27 +297,27 @@ sysmonkqfilter(dev_t dev, struct knote * @@ -297,27 +297,27 @@ sysmonkqfilter(dev_t dev, struct knote *
297 if (sysmon_opvec_table[minor(dev)] == NULL) 297 if (sysmon_opvec_table[minor(dev)] == NULL)
298 error = ENODEV; 298 error = ENODEV;
299 else 299 else
300 error = (sysmon_opvec_table[minor(dev)]->so_filter)(dev, 300 error = (sysmon_opvec_table[minor(dev)]->so_filter)(dev,
301 kn); 301 kn);
302 break; 302 break;
303 default: 303 default:
304 error = 1; 304 error = 1;
305 } 305 }
306 306
307 return (error); 307 return (error);
308} 308}
309 309
310MODULE(MODULE_CLASS_DRIVER, sysmon, ""); 310MODULE(MODULE_CLASS_DRIVER, sysmon, NULL);
311 311
312static int 312static int
313sm_init_once(void) 313sm_init_once(void)
314{ 314{
315 315
316 mutex_init(&sysmon_minor_mtx, MUTEX_DEFAULT, IPL_NONE); 316 mutex_init(&sysmon_minor_mtx, MUTEX_DEFAULT, IPL_NONE);
317 317
318 return 0; 318 return 0;
319} 319}
320 320
321int 321int
322sysmon_init(void) 322sysmon_init(void)
323{ 323{

cvs diff -r1.47 -r1.48 src/sys/kern/sys_ptrace_common.c (expand / switch to unified diff)

--- src/sys/kern/sys_ptrace_common.c 2019/02/03 03:19:28 1.47
+++ src/sys/kern/sys_ptrace_common.c 2019/04/26 08:38:25 1.48
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: sys_ptrace_common.c,v 1.47 2019/02/03 03:19:28 mrg Exp $ */ 1/* $NetBSD: sys_ptrace_common.c,v 1.48 2019/04/26 08:38:25 pgoyette Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. 4 * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Andrew Doran. 8 * by Andrew Doran.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -108,27 +108,27 @@ @@ -108,27 +108,27 @@
108 108
109/* 109/*
110 * References: 110 * References:
111 * (1) Bach's "The Design of the UNIX Operating System", 111 * (1) Bach's "The Design of the UNIX Operating System",
112 * (2) sys/miscfs/procfs from UCB's 4.4BSD-Lite distribution, 112 * (2) sys/miscfs/procfs from UCB's 4.4BSD-Lite distribution,
113 * (3) the "4.4BSD Programmer's Reference Manual" published 113 * (3) the "4.4BSD Programmer's Reference Manual" published
114 * by USENIX and O'Reilly & Associates. 114 * by USENIX and O'Reilly & Associates.
115 * The 4.4BSD PRM does a reasonably good job of documenting what the various 115 * The 4.4BSD PRM does a reasonably good job of documenting what the various
116 * ptrace() requests should actually do, and its text is quoted several times 116 * ptrace() requests should actually do, and its text is quoted several times
117 * in this file. 117 * in this file.
118 */ 118 */
119 119
120#include <sys/cdefs.h> 120#include <sys/cdefs.h>
121__KERNEL_RCSID(0, "$NetBSD: sys_ptrace_common.c,v 1.47 2019/02/03 03:19:28 mrg Exp $"); 121__KERNEL_RCSID(0, "$NetBSD: sys_ptrace_common.c,v 1.48 2019/04/26 08:38:25 pgoyette Exp $");
122 122
123#ifdef _KERNEL_OPT 123#ifdef _KERNEL_OPT
124#include "opt_ptrace.h" 124#include "opt_ptrace.h"
125#include "opt_ktrace.h" 125#include "opt_ktrace.h"
126#include "opt_pax.h" 126#include "opt_pax.h"
127#include "opt_compat_netbsd32.h" 127#include "opt_compat_netbsd32.h"
128#endif 128#endif
129 129
130#if defined(__HAVE_COMPAT_NETBSD32) && !defined(COMPAT_NETBSD32) \ 130#if defined(__HAVE_COMPAT_NETBSD32) && !defined(COMPAT_NETBSD32) \
131 && !defined(_RUMPKERNEL) 131 && !defined(_RUMPKERNEL)
132#define COMPAT_NETBSD32 132#define COMPAT_NETBSD32
133#endif 133#endif
134 134
@@ -1566,27 +1566,27 @@ process_auxv_offset(struct proc *p, stru @@ -1566,27 +1566,27 @@ process_auxv_offset(struct proc *p, stru
1566#ifdef __MACHINE_STACK_GROWS_UP 1566#ifdef __MACHINE_STACK_GROWS_UP
1567 if (uio->uio_offset < off) 1567 if (uio->uio_offset < off)
1568 return EIO; 1568 return EIO;
1569#else 1569#else
1570 if (uio->uio_offset > off) 1570 if (uio->uio_offset > off)
1571 return EIO; 1571 return EIO;
1572 if ((uio->uio_offset + uio->uio_resid) > off) 1572 if ((uio->uio_offset + uio->uio_resid) > off)
1573 uio->uio_resid = off - uio->uio_offset; 1573 uio->uio_resid = off - uio->uio_offset;
1574#endif 1574#endif
1575 return 0; 1575 return 0;
1576} 1576}
1577#endif /* PTRACE */ 1577#endif /* PTRACE */
1578 1578
1579MODULE(MODULE_CLASS_EXEC, ptrace_common, ""); 1579MODULE(MODULE_CLASS_EXEC, ptrace_common, NULL);
1580  1580
1581static int 1581static int
1582ptrace_common_modcmd(modcmd_t cmd, void *arg) 1582ptrace_common_modcmd(modcmd_t cmd, void *arg)
1583{ 1583{
1584 int error; 1584 int error;
1585  1585
1586 switch (cmd) { 1586 switch (cmd) {
1587 case MODULE_CMD_INIT: 1587 case MODULE_CMD_INIT:
1588 error = ptrace_init(); 1588 error = ptrace_init();
1589 break; 1589 break;
1590 case MODULE_CMD_FINI: 1590 case MODULE_CMD_FINI:
1591 error = ptrace_fini(); 1591 error = ptrace_fini();
1592 break; 1592 break;

cvs diff -r1.106 -r1.107 src/sys/net/if_loop.c (expand / switch to unified diff)

--- src/sys/net/if_loop.c 2018/11/15 10:06:07 1.106
+++ src/sys/net/if_loop.c 2019/04/26 08:38:25 1.107
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: if_loop.c,v 1.106 2018/11/15 10:06:07 maxv Exp $ */ 1/* $NetBSD: if_loop.c,v 1.107 2019/04/26 08:38:25 pgoyette Exp $ */
2 2
3/* 3/*
4 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 4 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -55,27 +55,27 @@ @@ -55,27 +55,27 @@
55 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 55 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
56 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 56 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
57 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 57 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
58 * SUCH DAMAGE. 58 * SUCH DAMAGE.
59 * 59 *
60 * @(#)if_loop.c 8.2 (Berkeley) 1/9/95 60 * @(#)if_loop.c 8.2 (Berkeley) 1/9/95
61 */ 61 */
62 62
63/* 63/*
64 * Loopback interface driver for protocol testing and timing. 64 * Loopback interface driver for protocol testing and timing.
65 */ 65 */
66 66
67#include <sys/cdefs.h> 67#include <sys/cdefs.h>
68__KERNEL_RCSID(0, "$NetBSD: if_loop.c,v 1.106 2018/11/15 10:06:07 maxv Exp $"); 68__KERNEL_RCSID(0, "$NetBSD: if_loop.c,v 1.107 2019/04/26 08:38:25 pgoyette Exp $");
69 69
70#ifdef _KERNEL_OPT 70#ifdef _KERNEL_OPT
71#include "opt_inet.h" 71#include "opt_inet.h"
72#include "opt_atalk.h" 72#include "opt_atalk.h"
73#include "opt_mbuftrace.h" 73#include "opt_mbuftrace.h"
74#include "opt_mpls.h" 74#include "opt_mpls.h"
75#include "opt_net_mpsafe.h" 75#include "opt_net_mpsafe.h"
76#endif 76#endif
77 77
78#include <sys/param.h> 78#include <sys/param.h>
79#include <sys/systm.h> 79#include <sys/systm.h>
80#include <sys/kernel.h> 80#include <sys/kernel.h>
81#include <sys/mbuf.h> 81#include <sys/mbuf.h>
@@ -520,14 +520,14 @@ loioctl(struct ifnet *ifp, u_long cmd, v @@ -520,14 +520,14 @@ loioctl(struct ifnet *ifp, u_long cmd, v
520 break; 520 break;
521 521
522 default: 522 default:
523 error = ifioctl_common(ifp, cmd, data); 523 error = ifioctl_common(ifp, cmd, data);
524 } 524 }
525 return (error); 525 return (error);
526} 526}
527 527
528/* 528/*
529 * Module infrastructure 529 * Module infrastructure
530 */ 530 */
531#include "if_module.h" 531#include "if_module.h"
532 532
533IF_MODULE(MODULE_CLASS_DRIVER, loop, "") 533IF_MODULE(MODULE_CLASS_DRIVER, loop, NULL)

cvs diff -r1.155 -r1.156 src/sys/net/if_tun.c (expand / switch to unified diff)

--- src/sys/net/if_tun.c 2019/03/25 10:04:48 1.155
+++ src/sys/net/if_tun.c 2019/04/26 08:38:25 1.156
@@ -1,35 +1,35 @@ @@ -1,35 +1,35 @@
1/* $NetBSD: if_tun.c,v 1.155 2019/03/25 10:04:48 pgoyette Exp $ */ 1/* $NetBSD: if_tun.c,v 1.156 2019/04/26 08:38:25 pgoyette Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1988, Julian Onions <jpo@cs.nott.ac.uk> 4 * Copyright (c) 1988, Julian Onions <jpo@cs.nott.ac.uk>
5 * Nottingham University 1987. 5 * Nottingham University 1987.
6 * 6 *
7 * This source may be freely distributed, however I would be interested 7 * This source may be freely distributed, however I would be interested
8 * in any changes that are made. 8 * in any changes that are made.
9 * 9 *
10 * This driver takes packets off the IP i/f and hands them up to a 10 * This driver takes packets off the IP i/f and hands them up to a
11 * user process to have its wicked way with. This driver has its 11 * user process to have its wicked way with. This driver has its
12 * roots in a similar driver written by Phil Cockcroft (formerly) at 12 * roots in a similar driver written by Phil Cockcroft (formerly) at
13 * UCL. This driver is based much more on read/write/poll mode of 13 * UCL. This driver is based much more on read/write/poll mode of
14 * operation though. 14 * operation though.
15 */ 15 */
16 16
17/* 17/*
18 * tun - tunnel software network interface. 18 * tun - tunnel software network interface.
19 */ 19 */
20 20
21#include <sys/cdefs.h> 21#include <sys/cdefs.h>
22__KERNEL_RCSID(0, "$NetBSD: if_tun.c,v 1.155 2019/03/25 10:04:48 pgoyette Exp $"); 22__KERNEL_RCSID(0, "$NetBSD: if_tun.c,v 1.156 2019/04/26 08:38:25 pgoyette Exp $");
23 23
24#ifdef _KERNEL_OPT 24#ifdef _KERNEL_OPT
25#include "opt_inet.h" 25#include "opt_inet.h"
26#endif 26#endif
27 27
28#include <sys/param.h> 28#include <sys/param.h>
29 29
30#include <sys/buf.h> 30#include <sys/buf.h>
31#include <sys/conf.h> 31#include <sys/conf.h>
32#include <sys/cpu.h> 32#include <sys/cpu.h>
33#include <sys/device.h> 33#include <sys/device.h>
34#include <sys/file.h> 34#include <sys/file.h>
35#include <sys/ioctl.h> 35#include <sys/ioctl.h>
@@ -1132,14 +1132,14 @@ tunkqfilter(dev_t dev, struct knote *kn) @@ -1132,14 +1132,14 @@ tunkqfilter(dev_t dev, struct knote *kn)
1132 SLIST_INSERT_HEAD(klist, kn, kn_selnext); 1132 SLIST_INSERT_HEAD(klist, kn, kn_selnext);
1133 1133
1134out: 1134out:
1135 mutex_exit(&tp->tun_lock); 1135 mutex_exit(&tp->tun_lock);
1136out_nolock: 1136out_nolock:
1137 return rv; 1137 return rv;
1138} 1138}
1139 1139
1140/* 1140/*
1141 * Module infrastructure 1141 * Module infrastructure
1142 */ 1142 */
1143#include "if_module.h" 1143#include "if_module.h"
1144 1144
1145IF_MODULE(MODULE_CLASS_DRIVER, tun, "") 1145IF_MODULE(MODULE_CLASS_DRIVER, tun, NULL)