Fix nagging make_dev() warnings

Simon 'corecode' Schubert corecode at fs.ei.tum.de
Thu Sep 7 04:20:44 PDT 2006


Frank W. Josellis wrote:
--- 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;
 		}
 	}
i'm not sure if dev->si_ops->head.flags is the right place to add D_NAGGED, but something like this seems to be the right thing.

--- 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,
this is the wrong fix, for sure.  the nagging has a reason, actually, so the cause should be fixed, not just the nagging.

cheers
 simon
--
Serve - BSD     +++  RENT this banner advert  +++    ASCII Ribbon   /"\
Work - Mac      +++  space for low €€€ NOW!1  +++      Campaign     \ /
Party Enjoy Relax   |   http://dragonflybsd.org      Against  HTML   \
Dude 2c 2 the max   !   http://golden-apple.biz       Mail + News   / \
Attachment:
signature.asc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pgp00001.pgp
Type: application/octet-stream
Size: 252 bytes
Desc: "Description: OpenPGP digital signature"
URL: <http://lists.dragonflybsd.org/pipermail/bugs/attachments/20060907/8922cf03/attachment-0015.obj>


More information about the Bugs mailing list