drivers/block/: some cleanups
Subsystems (3)
PATCH 1/1 drivers/block/: some cleanups
the patch below removes some unused code from drivers/block/, makes some needlessly global code static and does some other small cleanups.
Please review and comment.
diffstat output:
drivers/block/as-iosched.c | 4 - drivers/block/cciss.c | 18 +++----- drivers/block/cciss_scsi.c | 35 +-------------- drivers/block/cciss_scsi.h | 1 drivers/block/cfq-iosched.c | 6 +- drivers/block/cpqarray.c | 13 ----- drivers/block/deadline-iosched.c | 6 +- drivers/block/elevator.c | 4 - drivers/block/floppy.c | 4 - drivers/block/genhd.c | 2 drivers/block/loop.c | 4 - drivers/block/nbd.c | 6 +- drivers/block/noop-iosched.c | 12 ++--- drivers/block/paride/pcd.c | 22 --------- drivers/block/paride/pd.c | 23 ---------- drivers/block/paride/pf.c | 23 ---------- drivers/block/paride/pg.c | 21 --------- drivers/block/paride/pt.c | 22 --------- drivers/block/paride/setup.h | 69 ------------------------------- drivers/block/pktcdvd.c | 4 - drivers/block/ps2esdi.c | 42 ------------------ drivers/block/rd.c | 4 - drivers/block/ub.c | 2 drivers/block/umem.c | 4 - drivers/block/xd.c | 2 25 files changed, 50 insertions(+), 303 deletions(-)
Signed-off-by Adrian Bunk <[email protected]>
drivers/block/as-iosched.c renamed from drivers/block/as-iosched.c.old +2 -2
@@ -2096,7 +2096,7 @@ .elevator_owner = THIS_MODULE, }; -int as_init (void ) +static int as_init (void ) {int ret;
@@ -2120,7 +2120,7 @@return ret; } -void as_exit (void ) +static void as_exit (void ) {kmem_cache_destroy (arq_pool);elv_unregister (&iosched_as);
drivers/block/cciss.c renamed from drivers/block/cciss.c.old +7 -11
@@ -61,7 +61,7 @@#include <linux/cciss_ioctl.h> /* define the PCI info for the cards we can control */ -const struct pci_device_id cciss_pci_device_id[] = { +static const struct pci_device_id cciss_pci_device_id[] = { {PCI_VENDOR_ID_COMPAQ ,PCI_DEVICE_ID_COMPAQ_CISS ,0x0E11 ,0x4070 ,0 ,0 ,0 }, {PCI_VENDOR_ID_COMPAQ ,PCI_DEVICE_ID_COMPAQ_CISSB ,
@@ -2908,21 +2908,17 @@* This is it. Register the PCI driver information for the cards we control * the OS will call our registered routines when it finds one of our cards. */ -int __init cciss_init (void ) +static int __init init_cciss (void ) { +register_cciss_ioctl32 (); + printk(KERN_INFO DRIVER_NAME "\n"); /* Register for our PCI devices */ return pci_module_init(&cciss_pci_driver); } -static int __init init_cciss_module (void ) -{ -register_cciss_ioctl32 (); -return (cciss_init ()); -} - -static void __exit cleanup_cciss_module(void) +static void __exit cleanup_cciss(void) {int i;
@@ -2941,5 +2937,5 @@remove_proc_entry ("cciss" , proc_root_driver); } -module_init (init_cciss_module); -module_exit (cleanup_cciss_module); +module_init (init_cciss); +module_exit (cleanup_cciss);
drivers/block/cciss_scsi.h renamed from drivers/block/cciss_scsi.h.old +0 -1
@@ -39,7 +39,6 @@#define SCSI_CCISS_CAN_QUEUE 2/* -info: cciss_scsi_info, \ Note, cmd_per_lun could give us some trouble, so I'm setting it very low. Likewise, SCSI_CCISS_CAN_QUEUE is set very conservatively.
drivers/block/cciss_scsi.c renamed from drivers/block/cciss_scsi.c.old +4 -31
@@ -53,9 +53,7 @@ int cmd_type); -const char *cciss_scsi_info (struct Scsi_Host *sa); - -int cciss_scsi_proc_info( +static int cciss_scsi_proc_info( struct Scsi_Host *sh, char *buffer, /* data buffer */ char **start, /* where data in buffer starts */
@@ -63,7 +61,7 @@int length,/* length of data in buffer */ int func); /* 0 == read, 1 == write */ -int cciss_scsi_queue_command (struct scsi_cmnd *cmd, +static int cciss_scsi_queue_command (struct scsi_cmnd *cmd,void (* done)(struct scsi_cmnd *));static struct cciss_scsi_hba_t ccissscsi[MAX_CTLR ] = {
@@ -712,8 +710,6 @@return 1 ; } -static void __exit cleanup_cciss_module(void); - static void cciss_unmap_one(struct pci_dev *pdev, CommandList_struct *cp,
@@ -1114,7 +1110,7 @@ } -int +static int cciss_scsi_proc_info(struct Scsi_Host *sh, char *buffer, /* data buffer */ char **start, /* where data in buffer starts */
@@ -1149,29 +1145,6 @@ buffer, length); } -/* this is via the generic proc support */ -const char * -cciss_scsi_info (struct Scsi_Host *sa) -{ -static char buf[300 ]; -ctlr_info_t *ci; - -/* probably need to work on putting a bit more info in here... */ -/* this is output via the /proc filesystem. */ - - ci = (ctlr_info_t *) sa->hostdata[0 ]; - -sprintf (buf,"%s %c%c%c%c\n" , - ci->product_name, - ci->firm_ver[0 ], - ci->firm_ver[1 ], - ci->firm_ver[2 ], - ci->firm_ver[3 ]); - -return buf; -} - -/* cciss_scatter_gather takes a struct scsi_cmnd, (cmd), and does the pci dma mapping and fills in the scatter gather entries of the cciss command, cp. */
@@ -1225,7 +1198,7 @@ } -int +static int cciss_scsi_queue_command (struct scsi_cmnd *cmd,void (* done)(struct scsi_cmnd *)) {ctlr_info_t **c;
drivers/block/cfq-iosched.c renamed from drivers/block/cfq-iosched.c.old +3 -3
@@ -1874,7 +1874,7 @@ .store = cfq_attr_store, }; -struct kobj_type cfq_ktype = { +static struct kobj_type cfq_ktype = { .sysfs_ops = &cfq_sysfs_ops, .default_attrs = default_attrs, };
@@ -1903,7 +1903,7 @@ .elevator_owner = THIS_MODULE, }; -int cfq_init (void ) +static int cfq_init (void ) {int ret;
@@ -1920,7 +1920,7 @@return ret; } -void cfq_exit (void ) +static void cfq_exit (void ) {cfq_slab_kill ();elv_unregister (&iosched_cfq);
drivers/block/cpqarray.c renamed from drivers/block/cpqarray.c.old +2 -11
@@ -97,7 +97,7 @@ };/* define the PCI info for the PCI cards this driver can control */ -const struct pci_device_id cpqarray_pci_device_id[] = +static const struct pci_device_id cpqarray_pci_device_id[] = { {PCI_VENDOR_ID_DEC ,PCI_DEVICE_ID_COMPAQ_42XX ,0x0E11 ,0x4058 ,0 ,0 ,0 },/* SA431 */
@@ -135,7 +135,6 @@/* Debug Extra Paranoid... */ #define DBGPX (s) do { } while(0) -int cpqarray_init_step2 (void );static int cpqarray_pci_init (ctlr_info_t *c,struct pci_dev *pdev);static void __iomem *remap_pci_mem (ulong base,ulong size);static int cpqarray_eisa_detect (void );
@@ -312,14 +311,6 @@module_param_array (eisa, int,NULL ,0 ); -/* This is a bit of a hack, -* necessary to support both eisa and pci -*/ -int __init cpqarray_init (void ) -{ -return (cpqarray_init_step2 ()); -} -static void release_io_mem (ctlr_info_t *c) {/* if IO mem was not protected do nothing */
@@ -560,7 +551,7 @@* This is it. Find all the controllers and register them. * returns the number of block devices registered. */ -int __init cpqarray_init_step2 (void ) +static int __init cpqarray_init (void ) {int num_cntlrs_reg =0 ;int i;
drivers/block/deadline-iosched.c renamed from drivers/block/deadline-iosched.c.old +3 -3
@@ -909,7 +909,7 @@ .store = deadline_attr_store, }; -struct kobj_type deadline_ktype = { +static struct kobj_type deadline_ktype = { .sysfs_ops = &deadline_sysfs_ops, .default_attrs = default_attrs, };
@@ -936,7 +936,7 @@ .elevator_owner = THIS_MODULE, }; -int deadline_init (void ) +static int deadline_init (void ) {int ret;
@@ -953,7 +953,7 @@return ret; } -void deadline_exit (void ) +static void deadline_exit (void ) {kmem_cache_destroy (drq_pool);elv_unregister (&iosched_deadline);
drivers/block/elevator.c renamed from drivers/block/elevator.c.old +2 -2
@@ -92,7 +92,7 @@ }EXPORT_SYMBOL (elv_try_last_merge); -struct elevator_type *elevator_find (const char *name) +static struct elevator_type *elevator_find (const char *name) {struct elevator_type *e =NULL ;struct list_head *entry;
@@ -222,7 +222,7 @@kfree (e); } -int elevator_global_init (void ) +static int elevator_global_init (void ) {return 0 ; }
drivers/block/floppy.c renamed from drivers/block/floppy.c.old +2 -2
@@ -4397,7 +4397,7 @@ }#endif -int __init floppy_init (void ) +static int __init floppy_init (void ) {int i, unit, drive;int err, dr;
@@ -4738,7 +4738,7 @@#ifdef MODULE -char *floppy; +static char *floppy;static void unregister_devfs_entries (int drive) {
drivers/block/genhd.c renamed from drivers/block/genhd.c.old +1 -1
@@ -305,7 +305,7 @@return NULL ; } -int __init device_init (void ) +static int __init device_init (void ) { bdev_map =kobj_map_init (base_probe, &block_subsys);blk_dev_init ();
drivers/block/loop.c renamed from drivers/block/loop.c.old +2 -2
@@ -1114,7 +1114,7 @@EXPORT_SYMBOL (loop_register_transfer);EXPORT_SYMBOL (loop_unregister_transfer); -int __init loop_init (void ) +static int __init loop_init (void ) {int i;
@@ -1189,7 +1189,7 @@return -ENOMEM ; } -void loop_exit (void ) +static void loop_exit (void ) {int i;
drivers/block/nbd.c renamed from drivers/block/nbd.c.old +3 -3
@@ -315,7 +315,7 @@ }/* NULL returned = something went wrong, inform userspace */ -struct request *nbd_read_stat (struct nbd_device *lo) +static struct request *nbd_read_stat (struct nbd_device *lo) {int result;struct nbd_reply reply;
@@ -377,7 +377,7 @@return NULL ; } -void nbd_do_it (struct nbd_device *lo) +static void nbd_do_it (struct nbd_device *lo) {struct request *req;
@@ -388,7 +388,7 @@return ; } -void nbd_clear_que (struct nbd_device *lo) +static void nbd_clear_que (struct nbd_device *lo) {struct request *req;
drivers/block/noop-iosched.c renamed from drivers/block/noop-iosched.c.old +6 -6
@@ -17,7 +17,7 @@/* * See if we can find a request that this buffer can be coalesced with. */ -int elevator_noop_merge (request_queue_t *q,struct request **req, +static int elevator_noop_merge (request_queue_t *q,struct request **req,struct bio *bio) {struct list_head *entry = &q->queue_head;
@@ -50,13 +50,13 @@return ELEVATOR_NO_MERGE ; } -void elevator_noop_merge_requests (request_queue_t *q,struct request *req, +static void elevator_noop_merge_requests (request_queue_t *q,struct request *req,struct request *next) {list_del_init (&next->queuelist); } -void elevator_noop_add_request (request_queue_t *q,struct request *rq, +static void elevator_noop_add_request (request_queue_t *q,struct request *rq,int where) {struct list_head *insert = q->queue_head.prev;
@@ -75,7 +75,7 @@ q->last_merge = rq; } -struct request *elevator_noop_next_request (request_queue_t *q) +static struct request *elevator_noop_next_request (request_queue_t *q) {if (!list_empty (&q->queue_head))return list_entry_rq (q->queue_head.next);
@@ -94,12 +94,12 @@ .elevator_owner = THIS_MODULE, }; -int noop_init (void ) +static int noop_init (void ) {return elv_register (&elevator_noop); } -void noop_exit (void ) +static void noop_exit (void ) {elv_unregister (&elevator_noop); }
drivers/block/paride/pcd.c renamed from drivers/block/paride/pcd.c.old +1 -21
@@ -142,26 +142,6 @@static spinlock_t pcd_lock; -#ifndef MODULE - -#include "setup.h" - -static STT pcd_stt[6 ] = { - {"drive0" ,6 , drive0}, - {"drive1" ,6 , drive1}, - {"drive2" ,6 , drive2}, - {"drive3" ,6 , drive3}, - {"disable" ,1 , &disable}, - {"nice" ,1 , &nice} -}; - -void pcd_setup (char *str,int *ints) -{ -generic_setup (pcd_stt,6 , str); -} - -#endif -module_param (verbose, bool,0644 );module_param (major, int,0 );module_param (name, charp,0 );
@@ -218,7 +198,7 @@struct gendisk *disk; }; -struct pcd_unit pcd[PCD_UNITS ]; +static struct pcd_unit pcd[PCD_UNITS ];static char pcd_scratch[64 ];static char pcd_buffer[2048 ];/* raw block buffer */
drivers/block/paride/pd.c renamed from drivers/block/paride/pd.c.old +1 -22
@@ -157,27 +157,6 @@static spinlock_t pd_lock =SPIN_LOCK_UNLOCKED ; -#ifndef MODULE - -#include "setup.h" - -static STT pd_stt[7 ] = { - {"drive0" ,8 , drive0}, - {"drive1" ,8 , drive1}, - {"drive2" ,8 , drive2}, - {"drive3" ,8 , drive3}, - {"disable" ,1 , &disable}, - {"cluster" ,1 , &cluster}, - {"nice" ,1 , &nice} -}; - -void pd_setup (char *str,int *ints) -{ -generic_setup (pd_stt,7 , str); -} - -#endif -module_param (verbose, bool,0 );module_param (major, int,0 );module_param (name, charp,0 );
@@ -255,7 +234,7 @@struct gendisk *gd; }; -struct pd_unit pd[PD_UNITS ]; +static struct pd_unit pd[PD_UNITS ];static char pd_scratch[512 ];/* scratch block buffer */
drivers/block/paride/pf.c renamed from drivers/block/paride/pf.c.old +1 -22
@@ -156,27 +156,6 @@static spinlock_t pf_spin_lock; -#ifndef MODULE - -#include "setup.h" - -static STT pf_stt[7 ] = { - {"drive0" ,7 , drive0}, - {"drive1" ,7 , drive1}, - {"drive2" ,7 , drive2}, - {"drive3" ,7 , drive3}, - {"disable" ,1 , &disable}, - {"cluster" ,1 , &cluster}, - {"nice" ,1 , &nice} -}; - -void pf_setup (char *str,int *ints) -{ -generic_setup (pf_stt,7 , str); -} - -#endif -module_param (verbose, bool,0644 );module_param (major, int,0 );module_param (name, charp,0 );
@@ -256,7 +235,7 @@struct gendisk *disk; }; -struct pf_unit units[PF_UNITS ]; +static struct pf_unit units[PF_UNITS ];static int pf_identify (struct pf_unit *pf);static void pf_lock (struct pf_unit *pf,int func);
drivers/block/paride/pg.c renamed from drivers/block/paride/pg.c.old +1 -20
@@ -165,25 +165,6 @@#include <asm/uaccess.h> -#ifndef MODULE - -#include "setup.h" - -static STT pg_stt[5 ] = { - {"drive0" ,6 , drive0}, - {"drive1" ,6 , drive1}, - {"drive2" ,6 , drive2}, - {"drive3" ,6 , drive3}, - {"disable" ,1 , &disable} -}; - -void pg_setup (char *str,int *ints) -{ -generic_setup (pg_stt,5 , str); -} - -#endif -module_param (verbose, bool,0644 );module_param (major, int,0 );module_param (name, charp,0 );
@@ -235,7 +216,7 @@char name[PG_NAMELEN ];/* pg0, pg1, ... */ }; -struct pg devices[PG_UNITS ]; +static struct pg devices[PG_UNITS ];static int pg_identify (struct pg *dev,int log);
drivers/block/paride/pt.c renamed from drivers/block/paride/pt.c.old +1 -21
@@ -149,26 +149,6 @@#include <asm/uaccess.h> -#ifndef MODULE - -#include "setup.h" - -static STT pt_stt[5 ] = { - {"drive0" ,6 , drive0}, - {"drive1" ,6 , drive1}, - {"drive2" ,6 , drive2}, - {"drive3" ,6 , drive3}, - {"disable" ,1 , &disable} -}; - -void -pt_setup (char *str,int *ints) -{ -generic_setup (pt_stt,5 , str); -} - -#endif -module_param (verbose, bool,0 );module_param (major, int,0 );module_param (name, charp,0 );
@@ -246,7 +226,7 @@static int pt_identify (struct pt_unit *tape); -struct pt_unit pt[PT_UNITS ]; +static struct pt_unit pt[PT_UNITS ];static char pt_scratch[512 ];/* scratch block buffer */
drivers/block/pktcdvd.c renamed from drivers/block/pktcdvd.c.old +2 -2
@@ -2627,7 +2627,7 @@ .fops = &pkt_ctl_fops }; -int pkt_init (void ) +static int pkt_init (void ) {int ret;
@@ -2663,7 +2663,7 @@return ret; } -void pkt_exit (void ) +static void pkt_exit (void ) {remove_proc_entry ("pktcdvd" , proc_root_driver);misc_deregister (&pkt_misc);
drivers/block/ps2esdi.c renamed from drivers/block/ps2esdi.c.old +0 -42
48 lines not on this page · raw message
drivers/block/rd.c renamed from drivers/block/rd.c.old +2 -2
@@ -77,7 +77,7 @@* architecture-specific setup routine (from the stored boot sector * information). */ -int rd_size =CONFIG_BLK_DEV_RAM_SIZE ;/* Size of the RAM disks */ +static int rd_size =CONFIG_BLK_DEV_RAM_SIZE ;/* Size of the RAM disks */ /* * It would be very desirable to have a soft-blocksize (that in the case * of the ramdisk driver is also the hardblocksize ;) of PAGE_SIZE because
@@ -89,7 +89,7 @@* behaviour. The default is still BLOCK_SIZE (needed by rd_load_image that * supposes the filesystem in the image uses a BLOCK_SIZE blocksize). */ -int rd_blocksize =BLOCK_SIZE ;/* blocksize of the RAM disks */ +static int rd_blocksize =BLOCK_SIZE ;/* blocksize of the RAM disks */ /* * Copyright (C) 2000 Linus Torvalds.
drivers/block/ub.c renamed from drivers/block/ub.c.old +1 -1
@@ -2097,7 +2097,7 @@spin_unlock_irqrestore (&ub_lock, flags); } -struct usb_driver ub_driver = { +static struct usb_driver ub_driver = { .owner =THIS_MODULE , .name ="ub" , .probe = ub_probe,
drivers/block/umem.c renamed from drivers/block/umem.c.old +2 -2
@@ -1181,7 +1181,7 @@----------------------------------------------------------------------------------- */ -int __init mm_init (void ) +static int __init mm_init (void ) {int retval, i;int err;
@@ -1232,7 +1232,7 @@-- mm_cleanup ----------------------------------------------------------------------------------- */ -void __exit mm_cleanup(void) +static void __exit mm_cleanup(void) {int i;
drivers/block/xd.c renamed from drivers/block/xd.c.old +1 -1
@@ -67,7 +67,7 @@/* Above may need to be increased if a problem with the 2nd drive detection (ST11M controller) or resetting a controller (WD) appears */ -XD_INFO xd_info[XD_MAXDRIVES ]; +static XD_INFO xd_info[XD_MAXDRIVES ];/* If you try this driver and find that your card is not detected by the driver at bootup, you need to add your BIOS signature and details to the following list of signatures. A BIOS signature is a string embedded into the first
drivers/block/paride/setup.h deleted +0 -69
69 lines not on this page · raw message