diff options
author | phk <phk@FreeBSD.org> | 2003-03-03 12:15:54 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2003-03-03 12:15:54 +0000 |
commit | 0ae911eb0e57eebb61c50c02ddf69aa67ed19599 (patch) | |
tree | 4e91d5779ffebe1d75e975aa4450f35f965430eb /sys/kern | |
parent | e58d97a666e757e8429a219da05f88a51554c32c (diff) | |
download | FreeBSD-src-0ae911eb0e57eebb61c50c02ddf69aa67ed19599.zip FreeBSD-src-0ae911eb0e57eebb61c50c02ddf69aa67ed19599.tar.gz |
Gigacommit to improve device-driver source compatibility between
branches:
Initialize struct cdevsw using C99 sparse initializtion and remove
all initializations to default values.
This patch is automatically generated and has been tested by compiling
LINT with all the fields in struct cdevsw in reverse order on alpha,
sparc64 and i386.
Approved by: re(scottl)
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_conf.c | 26 | ||||
-rw-r--r-- | sys/kern/kern_descrip.c | 16 | ||||
-rw-r--r-- | sys/kern/subr_bus.c | 20 | ||||
-rw-r--r-- | sys/kern/subr_log.c | 20 | ||||
-rw-r--r-- | sys/kern/tty_cons.c | 24 | ||||
-rw-r--r-- | sys/kern/tty_pty.c | 48 | ||||
-rw-r--r-- | sys/kern/tty_tty.c | 18 |
7 files changed, 64 insertions, 108 deletions
diff --git a/sys/kern/kern_conf.c b/sys/kern/kern_conf.c index d1794fa..4606fd6 100644 --- a/sys/kern/kern_conf.c +++ b/sys/kern/kern_conf.c @@ -95,20 +95,18 @@ dead_strategy(struct bio *bp) #define dead_kqfilter (d_kqfilter_t *)enxio static struct cdevsw dead_cdevsw = { - /* open */ dead_open, - /* close */ dead_close, - /* read */ dead_read, - /* write */ dead_write, - /* ioctl */ dead_ioctl, - /* poll */ dead_poll, - /* mmap */ dead_mmap, - /* strategy */ dead_strategy, - /* name */ "dead", - /* maj */ 255, - /* dump */ dead_dump, - /* psize */ nopsize, - /* flags */ 0, - /* kqfilter */ dead_kqfilter + .d_open = dead_open, + .d_close = dead_close, + .d_read = dead_read, + .d_write = dead_write, + .d_ioctl = dead_ioctl, + .d_poll = dead_poll, + .d_mmap = dead_mmap, + .d_strategy = dead_strategy, + .d_name = "dead", + .d_maj = 255, + .d_dump = dead_dump, + .d_kqfilter = dead_kqfilter }; diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 109b8ae..0d02974 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -83,19 +83,9 @@ static d_open_t fdopen; #define CDEV_MAJOR 22 static struct cdevsw fildesc_cdevsw = { - /* open */ fdopen, - /* close */ noclose, - /* read */ noread, - /* write */ nowrite, - /* ioctl */ noioctl, - /* poll */ nopoll, - /* mmap */ nommap, - /* strategy */ nostrategy, - /* name */ "FD", - /* maj */ CDEV_MAJOR, - /* dump */ nodump, - /* psize */ nopsize, - /* flags */ 0, + .d_open = fdopen, + .d_name = "FD", + .d_maj = CDEV_MAJOR, }; /* How to treat 'new' parameter when allocating a fd for do_dup(). */ diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index 90b432b..75529a0 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -217,19 +217,13 @@ static d_poll_t devpoll; #define CDEV_MAJOR 173 static struct cdevsw dev_cdevsw = { - /* open */ devopen, - /* close */ devclose, - /* read */ devread, - /* write */ nowrite, - /* ioctl */ devioctl, - /* poll */ devpoll, - /* mmap */ nommap, - /* strategy */ nostrategy, - /* name */ "devctl", - /* maj */ CDEV_MAJOR, - /* dump */ nodump, - /* psize */ nopsize, - /* flags */ 0, + .d_open = devopen, + .d_close = devclose, + .d_read = devread, + .d_ioctl = devioctl, + .d_poll = devpoll, + .d_name = "devctl", + .d_maj = CDEV_MAJOR, }; struct dev_event_info diff --git a/sys/kern/subr_log.c b/sys/kern/subr_log.c index c506e9e..97644c1 100644 --- a/sys/kern/subr_log.c +++ b/sys/kern/subr_log.c @@ -67,19 +67,13 @@ static void logtimeout(void *arg); #define CDEV_MAJOR 7 static struct cdevsw log_cdevsw = { - /* open */ logopen, - /* close */ logclose, - /* read */ logread, - /* write */ nowrite, - /* ioctl */ logioctl, - /* poll */ logpoll, - /* mmap */ nommap, - /* strategy */ nostrategy, - /* name */ "log", - /* maj */ CDEV_MAJOR, - /* dump */ nodump, - /* psize */ nopsize, - /* flags */ 0, + .d_open = logopen, + .d_close = logclose, + .d_read = logread, + .d_ioctl = logioctl, + .d_poll = logpoll, + .d_name = "log", + .d_maj = CDEV_MAJOR, }; static struct logsoftc { diff --git a/sys/kern/tty_cons.c b/sys/kern/tty_cons.c index e672eac..e536b45 100644 --- a/sys/kern/tty_cons.c +++ b/sys/kern/tty_cons.c @@ -71,20 +71,16 @@ static d_kqfilter_t cnkqfilter; #define CDEV_MAJOR 0 static struct cdevsw cn_cdevsw = { - /* open */ cnopen, - /* close */ cnclose, - /* read */ cnread, - /* write */ cnwrite, - /* ioctl */ cnioctl, - /* poll */ cnpoll, - /* mmap */ nommap, - /* strategy */ nostrategy, - /* name */ "console", - /* maj */ CDEV_MAJOR, - /* dump */ nodump, - /* psize */ nopsize, - /* flags */ D_TTY | D_KQFILTER, - /* kqfilter */ cnkqfilter, + .d_open = cnopen, + .d_close = cnclose, + .d_read = cnread, + .d_write = cnwrite, + .d_ioctl = cnioctl, + .d_poll = cnpoll, + .d_name = "console", + .d_maj = CDEV_MAJOR, + .d_flags = D_TTY | D_KQFILTER, + .d_kqfilter = cnkqfilter, }; struct cn_device { diff --git a/sys/kern/tty_pty.c b/sys/kern/tty_pty.c index 83f2b9c..1561eb1 100644 --- a/sys/kern/tty_pty.c +++ b/sys/kern/tty_pty.c @@ -77,38 +77,30 @@ static d_poll_t ptcpoll; #define CDEV_MAJOR_S 5 static struct cdevsw pts_cdevsw = { - /* open */ ptsopen, - /* close */ ptsclose, - /* read */ ptsread, - /* write */ ptswrite, - /* ioctl */ ptyioctl, - /* poll */ ttypoll, - /* mmap */ nommap, - /* strategy */ nostrategy, - /* name */ "pts", - /* maj */ CDEV_MAJOR_S, - /* dump */ nodump, - /* psize */ nopsize, - /* flags */ D_TTY | D_KQFILTER, - /* kqfilter */ ttykqfilter, + .d_open = ptsopen, + .d_close = ptsclose, + .d_read = ptsread, + .d_write = ptswrite, + .d_ioctl = ptyioctl, + .d_poll = ttypoll, + .d_name = "pts", + .d_maj = CDEV_MAJOR_S, + .d_flags = D_TTY | D_KQFILTER, + .d_kqfilter = ttykqfilter, }; #define CDEV_MAJOR_C 6 static struct cdevsw ptc_cdevsw = { - /* open */ ptcopen, - /* close */ ptcclose, - /* read */ ptcread, - /* write */ ptcwrite, - /* ioctl */ ptyioctl, - /* poll */ ptcpoll, - /* mmap */ nommap, - /* strategy */ nostrategy, - /* name */ "ptc", - /* maj */ CDEV_MAJOR_C, - /* dump */ nodump, - /* psize */ nopsize, - /* flags */ D_TTY | D_KQFILTER, - /* kqfilter */ ttykqfilter, + .d_open = ptcopen, + .d_close = ptcclose, + .d_read = ptcread, + .d_write = ptcwrite, + .d_ioctl = ptyioctl, + .d_poll = ptcpoll, + .d_name = "ptc", + .d_maj = CDEV_MAJOR_C, + .d_flags = D_TTY | D_KQFILTER, + .d_kqfilter = ttykqfilter, }; #define BUFSIZ 100 /* Chunk size iomoved to/from user */ diff --git a/sys/kern/tty_tty.c b/sys/kern/tty_tty.c index 52fc4db..cdeaa41 100644 --- a/sys/kern/tty_tty.c +++ b/sys/kern/tty_tty.c @@ -37,19 +37,11 @@ static d_open_t cttyopen; #define CDEV_MAJOR 1 static struct cdevsw ctty_cdevsw = { - /* open */ cttyopen, - /* close */ nullclose, - /* read */ noread, - /* write */ nowrite, - /* ioctl */ noioctl, - /* poll */ nopoll, - /* mmap */ nommap, - /* strategy */ nostrategy, - /* name */ "ctty", - /* maj */ CDEV_MAJOR, - /* dump */ nodump, - /* psize */ nopsize, - /* flags */ D_TTY, + .d_open = cttyopen, + .d_close = nullclose, + .d_name = "ctty", + .d_maj = CDEV_MAJOR, + .d_flags = D_TTY, }; static dev_t ctty; |