From 507c8709748944c310d7a558ec0e27130fadb6f4 Mon Sep 17 00:00:00 2001 From: phk Date: Tue, 23 Jul 1996 21:52:43 +0000 Subject: 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 :-) --- sys/scsi/st.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'sys/scsi/st.c') 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; } } -- cgit v1.1