Skip to content

Commit

Permalink
main: rename 'mod_init' & 'mod_exit' functions to be module-specific
Browse files Browse the repository at this point in the history
Rename module_init & module_exit functions that are named
"mod_init" and "mod_exit" so that they are unique in both the
System.map file and in initcall_debug output instead of showing
up as almost anonymous "mod_init".

This is helpful for debugging and in determining how long certain
module_init calls take to execute.

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Change-Id: Ia6e682a94f04e674cc585381e1260511964e9dac
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
(cherry picked from commit 7bcbfd420a17a7fe71cc0cde86217bbc8712ffd6)
Signed-off-by: TogoFire <togofire@mailfence.com>
  • Loading branch information
rddunlap authored and TogoFire committed Jun 9, 2023
1 parent 19bbc23 commit 9a097cd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/net/wireguard/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <linux/genetlink.h>
#include <net/rtnetlink.h>

static int __init mod_init(void)
static int __init wg_mod_init(void)
{
int ret;

Expand Down Expand Up @@ -66,16 +66,16 @@ static int __init mod_init(void)
return ret;
}

static void __exit mod_exit(void)
static void __exit wg_mod_exit(void)
{
wg_genetlink_uninit();
wg_device_uninit();
wg_peer_uninit();
wg_allowedips_slab_uninit();
}

module_init(mod_init);
module_exit(mod_exit);
module_init(wg_mod_init);
module_exit(wg_mod_exit);
MODULE_LICENSE("GPL v2");
MODULE_DESCRIPTION("WireGuard secure network tunnel");
MODULE_AUTHOR("Jason A. Donenfeld <Jason@zx2c4.com>");
Expand Down

0 comments on commit 9a097cd

Please sign in to comment.