X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fcdrom%2Fmcdx.c;h=a0b580c22d80942dbd75536609076f219edce33b;hb=43bc926fffd92024b46cafaf7350d669ba9ca884;hp=ccde7ab491d4f96b162357ed817fd8b27287b801;hpb=6a77f38946aaee1cd85eeec6cf4229b204c15071;p=linux-2.6.git diff --git a/drivers/cdrom/mcdx.c b/drivers/cdrom/mcdx.c index ccde7ab49..a0b580c22 100644 --- a/drivers/cdrom/mcdx.c +++ b/drivers/cdrom/mcdx.c @@ -51,7 +51,7 @@ */ -#if RCS +#ifdef RCS static const char *mcdx_c_version = "$Id: mcdx.c,v 1.21 1997/01/26 07:12:59 davem Exp $"; #endif @@ -107,20 +107,20 @@ static const char *mcdx_c_version The _direct_ size is the number of sectors we're allowed to skip directly (performing a read instead of requesting the new sector needed */ -const int REQUEST_SIZE = 800; /* should be less then 255 * 4 */ -const int DIRECT_SIZE = 400; /* should be less then REQUEST_SIZE */ +static const int REQUEST_SIZE = 800; /* should be less then 255 * 4 */ +static const int DIRECT_SIZE = 400; /* should be less then REQUEST_SIZE */ enum drivemodes { TOC, DATA, RAW, COOKED }; enum datamodes { MODE0, MODE1, MODE2 }; enum resetmodes { SOFT, HARD }; -const int SINGLE = 0x01; /* single speed drive (FX001S, LU) */ -const int DOUBLE = 0x02; /* double speed drive (FX001D, ..? */ -const int DOOR = 0x04; /* door locking capability */ -const int MULTI = 0x08; /* multi session capability */ +static const int SINGLE = 0x01; /* single speed drive (FX001S, LU) */ +static const int DOUBLE = 0x02; /* double speed drive (FX001D, ..? */ +static const int DOOR = 0x04; /* door locking capability */ +static const int MULTI = 0x08; /* multi session capability */ -const unsigned char READ1X = 0xc0; -const unsigned char READ2X = 0xc1; +static const unsigned char READ1X = 0xc0; +static const unsigned char READ2X = 0xc1; /* DECLARATIONS ****************************************************/ @@ -210,9 +210,7 @@ struct s_drive_stuff { repeated here to show what's going on. And to sense, if they're changed elsewhere. */ -/* declared in blk.h */ -int mcdx_init(void); -void do_mcdx_request(request_queue_t * q); +static int mcdx_init(void); static int mcdx_block_open(struct inode *inode, struct file *file) { @@ -569,7 +567,7 @@ static int mcdx_audio_ioctl(struct cdrom_device_info *cdi, } } -void do_mcdx_request(request_queue_t * q) +static void do_mcdx_request(request_queue_t * q) { struct s_drive_stuff *stuffp; struct request *req; @@ -708,7 +706,7 @@ static int mcdx_open(struct cdrom_device_info *cdi, int purpose) xtrace(OPENCLOSE, "open() init irq generation\n"); if (-1 == mcdx_config(stuffp, 1)) return -EIO; -#if FALLBACK +#ifdef FALLBACK /* Set the read speed */ xwarn("AAA %x AAA\n", stuffp->readcmd); if (stuffp->readerrs) @@ -1028,7 +1026,7 @@ int __mcdx_init(void) return 0; } -void __exit mcdx_exit(void) +static void __exit mcdx_exit(void) { int i; @@ -1075,7 +1073,7 @@ module_exit(mcdx_exit); /* Support functions ************************************************/ -int __init mcdx_init_drive(int drive) +static int __init mcdx_init_drive(int drive) { struct s_version version; struct gendisk *disk; @@ -1087,7 +1085,7 @@ int __init mcdx_init_drive(int drive) xtrace(INIT, "kmalloc space for stuffpt's\n"); xtrace(MALLOC, "init() malloc %d bytes\n", size); - if (!(stuffp = kmalloc(size, GFP_KERNEL))) { + if (!(stuffp = kzalloc(size, GFP_KERNEL))) { xwarn("init() malloc failed\n"); return 1; } @@ -1103,8 +1101,6 @@ int __init mcdx_init_drive(int drive) sizeof(*stuffp), stuffp); /* set default values */ - memset(stuffp, 0, sizeof(*stuffp)); - stuffp->present = 0; /* this should be 0 already */ stuffp->toc = NULL; /* this should be NULL already */ @@ -1218,7 +1214,7 @@ int __init mcdx_init_drive(int drive) } -#if WE_KNOW_WHY +#ifdef WE_KNOW_WHY /* irq 11 -> channel register */ outb(0x50, stuffp->wreg_chn); #endif @@ -1261,7 +1257,7 @@ int __init mcdx_init_drive(int drive) return 0; } -int __init mcdx_init(void) +static int __init mcdx_init(void) { int drive; xwarn("Version 2.14(hs) \n"); @@ -1296,7 +1292,7 @@ static int mcdx_transfer(struct s_drive_stuff *stuffp, ans = mcdx_xfer(stuffp, p, sector, nr_sectors); return ans; -#if FALLBACK +#ifdef FALLBACK if (-1 == ans) stuffp->readerrs++; else