Delete redundant init_module and cleanup_module prototypes.
Subsystems (3)
PATCH 1/1 Delete redundant init_module and cleanup_module prototypes.
Linus, please apply.
A few places pre-declare "int module_init(void);" and "void module_cleanup(void);". Other than being obsolete, this is unneccessary (it's in init.h anyway).
There are still about 100 places which still use the obsolete-since-2.2 "a function named module_init() magically gets called": this change frees us up implement that via a macro.
Name: Delete redundant init_module and cleanup_module prototypes.
Author: Rusty Russell
Status: Trivial
D: A few places pre-declare "int module_init(void);" and "void
D: module_cleanup(void);". Other than being obsolete, this is
D: unneccessary (it's in init.h anyway).
D:
D: There are still about 100 places which still use the
D: obsolete-since-2.2 "a function named module_init() magically gets
D: called": this change frees us up implement that via a macro.
drivers/block/paride/pf.c +0 -3
@@ -222,9 +222,6 @@ MODULE_PARM(drive3, "1-7i");#define ATAPI_READ_10 0x28#define ATAPI_WRITE_10 0x2a -#ifdef MODULE -void cleanup_module (void ); -#endif static int pf_open (struct inode *inode,struct file *file);static void do_pf_request (request_queue_t * q); static int pf_ioctl(struct inode *inode, struct file *file,
drivers/char/istallion.c +0 -2
@@ -650,8 +650,6 @@ static unsigned int stli_baudrates[] = {*/ #ifdef MODULE -int init_module (void ); -void cleanup_module (void );static void stli_argbrds (void );static int stli_parsebrd (stlconf_t *confp,char **argp);
drivers/char/moxa.c +1 -4
@@ -216,10 +216,7 @@ static struct timer_list moxaEmptyTimer[static struct semaphore moxaBuffSem;int moxa_init (void ); -#ifdef MODULE -int init_module (void ); -void cleanup_module (void ); -#endif +/* * static functions: */
drivers/char/nwbutton.h +0 -4
@@ -32,10 +32,6 @@ int button_init (void);int button_add_callback (void (*callback) (void ),int count);int button_del_callback (void (*callback) (void ));static void button_consume_callbacks (int bpcount); -#ifdef MODULE -int init_module (void ); -void cleanup_module (void ); -#endif /* MODULE */ #else /* Not compiling the driver itself */
drivers/char/pcxx.c +7 -9
@@ -209,17 +209,9 @@ static void cleanup_board_resources(void#ifdef MODULE -/* -* pcxe_init() is our init_module(): -*/ -#define pcxe_init init_module - -void cleanup_module (void ); - -/*****************************************************************************/ -void cleanup_module () +static void pcxe_cleanup () {unsigned long flags;
@@ -240,6 +232,12 @@ void cleanup_module()kfree (digi_channels); restore_flags(flags); } + +/* +* pcxe_init() is our init_module(): +*/ +module_init (pcxe_init); +module_cleanup (pcxe_cleanup);#endif static inline struct channel *chan (registerstruct tty_struct *tty)
drivers/char/stallion.c +0 -2
@@ -472,8 +472,6 @@ static unsigned int stl_baudrates[] = {*/ #ifdef MODULE -int init_module (void ); -void cleanup_module (void );static void stl_argbrds (void );static int stl_parsebrd (stlconf_t *confp,char **argp);
drivers/net/wan/sdladrv.c +4 -9
@@ -160,10 +160,6 @@/****** Function Prototypes *************************************************/ -/* Module entry points. These are called by the OS and must be public. */ -int init_module (void ); -void cleanup_module (void ); -/* Hardware-specific functions */ static int sdla_detect (sdlahw_t * hw);static int sdla_autodpm (sdlahw_t * hw);
@@ -325,11 +321,7 @@ static int pci_slot_ar[MAX_S514_CARDS];* Context: process */ -#ifdef MODULE -int init_module (void) -#else int sdladrv_init (void ) -#endif {int i=0 ;
@@ -354,9 +346,12 @@ int sdladrv_init(void)* Module 'remove' entry point. * o release all remaining system resources */ -void cleanup_module (void ) +static void sdladrv_cleanup (void ) { } + +module_init (sdladrv_init); +module_cleanup (sdladrv_cleanup);#endif /******* Kernel APIs ********************************************************/
drivers/net/wan/sdlamain.c +3 -9
@@ -177,10 +177,6 @@ static void dbg_kfree(void * v, int lineextern void disable_irq (unsigned int );extern void enable_irq (unsigned int ); -/* Module entry points */ -int init_module (void ); -void cleanup_module (void ); -/* WAN link driver entry points */ static int setup (struct wan_device * wandev,wandev_conf_t * conf);static int shutdown (struct wan_device * wandev);
@@ -246,11 +242,7 @@ static int wanpipe_bh_critical=0;* Context: process */ -#ifdef MODULE -int init_module (void) -#else int wanpipe_init (void ) -#endif {int cnt, err =0 ;
@@ -313,7 +305,7 @@ int wanpipe_init(void)* o unregister all adapters from the WAN router * o release all remaining system resources */ -void cleanup_module (void ) +static void wanpipe_cleanup (void ) {int i;
@@ -329,6 +321,8 @@ void cleanup_module (void) printk(KERN_INFO "\nwanpipe: WANPIPE Modules Unloaded.\n"); } +module_init (wanpipe_init); +module_exit (wanpipe_cleanup);#endif /******* WAN Device Driver Entry Points *************************************/
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.