DragonFly BSD
DragonFly bugs List (threaded) for 2006-09
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: Fix nagging make_dev() warnings


From: "Simon 'corecode' Schubert" <corecode@xxxxxxxxxxxx>
Date: Thu, 07 Sep 2006 13:19:03 +0200

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
Description: OpenPGP digital signature



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