Don't use evil casts in cdevsw initialization.
This commit is contained in:
parent
d44666a5de
commit
ff24404b37
@ -44,15 +44,16 @@ static dev_t zero_dev;
|
|||||||
static d_write_t null_write;
|
static d_write_t null_write;
|
||||||
static d_ioctl_t null_ioctl;
|
static d_ioctl_t null_ioctl;
|
||||||
static d_read_t zero_read;
|
static d_read_t zero_read;
|
||||||
|
static d_read_t null_read;
|
||||||
|
|
||||||
#define CDEV_MAJOR 2
|
#define CDEV_MAJOR 2
|
||||||
#define NULL_MINOR 2
|
#define NULL_MINOR 2
|
||||||
#define ZERO_MINOR 12
|
#define ZERO_MINOR 12
|
||||||
|
|
||||||
static struct cdevsw null_cdevsw = {
|
static struct cdevsw null_cdevsw = {
|
||||||
/* open */ (d_open_t *)nullop,
|
/* open */ nullopen,
|
||||||
/* close */ (d_close_t *)nullop,
|
/* close */ nullclose,
|
||||||
/* read */ (d_read_t *)nullop,
|
/* read */ null_read,
|
||||||
/* write */ null_write,
|
/* write */ null_write,
|
||||||
/* ioctl */ null_ioctl,
|
/* ioctl */ null_ioctl,
|
||||||
/* poll */ nopoll,
|
/* poll */ nopoll,
|
||||||
@ -67,8 +68,8 @@ static struct cdevsw null_cdevsw = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static struct cdevsw zero_cdevsw = {
|
static struct cdevsw zero_cdevsw = {
|
||||||
/* open */ (d_open_t *)nullop,
|
/* open */ nullopen,
|
||||||
/* close */ (d_close_t *)nullop,
|
/* close */ nullclose,
|
||||||
/* read */ zero_read,
|
/* read */ zero_read,
|
||||||
/* write */ null_write,
|
/* write */ null_write,
|
||||||
/* ioctl */ noioctl,
|
/* ioctl */ noioctl,
|
||||||
@ -85,6 +86,13 @@ static struct cdevsw zero_cdevsw = {
|
|||||||
|
|
||||||
static void *zbuf;
|
static void *zbuf;
|
||||||
|
|
||||||
|
static int
|
||||||
|
null_read(dev_t dev __unused, struct uio *uio, int flags __unused)
|
||||||
|
{
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static int
|
static int
|
||||||
null_write(dev_t dev __unused, struct uio *uio, int flags __unused)
|
null_write(dev_t dev __unused, struct uio *uio, int flags __unused)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user