]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/dev/i386/conf.c
xnu-7195.101.1.tar.gz
[apple/xnu.git] / bsd / dev / i386 / conf.c
index 094506014f089a343547abfbe52c241d1b3c8ba3..b2ad22676d028ae2b94a86b580853c5defc3f5d0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997-2017 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 1997-2020 Apple Inc. All rights reserved.
  *
  * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
  *
@@ -238,12 +238,7 @@ struct cdevsw cdevsw[] = {
                kmioctl, nullstop, nullreset, km_tty, ttselect,
                eno_mmap, eno_strat, eno_getc, eno_putc, 0
        },
-       [13 ... 41] = NO_CDEVICE,
-       [42] = {
-               volopen, volclose, eno_rdwrt, eno_rdwrt,
-               volioctl, eno_stop, eno_reset, 0, (select_fcn_t *) seltrue,
-               eno_mmap, eno_strat, eno_getc, eno_putc, 0
-       }
+       [13 ... 63] = NO_CDEVICE,
 };
 const int nchrdev = sizeof(cdevsw) / sizeof(cdevsw[0]);
 
@@ -260,11 +255,11 @@ isdisk(dev_t dev, int type)
 
        switch (type) {
        case VCHR:
-               maj = chrtoblk(maj);
+               maj = chrtoblk(dev);
                if (maj == NODEV) {
                        break;
                }
-       /* FALL THROUGH */
+               OS_FALLTHROUGH;
        case VBLK:
                if (bdevsw[maj].d_type == D_DISK) {
                        return 1;
@@ -274,32 +269,7 @@ isdisk(dev_t dev, int type)
        return 0;
 }
 
-static int chrtoblktab[] = {
-       /* CHR*/        /* BLK*/        /* CHR*/        /* BLK*/
-       /*  0 */ NODEV, /*  1 */ NODEV,
-       /*  2 */ NODEV, /*  3 */ NODEV,
-       /*  4 */ NODEV, /*  5 */ NODEV,
-       /*  6 */ NODEV, /*  7 */ NODEV,
-       /*  8 */ NODEV, /*  9 */ NODEV,
-       /* 10 */ NODEV, /* 11 */ NODEV,
-       /* 12 */ NODEV, /* 13 */ NODEV,
-       /* 14 */ NODEV, /* 15 */ NODEV,
-       /* 16 */ NODEV, /* 17 */ NODEV,
-       /* 18 */ NODEV, /* 19 */ NODEV,
-       /* 20 */ NODEV, /* 21 */ NODEV,
-       /* 22 */ NODEV, /* 23 */ NODEV,
-       /* 24 */ NODEV, /* 25 */ NODEV,
-       /* 26 */ NODEV, /* 27 */ NODEV,
-       /* 28 */ NODEV, /* 29 */ NODEV,
-       /* 30 */ NODEV, /* 31 */ NODEV,
-       /* 32 */ NODEV, /* 33 */ NODEV,
-       /* 34 */ NODEV, /* 35 */ NODEV,
-       /* 36 */ NODEV, /* 37 */ NODEV,
-       /* 38 */ NODEV, /* 39 */ NODEV,
-       /* 40 */ NODEV, /* 41 */ NODEV,
-       /* 42 */ NODEV, /* 43 */ NODEV,
-       /* 44 */ NODEV,
-};
+static int chrtoblktab[] = {[0 ... nchrdev] = NODEV };
 
 /*
  * convert chr dev to blk dev