diff options
author | phk <phk@FreeBSD.org> | 1996-07-23 21:52:43 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1996-07-23 21:52:43 +0000 |
commit | 507c8709748944c310d7a558ec0e27130fadb6f4 (patch) | |
tree | b7107b6c401f05c3026e9bfb11ea285a7b376aba /sys/scsi/st.c | |
parent | b27f4b2c811818ccd3f03bd1aad99a231b5b2b18 (diff) | |
download | FreeBSD-src-507c8709748944c310d7a558ec0e27130fadb6f4.zip FreeBSD-src-507c8709748944c310d7a558ec0e27130fadb6f4.tar.gz |
Make a "DWIM" function for adding [bc]devsw entries for bdev drivers.
Saves about 280 butes of source per driver, 56 bytes in object size
and another 56 bytes moves from data to bss.
No functional change intended nor expected.
GENERIC should be about one k smaller now :-)
Diffstat (limited to 'sys/scsi/st.c')
-rw-r--r-- | sys/scsi/st.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/sys/scsi/st.c b/sys/scsi/st.c index 2bcc733..d7fe9a9 100644 --- a/sys/scsi/st.c +++ b/sys/scsi/st.c @@ -12,7 +12,7 @@ * on the understanding that TFS is not responsible for the correct * functioning of this software in any circumstances. * - * $Id: st.c,v 1.70 1996/06/24 04:54:32 gibbs Exp $ + * $Id: st.c,v 1.71 1996/07/14 10:46:54 joerg Exp $ */ /* @@ -163,17 +163,11 @@ static d_strategy_t ststrategy; #define CDEV_MAJOR 14 #define BDEV_MAJOR 5 -extern struct cdevsw st_cdevsw; /* hold off the complaints for a second */ +static struct cdevsw st_cdevsw; static struct bdevsw st_bdevsw = { stopen, stclose, ststrategy, stioctl, /*5*/ nodump, nopsize, 0, "st", &st_cdevsw, -1 }; -static struct cdevsw st_cdevsw = - { stopen, stclose, rawread, rawwrite, /*14*/ - stioctl, nostop, nullreset, nodevtotty,/* st */ - seltrue, nommap, ststrategy, "st", - &st_bdevsw, -1 }; - SCSI_DEVICE_ENTRIES(st) static struct scsi_device st_switch = @@ -1987,13 +1981,9 @@ static st_devsw_installed = 0; static void st_drvinit(void *unused) { - dev_t dev; if( ! st_devsw_installed ) { - dev = makedev(CDEV_MAJOR, 0); - cdevsw_add(&dev,&st_cdevsw, NULL); - dev = makedev(BDEV_MAJOR, 0); - bdevsw_add(&dev,&st_bdevsw, NULL); + bdevsw_add_generic(BDEV_MAJOR, CDEV_MAJOR, &st_bdevsw); st_devsw_installed = 1; } } |