Fix nagging make_dev() warnings

Frank W. Josellis frank at dynamical-systems.org
Wed Aug 30 07:54:06 PDT 2006


Currently I'm receiving the following warning whenever moused is invoked:

Starting moused:
WARNING: driver sc should register devices with make_dev() (dev_t = "#sc/255")

Actually nothing appears to be wrong with the sysmouse, so this is quite 
annoying and I've tried to get rid of these messages. Please consider the 
two patches below for fixing this issue.

Note that spec_vnops.c.patch just reimplements a feature of the FreeBSD 
4.x kernel (which in my opinion doesn't hurt). This prevents repetitions 
of the above warning, but it occurs once at the initial start of moused. 
The second patch corrects this (though it's not clear to me why it occurs 
at all).

Frank Josellis


--- spec_vnops.c.patch begins here ---
--- sys/vfs/specfs/spec_vnops.c.orig	2006-08-12 02:26:21.000000000 +0200
+++ sys/vfs/specfs/spec_vnops.c	2006-08-30 14:02:41.000000000 +0200
@@ -268,9 +268,10 @@
 	}
 	if ((dev_dflags(dev) & D_DISK) == 0) {
 		cp = devtoname(dev);
-		if (*cp == '#') {
+		if (*cp == '#' && (dev_dflags(dev) & D_NAGGED) == 0) {
 			printf("WARNING: driver %s should register devices with make_dev() (dev_t = \"%s\")\n",
 			    dev_dname(dev), cp);
+			dev->si_ops->head.flags |= D_NAGGED;
 		}
 	}
 
--- spec_vnops.c.patch ends here ---

--- syscons.c.patch begins here ---
--- sys/dev/misc/syscons/syscons.c.orig	2006-07-28 04:17:36.000000000 +0200
+++ sys/dev/misc/syscons/syscons.c	2006-08-30 14:02:41.000000000 +0200
@@ -197,7 +197,7 @@
 static	d_mmap_t	scmmap;
 
 static struct dev_ops sc_ops = {
-	{ "sc", CDEV_MAJOR, D_TTY | D_KQFILTER },
+	{ "sc", CDEV_MAJOR, D_TTY | D_KQFILTER | D_NAGGED },
 	.d_open =	scopen,
 	.d_close =	scclose,
 	.d_read =	scread,
--- syscons.c.patch ends here ---





More information about the Bugs mailing list