Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: remove unnecessary module_init/exit functions

Many network drivers have unnecessary empty module_init and module_exit
functions. Remove them (including some that just print a message). Note
that if a module_init function exists, a module_exit function must also
exist; otherwise, the module cannot be unloaded.

Signed-off-by: Ethan Nelson-Moore <enelsonmoore@gmail.com>
Acked-by: Marc Kleine-Budde <mkl@pengutronix.de>
Acked-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Acked-by: Toke Høiland-Jørgensen <toke@toke.dk>
Link: https://patch.msgid.link/20260131004327.18112-1-enelsonmoore@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Ethan Nelson-Moore and committed by
Jakub Kicinski
e0221553 14e6cf84

-156
-16
drivers/net/arcnet/com20020.c
··· 401 401 402 402 MODULE_DESCRIPTION("ARCnet COM20020 chipset core driver"); 403 403 MODULE_LICENSE("GPL"); 404 - 405 - #ifdef MODULE 406 - 407 - static int __init com20020_module_init(void) 408 - { 409 - if (BUGLVL(D_NORMAL)) 410 - pr_info("%s\n", "COM20020 chipset support (by David Woodhouse et al.)"); 411 - return 0; 412 - } 413 - 414 - static void __exit com20020_module_exit(void) 415 - { 416 - } 417 - module_init(com20020_module_init); 418 - module_exit(com20020_module_exit); 419 - #endif /* MODULE */
-16
drivers/net/can/sja1000/sja1000.c
··· 705 705 unregister_candev(dev); 706 706 } 707 707 EXPORT_SYMBOL_GPL(unregister_sja1000dev); 708 - 709 - static __init int sja1000_init(void) 710 - { 711 - printk(KERN_INFO "%s CAN netdevice driver\n", DRV_NAME); 712 - 713 - return 0; 714 - } 715 - 716 - module_init(sja1000_init); 717 - 718 - static __exit void sja1000_exit(void) 719 - { 720 - printk(KERN_INFO "%s: driver removed\n", DRV_NAME); 721 - } 722 - 723 - module_exit(sja1000_exit);
-14
drivers/net/ethernet/8390/8390.c
··· 86 86 } 87 87 EXPORT_SYMBOL(NS8390_init); 88 88 89 - #if defined(MODULE) 90 - 91 - static int __init ns8390_module_init(void) 92 - { 93 - return 0; 94 - } 95 - 96 - static void __exit ns8390_module_exit(void) 97 - { 98 - } 99 - 100 - module_init(ns8390_module_init); 101 - module_exit(ns8390_module_exit); 102 - #endif /* MODULE */ 103 89 MODULE_DESCRIPTION("National Semiconductor 8390 core driver"); 104 90 MODULE_LICENSE("GPL");
-11
drivers/net/ethernet/8390/8390p.c
··· 91 91 } 92 92 EXPORT_SYMBOL(NS8390p_init); 93 93 94 - static int __init NS8390p_init_module(void) 95 - { 96 - return 0; 97 - } 98 - 99 - static void __exit NS8390p_cleanup_module(void) 100 - { 101 - } 102 - 103 - module_init(NS8390p_init_module); 104 - module_exit(NS8390p_cleanup_module); 105 94 MODULE_DESCRIPTION("National Semiconductor 8390 core for ISA driver"); 106 95 MODULE_LICENSE("GPL");
-12
drivers/net/ethernet/mellanox/mlxsw/pci.c
··· 2542 2542 } 2543 2543 EXPORT_SYMBOL(mlxsw_pci_driver_unregister); 2544 2544 2545 - static int __init mlxsw_pci_module_init(void) 2546 - { 2547 - return 0; 2548 - } 2549 - 2550 - static void __exit mlxsw_pci_module_exit(void) 2551 - { 2552 - } 2553 - 2554 - module_init(mlxsw_pci_module_init); 2555 - module_exit(mlxsw_pci_module_exit); 2556 - 2557 2545 MODULE_LICENSE("Dual BSD/GPL"); 2558 2546 MODULE_AUTHOR("Jiri Pirko <jiri@mellanox.com>"); 2559 2547 MODULE_DESCRIPTION("Mellanox switch PCI interface driver");
-20
drivers/net/hamradio/hdlcdrv.c
··· 742 742 743 743 /* --------------------------------------------------------------------- */ 744 744 745 - static int __init hdlcdrv_init_driver(void) 746 - { 747 - printk(KERN_INFO "hdlcdrv: (C) 1996-2000 Thomas Sailer HB9JNX/AE4WA\n"); 748 - printk(KERN_INFO "hdlcdrv: version 0.8\n"); 749 - return 0; 750 - } 751 - 752 - /* --------------------------------------------------------------------- */ 753 - 754 - static void __exit hdlcdrv_cleanup_driver(void) 755 - { 756 - printk(KERN_INFO "hdlcdrv: cleanup\n"); 757 - } 758 - 759 - /* --------------------------------------------------------------------- */ 760 - 761 745 MODULE_AUTHOR("Thomas M. Sailer, sailer@ife.ee.ethz.ch, hb9jnx@hb9w.che.eu"); 762 746 MODULE_DESCRIPTION("Packet Radio network interface HDLC encoder/decoder"); 763 747 MODULE_LICENSE("GPL"); 764 - module_init(hdlcdrv_init_driver); 765 - module_exit(hdlcdrv_cleanup_driver); 766 - 767 - /* --------------------------------------------------------------------- */
-13
drivers/net/net_failover.c
··· 819 819 } 820 820 EXPORT_SYMBOL_GPL(net_failover_destroy); 821 821 822 - static __init int 823 - net_failover_init(void) 824 - { 825 - return 0; 826 - } 827 - module_init(net_failover_init); 828 - 829 - static __exit 830 - void net_failover_exit(void) 831 - { 832 - } 833 - module_exit(net_failover_exit); 834 - 835 822 MODULE_DESCRIPTION("Failover driver for Paravirtual drivers"); 836 823 MODULE_LICENSE("GPL v2");
-12
drivers/net/wireless/ath/ath9k/common.c
··· 403 403 ath_hw_keyreset(common, (u16) i); 404 404 } 405 405 EXPORT_SYMBOL(ath9k_cmn_init_crypto); 406 - 407 - static int __init ath9k_cmn_init(void) 408 - { 409 - return 0; 410 - } 411 - module_init(ath9k_cmn_init); 412 - 413 - static void __exit ath9k_cmn_exit(void) 414 - { 415 - return; 416 - } 417 - module_exit(ath9k_cmn_exit);
-13
drivers/net/wireless/realtek/rtlwifi/btcoexist/rtl_btc.c
··· 519 519 MODULE_AUTHOR("Larry Finger <Larry.FInger@lwfinger.net>"); 520 520 MODULE_LICENSE("GPL"); 521 521 MODULE_DESCRIPTION("Realtek 802.11n PCI wireless core"); 522 - 523 - static int __init rtl_btcoexist_module_init(void) 524 - { 525 - return 0; 526 - } 527 - 528 - static void __exit rtl_btcoexist_module_exit(void) 529 - { 530 - return; 531 - } 532 - 533 - module_init(rtl_btcoexist_module_init); 534 - module_exit(rtl_btcoexist_module_exit);
-29
drivers/net/wireless/rsi/rsi_91x_main.c
··· 425 425 } 426 426 EXPORT_SYMBOL_GPL(rsi_91x_deinit); 427 427 428 - /** 429 - * rsi_91x_hal_module_init() - This function is invoked when the module is 430 - * loaded into the kernel. 431 - * It registers the client driver. 432 - * @void: Void. 433 - * 434 - * Return: 0 on success, -1 on failure. 435 - */ 436 - static int rsi_91x_hal_module_init(void) 437 - { 438 - rsi_dbg(INIT_ZONE, "%s: Module init called\n", __func__); 439 - return 0; 440 - } 441 - 442 - /** 443 - * rsi_91x_hal_module_exit() - This function is called at the time of 444 - * removing/unloading the module. 445 - * It unregisters the client driver. 446 - * @void: Void. 447 - * 448 - * Return: None. 449 - */ 450 - static void rsi_91x_hal_module_exit(void) 451 - { 452 - rsi_dbg(INIT_ZONE, "%s: Module exit called\n", __func__); 453 - } 454 - 455 - module_init(rsi_91x_hal_module_init); 456 - module_exit(rsi_91x_hal_module_exit); 457 428 MODULE_AUTHOR("Redpine Signals Inc"); 458 429 MODULE_DESCRIPTION("Station driver for RSI 91x devices"); 459 430 MODULE_VERSION("0.1");