summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_conf.c
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2008-09-27 13:19:09 +0000
committered <ed@FreeBSD.org>2008-09-27 13:19:09 +0000
commite40b7c4704d4a5e06ba0817ecdfe988d66a4a82f (patch)
tree714c7bebb6d44f95fa4d5348b9b9b117eb17c331 /sys/kern/kern_conf.c
parentcf8fa20f595b028abc92fec21ad969a33dcd03fa (diff)
downloadFreeBSD-src-e40b7c4704d4a5e06ba0817ecdfe988d66a4a82f.zip
FreeBSD-src-e40b7c4704d4a5e06ba0817ecdfe988d66a4a82f.tar.gz
Move uminor() and umajor() to the same place as userspace minor() and major().
The uminor() and umajor() functions have the same use in kernel space as the minor() and major() functions in userspace. If we ever get rid of the minor() function in kernel space, we could decide to just expose minor() and major() to kernel space, making uminor() and umajor() redundant. There are two reasons why we want to have uminor() and umajor() in <sys/types.h>: - Having them close together prevents them from diverting. Even though it's unlikely the definitions will change, it's a good habit to have them at the same place. - They don't really belong in kern_conf.c. kern_conf.c has been liberated from dealing with device major and minor number handling. The device_ids(9) manpage now lists the wrong #include's, because it should only list <sys/types.h> now. I'm leaving it as it is now, because I wonder if we should document them anyway. We're probably better off documenting minor(3) and major(3).
Diffstat (limited to 'sys/kern/kern_conf.c')
-rw-r--r--sys/kern/kern_conf.c14
1 files changed, 0 insertions, 14 deletions
diff --git a/sys/kern/kern_conf.c b/sys/kern/kern_conf.c
index 98bae88..c77a834 100644
--- a/sys/kern/kern_conf.c
+++ b/sys/kern/kern_conf.c
@@ -545,20 +545,6 @@ newdev(struct cdevsw *csw, int y, struct cdev *si)
return (si);
}
-#define UMINORMASK 0xffff00ffU
-
-int
-uminor(dev_t dev)
-{
- return (dev & UMINORMASK);
-}
-
-int
-umajor(dev_t dev)
-{
- return ((dev & ~UMINORMASK) >> 8);
-}
-
static void
fini_cdevsw(struct cdevsw *devsw)
{
OpenPOWER on IntegriCloud