summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2003-03-02 19:17:51 +0000
committerphk <phk@FreeBSD.org>2003-03-02 19:17:51 +0000
commitff24404b376ee802a4160e1f4edaa37d405149af (patch)
treeab43d6468b40059aeff1dab09cf4c0fca8b34f08 /sys/dev
parentd44666a5de064bf57125ef6e8be55f0a2838bbae (diff)
downloadFreeBSD-src-ff24404b376ee802a4160e1f4edaa37d405149af.zip
FreeBSD-src-ff24404b376ee802a4160e1f4edaa37d405149af.tar.gz
Don't use evil casts in cdevsw initialization.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/null/null.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/sys/dev/null/null.c b/sys/dev/null/null.c
index 6bdce78..c96faf0 100644
--- a/sys/dev/null/null.c
+++ b/sys/dev/null/null.c
@@ -44,15 +44,16 @@ static dev_t zero_dev;
static d_write_t null_write;
static d_ioctl_t null_ioctl;
static d_read_t zero_read;
+static d_read_t null_read;
#define CDEV_MAJOR 2
#define NULL_MINOR 2
#define ZERO_MINOR 12
static struct cdevsw null_cdevsw = {
- /* open */ (d_open_t *)nullop,
- /* close */ (d_close_t *)nullop,
- /* read */ (d_read_t *)nullop,
+ /* open */ nullopen,
+ /* close */ nullclose,
+ /* read */ null_read,
/* write */ null_write,
/* ioctl */ null_ioctl,
/* poll */ nopoll,
@@ -67,8 +68,8 @@ static struct cdevsw null_cdevsw = {
};
static struct cdevsw zero_cdevsw = {
- /* open */ (d_open_t *)nullop,
- /* close */ (d_close_t *)nullop,
+ /* open */ nullopen,
+ /* close */ nullclose,
/* read */ zero_read,
/* write */ null_write,
/* ioctl */ noioctl,
@@ -85,6 +86,13 @@ static struct cdevsw zero_cdevsw = {
static void *zbuf;
+static int
+null_read(dev_t dev __unused, struct uio *uio, int flags __unused)
+{
+
+ return 0;
+}
+
/* ARGSUSED */
static int
null_write(dev_t dev __unused, struct uio *uio, int flags __unused)
OpenPOWER on IntegriCloud