summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorJasper Lievisse Adriaanse <jasper@cvs.openbsd.org>2011-01-14 19:04:09 +0000
committerJasper Lievisse Adriaanse <jasper@cvs.openbsd.org>2011-01-14 19:04:09 +0000
commit67b5f16578df3dafbe03bbc9f064e0b9439d769a (patch)
tree0be58f007aadcbfda18babd655ad8c0087eb272d /sys/arch
parentaf6c3c3e1e2dadf084cbd6db0e1817a960fce7a9 (diff)
- use nitems()
"doesn't hurt" deraadt@
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/alpha/alpha/conf.c8
-rw-r--r--sys/arch/amd64/amd64/conf.c8
-rw-r--r--sys/arch/arm/arm/conf.c8
-rw-r--r--sys/arch/aviion/aviion/conf.c8
-rw-r--r--sys/arch/hp300/hp300/conf.c8
-rw-r--r--sys/arch/hppa/hppa/conf.c8
-rw-r--r--sys/arch/hppa64/hppa64/conf.c8
-rw-r--r--sys/arch/i386/i386/conf.c8
-rw-r--r--sys/arch/landisk/landisk/conf.c8
-rw-r--r--sys/arch/loongson/loongson/conf.c8
-rw-r--r--sys/arch/luna88k/luna88k/conf.c8
-rw-r--r--sys/arch/mac68k/mac68k/conf.c8
-rw-r--r--sys/arch/macppc/macppc/conf.c8
-rw-r--r--sys/arch/mvme68k/mvme68k/conf.c8
-rw-r--r--sys/arch/mvme88k/mvme88k/conf.c8
-rw-r--r--sys/arch/mvmeppc/mvmeppc/conf.c8
-rw-r--r--sys/arch/octeon/octeon/conf.c8
-rw-r--r--sys/arch/sgi/sgi/conf.c8
-rw-r--r--sys/arch/socppc/socppc/conf.c8
-rw-r--r--sys/arch/sparc/sparc/conf.c8
-rw-r--r--sys/arch/sparc64/sparc64/conf.c8
-rw-r--r--sys/arch/vax/vax/conf.c8
22 files changed, 88 insertions, 88 deletions
diff --git a/sys/arch/alpha/alpha/conf.c b/sys/arch/alpha/alpha/conf.c
index 2463e994747..9c3d11cb594 100644
--- a/sys/arch/alpha/alpha/conf.c
+++ b/sys/arch/alpha/alpha/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.65 2010/11/19 20:55:48 miod Exp $ */
+/* $OpenBSD: conf.c,v 1.66 2011/01/14 19:04:08 jasper Exp $ */
/* $NetBSD: conf.c,v 1.16 1996/10/18 21:26:57 cgd Exp $ */
/*-
@@ -77,7 +77,7 @@ struct bdevsw bdevsw[] =
bdev_lkm_dummy(), /* 15 */
bdev_disk_init(NRAID,raid), /* 16 */
};
-int nblkdev = sizeof (bdevsw) / sizeof (bdevsw[0]);
+int nblkdev = nitems(bdevsw);
#define mmread mmrw
#define mmwrite mmrw
@@ -217,7 +217,7 @@ struct cdevsw cdevsw[] =
cdev_urio_init(NURIO,urio), /* 65: USB Diamond Rio 500 */
cdev_usbdev_init(NUSCANNER,uscanner), /* 66: USB scanners */
};
-int nchrdev = sizeof (cdevsw) / sizeof (cdevsw[0]);
+int nchrdev = nitems(cdevsw);
int mem_no = 2; /* major device number of memory special file */
@@ -316,4 +316,4 @@ int chrtoblktbl[] = {
/* 50 */ NODEV,
/* 51 */ NODEV,
};
-int nchrtoblktbl = sizeof(chrtoblktbl) / sizeof(chrtoblktbl[0]);
+int nchrtoblktbl = nitems(chrtoblktbl);
diff --git a/sys/arch/amd64/amd64/conf.c b/sys/arch/amd64/amd64/conf.c
index dd0eb44b8cf..fee3c298bff 100644
--- a/sys/arch/amd64/amd64/conf.c
+++ b/sys/arch/amd64/amd64/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.31 2010/11/22 21:10:42 miod Exp $ */
+/* $OpenBSD: conf.c,v 1.32 2011/01/14 19:04:08 jasper Exp $ */
/*
* Copyright (c) 1994, 1995 Charles M. Hannum. All rights reserved.
@@ -81,7 +81,7 @@ struct bdevsw bdevsw[] =
bdev_lkm_dummy(), /* 18 */
bdev_disk_init(NRAID,raid), /* 19: RAIDframe disk driver */
};
-int nblkdev = sizeof(bdevsw) / sizeof(bdevsw[0]);
+int nblkdev = nitems(bdevsw);
/* open, close, read, write, ioctl, tty, mmap */
#define cdev_pc_init(c,n) { \
@@ -307,7 +307,7 @@ struct cdevsw cdevsw[] =
cdev_disk_init(1,diskmap), /* 90: disk mapper */
cdev_pppx_init(NPPPX,pppx), /* 91: pppx */
};
-int nchrdev = sizeof(cdevsw) / sizeof(cdevsw[0]);
+int nchrdev = nitems(cdevsw);
int mem_no = 2; /* major device number of memory special file */
@@ -408,7 +408,7 @@ int chrtoblktbl[] = {
/* 54 */ 19, /* raid */
};
-int nchrtoblktbl = sizeof(chrtoblktbl) / sizeof(chrtoblktbl[0]);
+int nchrtoblktbl = nitems(chrtoblktbl);
/*
* In order to map BSD bdev numbers of disks to their BIOS equivalents
diff --git a/sys/arch/arm/arm/conf.c b/sys/arch/arm/arm/conf.c
index 9ce99a28dc9..e79027eb310 100644
--- a/sys/arch/arm/arm/conf.c
+++ b/sys/arch/arm/arm/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.28 2010/11/28 20:48:44 miod Exp $ */
+/* $OpenBSD: conf.c,v 1.29 2011/01/14 19:04:08 jasper Exp $ */
/* $NetBSD: conf.c,v 1.10 2002/04/19 01:04:38 wiz Exp $ */
/*
@@ -402,8 +402,8 @@ struct cdevsw cdevsw[] = {
cdev_pppx_init(NPPPX,pppx), /* 103: pppx */
};
-int nblkdev = sizeof(bdevsw) / sizeof(bdevsw[0]);
-int nchrdev = sizeof(cdevsw) / sizeof(cdevsw[0]);
+int nblkdev = nitems(bdevsw);
+int nchrdev = nitems(cdevsw);
int mem_no = 2; /* major device number of memory special file */
@@ -515,7 +515,7 @@ int chrtoblktbl[] = {
/* 70 */ NODEV,
/* 71 */ 71, /* raid */
};
-int nchrtoblktbl = sizeof(chrtoblktbl) / sizeof(chrtoblktbl[0]);
+int nchrtoblktbl = nitems(chrtoblktbl);
dev_t
getnulldev()
diff --git a/sys/arch/aviion/aviion/conf.c b/sys/arch/aviion/aviion/conf.c
index c41437e7630..170afc4c748 100644
--- a/sys/arch/aviion/aviion/conf.c
+++ b/sys/arch/aviion/aviion/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.13 2010/11/22 21:10:45 miod Exp $ */
+/* $OpenBSD: conf.c,v 1.14 2011/01/14 19:04:08 jasper Exp $ */
/*-
* Copyright (c) 1991 The Regents of the University of California.
@@ -87,7 +87,7 @@ struct bdevsw bdevsw[] =
bdev_lkm_dummy(), /* 17 */
bdev_lkm_dummy(), /* 18 */
};
-int nblkdev = sizeof(bdevsw) / sizeof(bdevsw[0]);
+int nblkdev = nitems(bdevsw);
struct cdevsw cdevsw[] =
{
@@ -152,7 +152,7 @@ struct cdevsw cdevsw[] =
cdev_disk_init(1,diskmap), /* 54: disk mapper */
cdev_pppx_init(NPPPX,pppx), /* 55: pppx */
};
-int nchrdev = sizeof(cdevsw) / sizeof(cdevsw[0]);
+int nchrdev = nitems(cdevsw);
int mem_no = 2; /* major device number of memory special file */
@@ -220,7 +220,7 @@ int chrtoblktbl[] = {
/* 19 */ 8, /* vnd */
/* 20 */ 5, /* st */
};
-int nchrtoblktbl = sizeof(chrtoblktbl) / sizeof(chrtoblktbl[0]);
+int nchrtoblktbl = nitems(chrtoblktbl);
#include <dev/cons.h>
diff --git a/sys/arch/hp300/hp300/conf.c b/sys/arch/hp300/hp300/conf.c
index 3a198fe1106..c9e4911c160 100644
--- a/sys/arch/hp300/hp300/conf.c
+++ b/sys/arch/hp300/hp300/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.50 2010/11/19 20:55:48 miod Exp $ */
+/* $OpenBSD: conf.c,v 1.51 2011/01/14 19:04:08 jasper Exp $ */
/* $NetBSD: conf.c,v 1.39 1997/05/12 08:17:53 thorpej Exp $ */
/*-
@@ -74,7 +74,7 @@ struct bdevsw bdevsw[] =
bdev_lkm_dummy(), /* 14 */
bdev_lkm_dummy(), /* 15 */
};
-int nblkdev = sizeof(bdevsw) / sizeof(bdevsw[0]);
+int nblkdev = nitems(bdevsw);
/* open, close, read, write, ioctl -- XXX should be a generic device */
#define cdev_ppi_init(c,n) { \
@@ -180,7 +180,7 @@ struct cdevsw cdevsw[] =
cdev_pppx_init(NPPPX,pppx), /* 55: pppx */
cdev_hotplug_init(NHOTPLUG,hotplug), /* 56: devices hot plugging */
};
-int nchrdev = sizeof(cdevsw) / sizeof(cdevsw[0]);
+int nchrdev = nitems(cdevsw);
int mem_no = 2; /* major device number of memory special file */
@@ -262,7 +262,7 @@ int chrtoblktbl[] = {
/* 33 */ NODEV,
/* 34 */ 8, /* rd */
};
-int nchrtoblktbl = sizeof(chrtoblktbl) / sizeof(chrtoblktbl[0]);
+int nchrtoblktbl = nitems(chrtoblktbl);
/*
* This entire table could be autoconfig()ed but that would mean that
diff --git a/sys/arch/hppa/hppa/conf.c b/sys/arch/hppa/hppa/conf.c
index 27679daf6d1..b45a1ef33c3 100644
--- a/sys/arch/hppa/hppa/conf.c
+++ b/sys/arch/hppa/hppa/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.52 2010/09/23 05:02:14 claudio Exp $ */
+/* $OpenBSD: conf.c,v 1.53 2011/01/14 19:04:08 jasper Exp $ */
/*-
* Copyright (c) 1991 The Regents of the University of California.
@@ -77,7 +77,7 @@ struct bdevsw bdevsw[] =
bdev_lkm_dummy(), /* 13: */
bdev_lkm_dummy(), /* 14: */
};
-int nblkdev = sizeof(bdevsw) / sizeof(bdevsw[0]);
+int nblkdev = nitems(bdevsw);
#include "audio.h"
#include "video.h"
@@ -196,7 +196,7 @@ struct cdevsw cdevsw[] =
cdev_disk_init(1,diskmap), /* 56: disk mapper */
cdev_pppx_init(NPPPX,pppx), /* 57: pppx */
};
-int nchrdev = sizeof(cdevsw) / sizeof(cdevsw[0]);
+int nchrdev = nitems(cdevsw);
int mem_no = 2; /* major device number of memory special file */
@@ -255,7 +255,7 @@ int chrtoblktbl[] = {
/* 38 */ NODEV,
/* 39 */ 8, /* wd */
};
-int nchrtoblktbl = sizeof(chrtoblktbl) / sizeof(chrtoblktbl[0]);
+int nchrtoblktbl = nitems(chrtoblktbl);
/*
* Returns true if dev is /dev/zero.
diff --git a/sys/arch/hppa64/hppa64/conf.c b/sys/arch/hppa64/hppa64/conf.c
index 995715976df..b721e78ff6d 100644
--- a/sys/arch/hppa64/hppa64/conf.c
+++ b/sys/arch/hppa64/hppa64/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.17 2010/11/19 20:55:48 miod Exp $ */
+/* $OpenBSD: conf.c,v 1.18 2011/01/14 19:04:08 jasper Exp $ */
/*-
* Copyright (c) 1991 The Regents of the University of California.
@@ -78,7 +78,7 @@ struct bdevsw bdevsw[] =
bdev_lkm_dummy(),
bdev_lkm_dummy(),
};
-int nblkdev = sizeof(bdevsw) / sizeof(bdevsw[0]);
+int nblkdev = nitems(bdevsw);
#include "audio.h"
#include "video.h"
@@ -198,7 +198,7 @@ struct cdevsw cdevsw[] =
cdev_disk_init(1,diskmap), /* 56: disk mapper */
cdev_pppx_init(NPPPX,pppx), /* 57: pppx */
};
-int nchrdev = sizeof(cdevsw) / sizeof(cdevsw[0]);
+int nchrdev = nitems(cdevsw);
int mem_no = 2; /* major device number of memory special file */
@@ -257,7 +257,7 @@ int chrtoblktbl[] = {
/* 38 */ NODEV,
/* 39 */ 8, /* wd */
};
-int nchrtoblktbl = sizeof(chrtoblktbl) / sizeof(chrtoblktbl[0]);
+int nchrtoblktbl = nitems(chrtoblktbl);
/*
* Returns true if dev is /dev/zero.
diff --git a/sys/arch/i386/i386/conf.c b/sys/arch/i386/i386/conf.c
index 3133a7b106b..1e85bd7d269 100644
--- a/sys/arch/i386/i386/conf.c
+++ b/sys/arch/i386/i386/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.135 2010/09/22 13:03:47 claudio Exp $ */
+/* $OpenBSD: conf.c,v 1.136 2011/01/14 19:04:08 jasper Exp $ */
/* $NetBSD: conf.c,v 1.75 1996/05/03 19:40:20 christos Exp $ */
/*
@@ -82,7 +82,7 @@ struct bdevsw bdevsw[] =
bdev_notdef(), /* 18 */
bdev_disk_init(NRAID,raid), /* 19: RAIDframe disk driver */
};
-int nblkdev = sizeof(bdevsw) / sizeof(bdevsw[0]);
+int nblkdev = nitems(bdevsw);
/* open, close, read, write, ioctl, tty, mmap */
#define cdev_pc_init(c,n) { \
@@ -311,7 +311,7 @@ struct cdevsw cdevsw[] =
cdev_disk_init(1,diskmap), /* 91: disk mapper */
cdev_pppx_init(NPPPX,pppx), /* 92: pppx */
};
-int nchrdev = sizeof(cdevsw) / sizeof(cdevsw[0]);
+int nchrdev = nitems(cdevsw);
int mem_no = 2; /* major device number of memory special file */
@@ -409,7 +409,7 @@ int chrtoblktbl[] = {
/* 53 */ NODEV,
/* 54 */ 19, /* raid */
};
-int nchrtoblktbl = sizeof(chrtoblktbl) / sizeof(chrtoblktbl[0]);
+int nchrtoblktbl = nitems(chrtoblktbl);
/*
* In order to map BSD bdev numbers of disks to their BIOS equivalents
diff --git a/sys/arch/landisk/landisk/conf.c b/sys/arch/landisk/landisk/conf.c
index f6dc1139745..31e25c09648 100644
--- a/sys/arch/landisk/landisk/conf.c
+++ b/sys/arch/landisk/landisk/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.18 2010/11/19 20:55:48 miod Exp $ */
+/* $OpenBSD: conf.c,v 1.19 2011/01/14 19:04:08 jasper Exp $ */
/*
* Copyright (c) 1994-1998 Mark Brinicombe.
@@ -377,8 +377,8 @@ struct cdevsw cdevsw[] = {
cdev_pppx_init(NPPPX,pppx), /* 102: pppx */
};
-int nblkdev = sizeof(bdevsw) / sizeof(bdevsw[0]);
-int nchrdev = sizeof(cdevsw) / sizeof(cdevsw[0]);
+int nblkdev = nitems(bdevsw);
+int nchrdev = nitems(cdevsw);
int mem_no = 2; /* major device number of memory special file */
@@ -490,7 +490,7 @@ int chrtoblktbl[] = {
/* 70 */ NODEV,
/* 71 */ 71, /* raid */
};
-int nchrtoblktbl = sizeof(chrtoblktbl) / sizeof(chrtoblktbl[0]);
+int nchrtoblktbl = nitems(chrtoblktbl);
dev_t
diff --git a/sys/arch/loongson/loongson/conf.c b/sys/arch/loongson/loongson/conf.c
index a32a9212d6d..4d2feded3ea 100644
--- a/sys/arch/loongson/loongson/conf.c
+++ b/sys/arch/loongson/loongson/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.11 2010/11/22 21:10:45 miod Exp $ */
+/* $OpenBSD: conf.c,v 1.12 2011/01/14 19:04:08 jasper Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -80,7 +80,7 @@ struct bdevsw bdevsw[] =
bdev_notdef(), /* 15: */
};
-int nblkdev = sizeof (bdevsw) / sizeof (bdevsw[0]);
+int nblkdev = nitems(bdevsw);
/*
* Character devices.
@@ -221,7 +221,7 @@ struct cdevsw cdevsw[] =
cdev_usbdev_init(NUSCANNER,uscanner), /* 72: USB scanners */
};
-int nchrdev = sizeof (cdevsw) / sizeof (cdevsw[0]);
+int nchrdev = nitems(cdevsw);
/*
* Swapdev is a fake device implemented
@@ -294,7 +294,7 @@ int chrtoblktbl[] = {
/* 23 */ 6 /* ccd */
};
-int nchrtoblktbl = sizeof(chrtoblktbl) / sizeof(int);
+int nchrtoblktbl = nitems(chrtoblktbl);
#include <dev/cons.h>
diff --git a/sys/arch/luna88k/luna88k/conf.c b/sys/arch/luna88k/luna88k/conf.c
index e87f76779f4..538a2a16ea2 100644
--- a/sys/arch/luna88k/luna88k/conf.c
+++ b/sys/arch/luna88k/luna88k/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.15 2010/09/23 05:02:14 claudio Exp $ */
+/* $OpenBSD: conf.c,v 1.16 2011/01/14 19:04:08 jasper Exp $ */
/*-
* Copyright (c) 1991 The Regents of the University of California.
@@ -94,7 +94,7 @@ struct bdevsw bdevsw[] =
bdev_lkm_dummy(), /* 17 */
bdev_lkm_dummy(), /* 18 */
};
-int nblkdev = sizeof(bdevsw) / sizeof(bdevsw[0]);
+int nblkdev = nitems(bdevsw);
struct cdevsw cdevsw[] =
{
@@ -161,7 +161,7 @@ struct cdevsw cdevsw[] =
cdev_disk_init(1,diskmap), /* 54: disk mapper */
cdev_pppx_init(NPPPX,pppx), /* 55: pppx */
};
-int nchrdev = sizeof(cdevsw) / sizeof(cdevsw[0]);
+int nchrdev = nitems(cdevsw);
int mem_no = 2; /* major device number of memory special file */
@@ -229,4 +229,4 @@ int chrtoblktbl[] = {
/* 19 */ 8, /* vnd */
/* 20 */ 5, /* st */
};
-int nchrtoblktbl = sizeof(chrtoblktbl) / sizeof(chrtoblktbl[0]);
+int nchrtoblktbl = nitems(chrtoblktbl);
diff --git a/sys/arch/mac68k/mac68k/conf.c b/sys/arch/mac68k/mac68k/conf.c
index df7dff3c876..7808b0b0ad6 100644
--- a/sys/arch/mac68k/mac68k/conf.c
+++ b/sys/arch/mac68k/mac68k/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.47 2010/09/23 05:02:14 claudio Exp $ */
+/* $OpenBSD: conf.c,v 1.48 2011/01/14 19:04:08 jasper Exp $ */
/* $NetBSD: conf.c,v 1.41 1997/02/11 07:35:49 scottr Exp $ */
/*
@@ -74,7 +74,7 @@ struct bdevsw bdevsw[] =
bdev_lkm_dummy(), /* 18 */
bdev_lkm_dummy(), /* 19 */
};
-int nblkdev = sizeof(bdevsw) / sizeof(bdevsw[0]);
+int nblkdev = nitems(bdevsw);
#define mmread mmrw
#define mmwrite mmrw
@@ -171,7 +171,7 @@ struct cdevsw cdevsw[] =
cdev_disk_init(1,diskmap), /* 54: disk mapper */
cdev_pppx_init(NPPPX,pppx), /* 55: pppx */
};
-int nchrdev = sizeof(cdevsw) / sizeof(cdevsw[0]);
+int nchrdev = nitems(cdevsw);
int mem_no = 2; /* major device number of memory special file */
@@ -239,7 +239,7 @@ int chrtoblktbl[] = {
/* 19 */ 8, /* vnd */
/* 20 */ 9, /* ccd */
};
-int nchrtoblktbl = sizeof(chrtoblktbl) / sizeof(chrtoblktbl[0]);
+int nchrtoblktbl = nitems(chrtoblktbl);
cons_decl(ws);
#define zscnpollc nullcnpollc
diff --git a/sys/arch/macppc/macppc/conf.c b/sys/arch/macppc/macppc/conf.c
index 39afc1770fd..1cd05415ceb 100644
--- a/sys/arch/macppc/macppc/conf.c
+++ b/sys/arch/macppc/macppc/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.43 2010/09/23 05:02:14 claudio Exp $ */
+/* $OpenBSD: conf.c,v 1.44 2011/01/14 19:04:08 jasper Exp $ */
/*
* Copyright (c) 1997 Per Fogelstrom
@@ -76,7 +76,7 @@ struct bdevsw bdevsw[] = {
bdev_notdef(), /* 18 unknown*/
bdev_disk_init(NRAID,raid), /* 19: RAIDframe disk driver */
};
-int nblkdev = sizeof bdevsw / sizeof bdevsw[0];
+int nblkdev = nitems(bdevsw);
#include "pty.h"
#include "zstty.h"
@@ -244,7 +244,7 @@ struct cdevsw cdevsw[] = {
cdev_disk_init(1,diskmap), /* 84: disk mapper */
cdev_pppx_init(NPPPX,pppx), /* 85: pppx */
};
-int nchrdev = sizeof cdevsw / sizeof cdevsw[0];
+int nchrdev = nitems(cdevsw);
int mem_no = 2; /* major number of /dev/mem */
@@ -336,7 +336,7 @@ int chrtoblktbl[] = {
/* 53 */ NODEV,
/* 54 */ 19, /* raid */
};
-int nchrtoblktbl = sizeof(chrtoblktbl) / sizeof(chrtoblktbl[0]);
+int nchrtoblktbl = nitems(chrtoblktbl);
#include <dev/cons.h>
#include "vgafb_pci.h"
diff --git a/sys/arch/mvme68k/mvme68k/conf.c b/sys/arch/mvme68k/mvme68k/conf.c
index f7039a478fb..c2e7b28d8f9 100644
--- a/sys/arch/mvme68k/mvme68k/conf.c
+++ b/sys/arch/mvme68k/mvme68k/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.51 2010/11/22 21:10:45 miod Exp $ */
+/* $OpenBSD: conf.c,v 1.52 2011/01/14 19:04:08 jasper Exp $ */
/*-
* Copyright (c) 1995 Theo de Raadt
@@ -102,7 +102,7 @@ struct bdevsw bdevsw[] =
bdev_lkm_dummy(), /* 17 */
bdev_lkm_dummy(), /* 18 */
};
-int nblkdev = sizeof(bdevsw) / sizeof(bdevsw[0]);
+int nblkdev = nitems(bdevsw);
#include "sram.h"
#include "vmel.h"
@@ -222,7 +222,7 @@ struct cdevsw cdevsw[] =
cdev_disk_init(1,diskmap), /* 54: disk mapper */
cdev_pppx_init(NPPPX,pppx), /* 55: pppx */
};
-int nchrdev = sizeof(cdevsw) / sizeof(cdevsw[0]);
+int nchrdev = nitems(cdevsw);
int mem_no = 2; /* major device number of memory special file */
@@ -296,7 +296,7 @@ int chrtoblktbl[] = {
/* 25 */ NODEV,
/* 26 */ 10, /* xd */
};
-int nchrtoblktbl = sizeof(chrtoblktbl) / sizeof(chrtoblktbl[0]);
+int nchrtoblktbl = nitems(chrtoblktbl);
#include <dev/cons.h>
diff --git a/sys/arch/mvme88k/mvme88k/conf.c b/sys/arch/mvme88k/mvme88k/conf.c
index b79b7b4551b..fa0ec26b86e 100644
--- a/sys/arch/mvme88k/mvme88k/conf.c
+++ b/sys/arch/mvme88k/mvme88k/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.43 2010/11/22 21:10:45 miod Exp $ */
+/* $OpenBSD: conf.c,v 1.44 2011/01/14 19:04:08 jasper Exp $ */
/*-
* Copyright (c) 1991 The Regents of the University of California.
@@ -129,7 +129,7 @@ struct bdevsw bdevsw[] =
bdev_lkm_dummy(), /* 17 */
bdev_lkm_dummy(), /* 18 */
};
-int nblkdev = sizeof(bdevsw) / sizeof(bdevsw[0]);
+int nblkdev = nitems(bdevsw);
struct cdevsw cdevsw[] =
{
@@ -207,7 +207,7 @@ struct cdevsw cdevsw[] =
cdev_disk_init(1,diskmap), /* 54: disk mapper */
cdev_pppx_init(NPPPX,pppx), /* 55: pppx */
};
-int nchrdev = sizeof(cdevsw) / sizeof(cdevsw[0]);
+int nchrdev = nitems(cdevsw);
int mem_no = 2; /* major device number of memory special file */
@@ -281,7 +281,7 @@ int chrtoblktbl[] = {
/* 25 */ NODEV,
/* 26 */ 10, /* xd */
};
-int nchrtoblktbl = sizeof(chrtoblktbl) / sizeof(chrtoblktbl[0]);
+int nchrtoblktbl = nitems(chrtoblktbl);
#include <dev/cons.h>
diff --git a/sys/arch/mvmeppc/mvmeppc/conf.c b/sys/arch/mvmeppc/mvmeppc/conf.c
index b61d4a7e503..d5cf1369a41 100644
--- a/sys/arch/mvmeppc/mvmeppc/conf.c
+++ b/sys/arch/mvmeppc/mvmeppc/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.29 2010/09/23 05:02:14 claudio Exp $ */
+/* $OpenBSD: conf.c,v 1.30 2011/01/14 19:04:08 jasper Exp $ */
/*
* Copyright (c) 1997 Per Fogelstrom
@@ -78,7 +78,7 @@ struct bdevsw bdevsw[] = {
bdev_notdef(), /* 18 unknown*/
bdev_disk_init(NRAID,raid), /* 19: RAIDframe disk driver */
};
-int nblkdev = sizeof bdevsw / sizeof bdevsw[0];
+int nblkdev = nitems(bdevsw);
#include "bio.h"
#include "pty.h"
@@ -184,7 +184,7 @@ struct cdevsw cdevsw[] = {
cdev_disk_init(1,diskmap), /* 57: disk mapper */
cdev_pppx_init(NPPPX,pppx), /* 58: pppx */
};
-int nchrdev = sizeof cdevsw / sizeof cdevsw[0];
+int nchrdev = nitems(cdevsw);
int mem_no = 2; /* major number of /dev/mem */
@@ -278,7 +278,7 @@ int chrtoblktbl[] = {
/* 53 */ NODEV,
/* 54 */ 19, /* raid */
};
-int nchrtoblktbl = sizeof(chrtoblktbl) / sizeof(chrtoblktbl[0]);
+int nchrtoblktbl = nitems(chrtoblktbl);
#include <dev/cons.h>
diff --git a/sys/arch/octeon/octeon/conf.c b/sys/arch/octeon/octeon/conf.c
index df20c6d8d27..892ed1f1795 100644
--- a/sys/arch/octeon/octeon/conf.c
+++ b/sys/arch/octeon/octeon/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.5 2010/11/22 21:10:45 miod Exp $ */
+/* $OpenBSD: conf.c,v 1.6 2011/01/14 19:04:08 jasper Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -83,7 +83,7 @@ struct bdevsw bdevsw[] =
bdev_disk_init(NOCTCF,octcf), /* 15: CF disk */
};
-int nblkdev = sizeof (bdevsw) / sizeof (bdevsw[0]);
+int nblkdev = nitems(bdevsw);
/*
* Character devices.
@@ -232,7 +232,7 @@ struct cdevsw cdevsw[] =
cdev_usbdev_init(NUSCANNER,uscanner), /* 72: USB scanners */
};
-int nchrdev = sizeof (cdevsw) / sizeof (cdevsw[0]);
+int nchrdev = nitems(cdevsw);
/*
* Swapdev is a fake device implemented
@@ -305,7 +305,7 @@ int chrtoblktbl[] = {
/* 23 */ 6 /* ccd */
};
-int nchrtoblktbl = sizeof(chrtoblktbl) / sizeof(int);
+int nchrtoblktbl = nitems(chrtoblktbl);
#include <dev/cons.h>
diff --git a/sys/arch/sgi/sgi/conf.c b/sys/arch/sgi/sgi/conf.c
index 8b0a81ded71..424ed569bb8 100644
--- a/sys/arch/sgi/sgi/conf.c
+++ b/sys/arch/sgi/sgi/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.27 2010/11/22 21:10:45 miod Exp $ */
+/* $OpenBSD: conf.c,v 1.28 2011/01/14 19:04:08 jasper Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -80,7 +80,7 @@ struct bdevsw bdevsw[] =
bdev_notdef(), /* 15: */
};
-int nblkdev = sizeof (bdevsw) / sizeof (bdevsw[0]);
+int nblkdev = nitems(bdevsw);
/*
* Character devices.
@@ -219,7 +219,7 @@ struct cdevsw cdevsw[] =
cdev_usbdev_init(NUSCANNER,uscanner), /* 72: USB scanners */
};
-int nchrdev = sizeof (cdevsw) / sizeof (cdevsw[0]);
+int nchrdev = nitems(cdevsw);
/*
* Swapdev is a fake device implemented
@@ -292,7 +292,7 @@ int chrtoblktbl[] = {
/* 23 */ 6 /* ccd */
};
-int nchrtoblktbl = sizeof(chrtoblktbl) / sizeof(int);
+int nchrtoblktbl = nitems(chrtoblktbl);
#include <dev/cons.h>
diff --git a/sys/arch/socppc/socppc/conf.c b/sys/arch/socppc/socppc/conf.c
index 67698461197..28ea9253c98 100644
--- a/sys/arch/socppc/socppc/conf.c
+++ b/sys/arch/socppc/socppc/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.13 2011/01/12 22:16:19 kettenis Exp $ */
+/* $OpenBSD: conf.c,v 1.14 2011/01/14 19:04:08 jasper Exp $ */
/*
* Copyright (c) 1997 Per Fogelstrom
@@ -74,7 +74,7 @@ struct bdevsw bdevsw[] = {
bdev_notdef(), /* 18 unknown*/
bdev_disk_init(NRAID,raid), /* 19 RAIDframe disk driver */
};
-int nblkdev = sizeof bdevsw / sizeof bdevsw[0];
+int nblkdev = nitems(bdevsw);
#include "pty.h"
@@ -215,7 +215,7 @@ struct cdevsw cdevsw[] = {
cdev_pppx_init(NPPPX,pppx), /* 83: pppx */
cdev_hotplug_init(NHOTPLUG,hotplug), /* 84: devices hot plugging */
};
-int nchrdev = sizeof cdevsw / sizeof cdevsw[0];
+int nchrdev = nitems(cdevsw);
int mem_no = 2; /* major number of /dev/mem */
@@ -307,7 +307,7 @@ int chrtoblktbl[] = {
/* 53 */ NODEV,
/* 54 */ 19, /* raid */
};
-int nchrtoblktbl = sizeof(chrtoblktbl) / sizeof(chrtoblktbl[0]);
+int nchrtoblktbl = nitems(chrtoblktbl);
#include <dev/cons.h>
diff --git a/sys/arch/sparc/sparc/conf.c b/sys/arch/sparc/sparc/conf.c
index cf7bced3f9f..1a7c8ca4885 100644
--- a/sys/arch/sparc/sparc/conf.c
+++ b/sys/arch/sparc/sparc/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.55 2010/11/19 20:55:48 miod Exp $ */
+/* $OpenBSD: conf.c,v 1.56 2011/01/14 19:04:08 jasper Exp $ */
/* $NetBSD: conf.c,v 1.40 1996/04/11 19:20:03 thorpej Exp $ */
/*
@@ -122,7 +122,7 @@ struct bdevsw bdevsw[] =
bdev_disk_init(NRAID,raid), /* 25: RAIDframe disk driver */
bdev_disk_init(NPRESTO,presto), /* 26: Prestoserve NVRAM */
};
-int nblkdev = sizeof(bdevsw) / sizeof(bdevsw[0]);
+int nblkdev = nitems(bdevsw);
#include "pf.h"
#include "systrace.h"
@@ -273,7 +273,7 @@ struct cdevsw cdevsw[] =
cdev_pppx_init(NPPPX,pppx), /* 130: pppx */
cdev_hotplug_init(NHOTPLUG,hotplug), /* 131: devices hot plugging */
};
-int nchrdev = sizeof(cdevsw) / sizeof(cdevsw[0]);
+int nchrdev = nitems(cdevsw);
int mem_no = 3; /* major device number of memory special file */
@@ -442,4 +442,4 @@ int chrtoblktbl[] = {
/*122 */ NODEV,
/*123 */ 25,
};
-int nchrtoblktbl = sizeof(chrtoblktbl) / sizeof(chrtoblktbl[0]);
+int nchrtoblktbl = nitems(chrtoblktbl);
diff --git a/sys/arch/sparc64/sparc64/conf.c b/sys/arch/sparc64/sparc64/conf.c
index df679dfa618..e0c9bc52868 100644
--- a/sys/arch/sparc64/sparc64/conf.c
+++ b/sys/arch/sparc64/sparc64/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.58 2010/10/08 18:21:34 ratchov Exp $ */
+/* $OpenBSD: conf.c,v 1.59 2011/01/14 19:04:08 jasper Exp $ */
/* $NetBSD: conf.c,v 1.17 2001/03/26 12:33:26 lukem Exp $ */
/*
@@ -152,7 +152,7 @@ struct bdevsw bdevsw[] =
bdev_lkm_dummy(), /* 24 */
bdev_disk_init(NRAID,raid), /* 25: RAIDframe disk driver */
};
-int nblkdev = sizeof(bdevsw) / sizeof(bdevsw[0]);
+int nblkdev = nitems(bdevsw);
struct cdevsw cdevsw[] =
{
@@ -298,7 +298,7 @@ struct cdevsw cdevsw[] =
cdev_disk_init(1,diskmap), /* 130: disk mapper */
cdev_pppx_init(NPPPX,pppx), /* 131: pppx */
};
-int nchrdev = sizeof(cdevsw) / sizeof(cdevsw[0]);
+int nchrdev = nitems(cdevsw);
int mem_no = 3; /* major device number of memory special file */
@@ -466,4 +466,4 @@ int chrtoblktbl[] = {
/*121 */ 25,
/*122 */ NODEV,
};
-int nchrtoblktbl = sizeof(chrtoblktbl) / sizeof(chrtoblktbl[0]);
+int nchrtoblktbl = nitems(chrtoblktbl);
diff --git a/sys/arch/vax/vax/conf.c b/sys/arch/vax/vax/conf.c
index b0f359b6258..b59e49dd43b 100644
--- a/sys/arch/vax/vax/conf.c
+++ b/sys/arch/vax/vax/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.61 2010/09/23 05:02:14 claudio Exp $ */
+/* $OpenBSD: conf.c,v 1.62 2011/01/14 19:04:08 jasper Exp $ */
/* $NetBSD: conf.c,v 1.44 1999/10/27 16:38:54 ragge Exp $ */
/*-
@@ -135,7 +135,7 @@ struct bdevsw bdevsw[] =
bdev_disk_init(NRY,ry), /* 24: VS3100 floppy */
bdev_disk_init(NRAID,raid), /* 25: RAIDframe disk driver */
};
-int nblkdev = sizeof(bdevsw) / sizeof(bdevsw[0]);
+int nblkdev = nitems(bdevsw);
/*
* Console routines for VAX console.
@@ -443,7 +443,7 @@ struct cdevsw cdevsw[] =
cdev_disk_init(1,diskmap), /* 79: disk mapper */
cdev_pppx_init(NPPPX,pppx), /* 80: pppx */
};
-int nchrdev = sizeof(cdevsw) / sizeof(cdevsw[0]);
+int nchrdev = nitems(cdevsw);
int mem_no = 3; /* major device number of memory special file */
@@ -535,7 +535,7 @@ int chrtoblktbl[] = {
25, /* 73 */
NODEV, /* 74 */
};
-int nchrtoblktbl = sizeof(chrtoblktbl) / sizeof(chrtoblktbl[0]);
+int nchrtoblktbl = nitems(chrtoblktbl);
/*
* Returns true if dev is /dev/mem or /dev/kmem.