Development discussion of WireGuard
 help / color / mirror / Atom feed
* [PATCH 0/6 v2] treewide: rename 'mod_init' & 'mod_exit' functions to be module-specific
@ 2021-07-11 22:31 Randy Dunlap
  2021-07-11 22:31 ` [PATCH 2/6 v2] hw_random: " Randy Dunlap
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Randy Dunlap @ 2021-07-11 22:31 UTC (permalink / raw)
  To: linux-kernel
  Cc: Randy Dunlap, Jason A . Donenfeld, Russell King,
	linux-arm-kernel, Arnd Bergmann, Greg Kroah-Hartman,
	Andres Salomon, linux-geode, Matt Mackall, Herbert Xu,
	linux-crypto, Christian Gromm, Krzysztof Halasa, netdev,
	David S. Miller, Jakub Kicinski, Martin Schiller, linux-x25,
	wireguard

There are multiple (16) modules which use a module_init() function
with the name 'mod_init' and a module_exit() function with the name
'mod_exit'. This can lead to confusion or ambiguity when reading
crashes/oops/bugs etc. and when reading an initcall_debug log.

Example 1: (System.map file)

ffffffff83446d10 t mod_init
ffffffff83446d18 t mod_init
ffffffff83446d20 t mod_init
...
ffffffff83454665 t mod_init
ffffffff834548a4 t mod_init
ffffffff83454a53 t mod_init
...
ffffffff8345bd42 t mod_init
...
ffffffff8345c916 t mod_init
ffffffff8345c92a t mod_init
ffffffff8345c93e t mod_init
ffffffff8345c952 t mod_init
ffffffff8345c966 t mod_init
...
ffffffff834672c9 t mod_init

Example 2: (boot log when using 'initcall_debug')

[    0.252157] initcall mod_init+0x0/0x8 returned 0 after 0 usecs
[    0.252180] initcall mod_init+0x0/0x8 returned 0 after 0 usecs
[    0.252202] initcall mod_init+0x0/0x8 returned 0 after 0 usecs
...
[    0.892907] initcall mod_init+0x0/0x23f returned -19 after 104 usecs
[    0.913788] initcall mod_init+0x0/0x1af returned -19 after 9 usecs
[    0.934353] initcall mod_init+0x0/0x49 returned -19 after 0 usecs
...
[    1.454870] initcall mod_init+0x0/0x66 returned 0 after 72 usecs
...
[    1.455527] initcall mod_init+0x0/0x14 returned 0 after 0 usecs
[    1.455531] initcall mod_init+0x0/0x14 returned 0 after 0 usecs
[    1.455536] initcall mod_init+0x0/0x14 returned 0 after 0 usecs
[    1.455541] initcall mod_init+0x0/0x14 returned 0 after 0 usecs
[    1.455545] initcall mod_init+0x0/0x52 returned 0 after 0 usecs
...
[    1.588162] initcall mod_init+0x0/0xef returned 0 after 45 usecs


v2: wireguard: changes per Jason
    arm/crypto/curve25519-glue: add Russell's Acked-by

Cc: Jason A. Donenfeld <Jason@zx2c4.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: linux-arm-kernel@lists.infradead.org
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Andres Salomon <dilinger@queued.net>
Cc: linux-geode@lists.infradead.org
Cc: Matt Mackall <mpm@selenic.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: linux-crypto@vger.kernel.org
Cc: Christian Gromm <christian.gromm@microchip.com>
Cc: Krzysztof Halasa <khc@pm.waw.pl>
Cc: netdev@vger.kernel.org
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Martin Schiller <ms@dev.tdt.de>
Cc: linux-x25@vger.kernel.org
Cc: wireguard@lists.zx2c4.com

[PATCH 1/6 v2] arm: crypto: rename 'mod_init' & 'mod_exit' functions to be module-specific
[PATCH 2/6 v2] hw_random: rename 'mod_init' & 'mod_exit' functions to be module-specific
[PATCH 3/6 v2] lib: crypto: rename 'mod_init' & 'mod_exit' functions to be module-specific
[PATCH 4/6 v2] MOST: cdev: rename 'mod_init' & 'mod_exit' functions to be module-specific
[PATCH 5/6 v2] net: hdlc: rename 'mod_init' & 'mod_exit' functions to be module-specific
[PATCH 6/6 v2] net: wireguard: rename 'mod_init' & 'mod_exit' functions to be module-specific

 arch/arm/crypto/curve25519-glue.c  |    8 ++++----
 drivers/char/hw_random/amd-rng.c   |    8 ++++----
 drivers/char/hw_random/geode-rng.c |    8 ++++----
 drivers/char/hw_random/intel-rng.c |    8 ++++----
 drivers/char/hw_random/via-rng.c   |    8 ++++----
 drivers/most/most_cdev.c           |    8 ++++----
 drivers/net/wan/hdlc_cisco.c       |    8 ++++----
 drivers/net/wan/hdlc_fr.c          |    8 ++++----
 drivers/net/wan/hdlc_ppp.c         |    8 ++++----
 drivers/net/wan/hdlc_raw.c         |    8 ++++----
 drivers/net/wan/hdlc_raw_eth.c     |    8 ++++----
 drivers/net/wan/hdlc_x25.c         |    8 ++++----
 drivers/net/wireguard/main.c       |    8 ++++----
 lib/crypto/blake2s.c               |    8 ++++----
 lib/crypto/chacha20poly1305.c      |    8 ++++----
 lib/crypto/curve25519.c            |    8 ++++----
 16 files changed, 64 insertions(+), 64 deletions(-)

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 2/6 v2] hw_random: rename 'mod_init' & 'mod_exit' functions to be module-specific
  2021-07-11 22:31 [PATCH 0/6 v2] treewide: rename 'mod_init' & 'mod_exit' functions to be module-specific Randy Dunlap
@ 2021-07-11 22:31 ` Randy Dunlap
  2021-07-11 22:31 ` [PATCH 3/6 v2] lib: crypto: " Randy Dunlap
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Randy Dunlap @ 2021-07-11 22:31 UTC (permalink / raw)
  To: linux-kernel
  Cc: Randy Dunlap, Jason A . Donenfeld, Russell King,
	linux-arm-kernel, Arnd Bergmann, Greg Kroah-Hartman,
	Andres Salomon, linux-geode, Matt Mackall, Herbert Xu,
	linux-crypto, Christian Gromm, Krzysztof Halasa, netdev,
	David S. Miller, Jakub Kicinski, Martin Schiller, linux-x25,
	wireguard

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>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Andres Salomon <dilinger@queued.net>
Cc: linux-geode@lists.infradead.org
Cc: Matt Mackall <mpm@selenic.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: linux-crypto@vger.kernel.org
Cc: Jason A. Donenfeld <Jason@zx2c4.com>
---
v2: no change

 drivers/char/hw_random/amd-rng.c   |    8 ++++----
 drivers/char/hw_random/geode-rng.c |    8 ++++----
 drivers/char/hw_random/intel-rng.c |    8 ++++----
 drivers/char/hw_random/via-rng.c   |    8 ++++----
 4 files changed, 16 insertions(+), 16 deletions(-)

--- linux-next-20210708.orig/drivers/char/hw_random/amd-rng.c
+++ linux-next-20210708/drivers/char/hw_random/amd-rng.c
@@ -124,7 +124,7 @@ static struct hwrng amd_rng = {
 	.read		= amd_rng_read,
 };
 
-static int __init mod_init(void)
+static int __init amd_rng_mod_init(void)
 {
 	int err;
 	struct pci_dev *pdev = NULL;
@@ -188,7 +188,7 @@ out:
 	return err;
 }
 
-static void __exit mod_exit(void)
+static void __exit amd_rng_mod_exit(void)
 {
 	struct amd768_priv *priv;
 
@@ -203,8 +203,8 @@ static void __exit mod_exit(void)
 	kfree(priv);
 }
 
-module_init(mod_init);
-module_exit(mod_exit);
+module_init(amd_rng_mod_init);
+module_exit(amd_rng_mod_exit);
 
 MODULE_AUTHOR("The Linux Kernel team");
 MODULE_DESCRIPTION("H/W RNG driver for AMD chipsets");
--- linux-next-20210708.orig/drivers/char/hw_random/geode-rng.c
+++ linux-next-20210708/drivers/char/hw_random/geode-rng.c
@@ -83,7 +83,7 @@ static struct hwrng geode_rng = {
 };
 
 
-static int __init mod_init(void)
+static int __init geode_rng_init(void)
 {
 	int err = -ENODEV;
 	struct pci_dev *pdev = NULL;
@@ -124,7 +124,7 @@ err_unmap:
 	goto out;
 }
 
-static void __exit mod_exit(void)
+static void __exit geode_rng_exit(void)
 {
 	void __iomem *mem = (void __iomem *)geode_rng.priv;
 
@@ -132,8 +132,8 @@ static void __exit mod_exit(void)
 	iounmap(mem);
 }
 
-module_init(mod_init);
-module_exit(mod_exit);
+module_init(geode_rng_init);
+module_exit(geode_rng_exit);
 
 MODULE_DESCRIPTION("H/W RNG driver for AMD Geode LX CPUs");
 MODULE_LICENSE("GPL");
--- linux-next-20210708.orig/drivers/char/hw_random/intel-rng.c
+++ linux-next-20210708/drivers/char/hw_random/intel-rng.c
@@ -325,7 +325,7 @@ PFX "RNG, try using the 'no_fwh_detect'
 }
 
 
-static int __init mod_init(void)
+static int __init intel_rng_mod_init(void)
 {
 	int err = -ENODEV;
 	int i;
@@ -403,7 +403,7 @@ out:
 
 }
 
-static void __exit mod_exit(void)
+static void __exit intel_rng_mod_exit(void)
 {
 	void __iomem *mem = (void __iomem *)intel_rng.priv;
 
@@ -411,8 +411,8 @@ static void __exit mod_exit(void)
 	iounmap(mem);
 }
 
-module_init(mod_init);
-module_exit(mod_exit);
+module_init(intel_rng_mod_init);
+module_exit(intel_rng_mod_exit);
 
 MODULE_DESCRIPTION("H/W RNG driver for Intel chipsets");
 MODULE_LICENSE("GPL");
--- linux-next-20210708.orig/drivers/char/hw_random/via-rng.c
+++ linux-next-20210708/drivers/char/hw_random/via-rng.c
@@ -192,7 +192,7 @@ static struct hwrng via_rng = {
 };
 
 
-static int __init mod_init(void)
+static int __init via_rng_mod_init(void)
 {
 	int err;
 
@@ -209,13 +209,13 @@ static int __init mod_init(void)
 out:
 	return err;
 }
-module_init(mod_init);
+module_init(via_rng_mod_init);
 
-static void __exit mod_exit(void)
+static void __exit via_rng_mod_exit(void)
 {
 	hwrng_unregister(&via_rng);
 }
-module_exit(mod_exit);
+module_exit(via_rng_mod_exit);
 
 static struct x86_cpu_id __maybe_unused via_rng_cpu_id[] = {
 	X86_MATCH_FEATURE(X86_FEATURE_XSTORE, NULL),

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 3/6 v2] lib: crypto: rename 'mod_init' & 'mod_exit' functions to be module-specific
  2021-07-11 22:31 [PATCH 0/6 v2] treewide: rename 'mod_init' & 'mod_exit' functions to be module-specific Randy Dunlap
  2021-07-11 22:31 ` [PATCH 2/6 v2] hw_random: " Randy Dunlap
@ 2021-07-11 22:31 ` Randy Dunlap
  2021-07-11 22:31 ` [PATCH 4/6 v2] MOST: cdev: " Randy Dunlap
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Randy Dunlap @ 2021-07-11 22:31 UTC (permalink / raw)
  To: linux-kernel
  Cc: Randy Dunlap, Jason A . Donenfeld, Russell King,
	linux-arm-kernel, Arnd Bergmann, Greg Kroah-Hartman,
	Andres Salomon, linux-geode, Matt Mackall, Herbert Xu,
	linux-crypto, Christian Gromm, Krzysztof Halasa, netdev,
	David S. Miller, Jakub Kicinski, Martin Schiller, linux-x25,
	wireguard

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>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: linux-crypto@vger.kernel.org
Cc: Jason A. Donenfeld <Jason@zx2c4.com>
---
v2: no change

 lib/crypto/blake2s.c          |    8 ++++----
 lib/crypto/chacha20poly1305.c |    8 ++++----
 lib/crypto/curve25519.c       |    8 ++++----
 3 files changed, 12 insertions(+), 12 deletions(-)

--- linux-next-20210708.orig/lib/crypto/blake2s.c
+++ linux-next-20210708/lib/crypto/blake2s.c
@@ -73,7 +73,7 @@ void blake2s256_hmac(u8 *out, const u8 *
 }
 EXPORT_SYMBOL(blake2s256_hmac);
 
-static int __init mod_init(void)
+static int __init blake2s_mod_init(void)
 {
 	if (!IS_ENABLED(CONFIG_CRYPTO_MANAGER_DISABLE_TESTS) &&
 	    WARN_ON(!blake2s_selftest()))
@@ -81,12 +81,12 @@ static int __init mod_init(void)
 	return 0;
 }
 
-static void __exit mod_exit(void)
+static void __exit blake2s_mod_exit(void)
 {
 }
 
-module_init(mod_init);
-module_exit(mod_exit);
+module_init(blake2s_mod_init);
+module_exit(blake2s_mod_exit);
 MODULE_LICENSE("GPL v2");
 MODULE_DESCRIPTION("BLAKE2s hash function");
 MODULE_AUTHOR("Jason A. Donenfeld <Jason@zx2c4.com>");
--- linux-next-20210708.orig/lib/crypto/chacha20poly1305.c
+++ linux-next-20210708/lib/crypto/chacha20poly1305.c
@@ -354,7 +354,7 @@ bool chacha20poly1305_decrypt_sg_inplace
 }
 EXPORT_SYMBOL(chacha20poly1305_decrypt_sg_inplace);
 
-static int __init mod_init(void)
+static int __init chacha20poly1305_init(void)
 {
 	if (!IS_ENABLED(CONFIG_CRYPTO_MANAGER_DISABLE_TESTS) &&
 	    WARN_ON(!chacha20poly1305_selftest()))
@@ -362,12 +362,12 @@ static int __init mod_init(void)
 	return 0;
 }
 
-static void __exit mod_exit(void)
+static void __exit chacha20poly1305_exit(void)
 {
 }
 
-module_init(mod_init);
-module_exit(mod_exit);
+module_init(chacha20poly1305_init);
+module_exit(chacha20poly1305_exit);
 MODULE_LICENSE("GPL v2");
 MODULE_DESCRIPTION("ChaCha20Poly1305 AEAD construction");
 MODULE_AUTHOR("Jason A. Donenfeld <Jason@zx2c4.com>");
--- linux-next-20210708.orig/lib/crypto/curve25519.c
+++ linux-next-20210708/lib/crypto/curve25519.c
@@ -13,7 +13,7 @@
 #include <linux/module.h>
 #include <linux/init.h>
 
-static int __init mod_init(void)
+static int __init curve25519_init(void)
 {
 	if (!IS_ENABLED(CONFIG_CRYPTO_MANAGER_DISABLE_TESTS) &&
 	    WARN_ON(!curve25519_selftest()))
@@ -21,12 +21,12 @@ static int __init mod_init(void)
 	return 0;
 }
 
-static void __exit mod_exit(void)
+static void __exit curve25519_exit(void)
 {
 }
 
-module_init(mod_init);
-module_exit(mod_exit);
+module_init(curve25519_init);
+module_exit(curve25519_exit);
 
 MODULE_LICENSE("GPL v2");
 MODULE_DESCRIPTION("Curve25519 scalar multiplication");

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 4/6 v2] MOST: cdev: rename 'mod_init' & 'mod_exit' functions to be module-specific
  2021-07-11 22:31 [PATCH 0/6 v2] treewide: rename 'mod_init' & 'mod_exit' functions to be module-specific Randy Dunlap
  2021-07-11 22:31 ` [PATCH 2/6 v2] hw_random: " Randy Dunlap
  2021-07-11 22:31 ` [PATCH 3/6 v2] lib: crypto: " Randy Dunlap
@ 2021-07-11 22:31 ` Randy Dunlap
  2021-07-11 22:31 ` [PATCH 5/6 v2] net: hdlc: " Randy Dunlap
  2021-07-11 22:31 ` [PATCH 6/6 v2] wireguard: main: " Randy Dunlap
  4 siblings, 0 replies; 7+ messages in thread
From: Randy Dunlap @ 2021-07-11 22:31 UTC (permalink / raw)
  To: linux-kernel
  Cc: Randy Dunlap, Jason A . Donenfeld, Russell King,
	linux-arm-kernel, Arnd Bergmann, Greg Kroah-Hartman,
	Andres Salomon, linux-geode, Matt Mackall, Herbert Xu,
	linux-crypto, Christian Gromm, Krzysztof Halasa, netdev,
	David S. Miller, Jakub Kicinski, Martin Schiller, linux-x25,
	wireguard

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>
Cc: Christian Gromm <christian.gromm@microchip.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
v2: no change

 drivers/most/most_cdev.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

--- linux-next-20210708.orig/drivers/most/most_cdev.c
+++ linux-next-20210708/drivers/most/most_cdev.c
@@ -486,7 +486,7 @@ static struct cdev_component comp = {
 	},
 };
 
-static int __init mod_init(void)
+static int __init most_cdev_init(void)
 {
 	int err;
 
@@ -518,7 +518,7 @@ dest_ida:
 	return err;
 }
 
-static void __exit mod_exit(void)
+static void __exit most_cdev_exit(void)
 {
 	struct comp_channel *c, *tmp;
 
@@ -534,8 +534,8 @@ static void __exit mod_exit(void)
 	class_destroy(comp.class);
 }
 
-module_init(mod_init);
-module_exit(mod_exit);
+module_init(most_cdev_init);
+module_exit(most_cdev_exit);
 MODULE_AUTHOR("Christian Gromm <christian.gromm@microchip.com>");
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("character device component for mostcore");

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 5/6 v2] net: hdlc: rename 'mod_init' & 'mod_exit' functions to be module-specific
  2021-07-11 22:31 [PATCH 0/6 v2] treewide: rename 'mod_init' & 'mod_exit' functions to be module-specific Randy Dunlap
                   ` (2 preceding siblings ...)
  2021-07-11 22:31 ` [PATCH 4/6 v2] MOST: cdev: " Randy Dunlap
@ 2021-07-11 22:31 ` Randy Dunlap
  2021-07-11 22:31 ` [PATCH 6/6 v2] wireguard: main: " Randy Dunlap
  4 siblings, 0 replies; 7+ messages in thread
From: Randy Dunlap @ 2021-07-11 22:31 UTC (permalink / raw)
  To: linux-kernel
  Cc: Randy Dunlap, Jason A . Donenfeld, Russell King,
	linux-arm-kernel, Arnd Bergmann, Greg Kroah-Hartman,
	Andres Salomon, linux-geode, Matt Mackall, Herbert Xu,
	linux-crypto, Christian Gromm, Krzysztof Halasa, netdev,
	David S. Miller, Jakub Kicinski, Martin Schiller, linux-x25,
	wireguard

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>
Cc: Krzysztof Halasa <khc@pm.waw.pl>
Cc: netdev@vger.kernel.org
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Martin Schiller <ms@dev.tdt.de>
Cc: linux-x25@vger.kernel.org
---
v2: no change

 drivers/net/wan/hdlc_cisco.c   |    8 ++++----
 drivers/net/wan/hdlc_fr.c      |    8 ++++----
 drivers/net/wan/hdlc_ppp.c     |    8 ++++----
 drivers/net/wan/hdlc_raw.c     |    8 ++++----
 drivers/net/wan/hdlc_raw_eth.c |    8 ++++----
 drivers/net/wan/hdlc_x25.c     |    8 ++++----
 6 files changed, 24 insertions(+), 24 deletions(-)

--- linux-next-20210708.orig/drivers/net/wan/hdlc_cisco.c
+++ linux-next-20210708/drivers/net/wan/hdlc_cisco.c
@@ -364,19 +364,19 @@ static int cisco_ioctl(struct net_device
 	return -EINVAL;
 }
 
-static int __init mod_init(void)
+static int __init hdlc_cisco_init(void)
 {
 	register_hdlc_protocol(&proto);
 	return 0;
 }
 
-static void __exit mod_exit(void)
+static void __exit hdlc_cisco_exit(void)
 {
 	unregister_hdlc_protocol(&proto);
 }
 
-module_init(mod_init);
-module_exit(mod_exit);
+module_init(hdlc_cisco_init);
+module_exit(hdlc_cisco_exit);
 
 MODULE_AUTHOR("Krzysztof Halasa <khc@pm.waw.pl>");
 MODULE_DESCRIPTION("Cisco HDLC protocol support for generic HDLC");
--- linux-next-20210708.orig/drivers/net/wan/hdlc_fr.c
+++ linux-next-20210708/drivers/net/wan/hdlc_fr.c
@@ -1279,19 +1279,19 @@ static int fr_ioctl(struct net_device *d
 	return -EINVAL;
 }
 
-static int __init mod_init(void)
+static int __init hdlc_fr_init(void)
 {
 	register_hdlc_protocol(&proto);
 	return 0;
 }
 
-static void __exit mod_exit(void)
+static void __exit hdlc_fr_exit(void)
 {
 	unregister_hdlc_protocol(&proto);
 }
 
-module_init(mod_init);
-module_exit(mod_exit);
+module_init(hdlc_fr_init);
+module_exit(hdlc_fr_exit);
 
 MODULE_AUTHOR("Krzysztof Halasa <khc@pm.waw.pl>");
 MODULE_DESCRIPTION("Frame-Relay protocol support for generic HDLC");
--- linux-next-20210708.orig/drivers/net/wan/hdlc_ppp.c
+++ linux-next-20210708/drivers/net/wan/hdlc_ppp.c
@@ -705,20 +705,20 @@ static int ppp_ioctl(struct net_device *
 	return -EINVAL;
 }
 
-static int __init mod_init(void)
+static int __init hdlc_ppp_init(void)
 {
 	skb_queue_head_init(&tx_queue);
 	register_hdlc_protocol(&proto);
 	return 0;
 }
 
-static void __exit mod_exit(void)
+static void __exit hdlc_ppp_exit(void)
 {
 	unregister_hdlc_protocol(&proto);
 }
 
-module_init(mod_init);
-module_exit(mod_exit);
+module_init(hdlc_ppp_init);
+module_exit(hdlc_ppp_exit);
 
 MODULE_AUTHOR("Krzysztof Halasa <khc@pm.waw.pl>");
 MODULE_DESCRIPTION("PPP protocol support for generic HDLC");
--- linux-next-20210708.orig/drivers/net/wan/hdlc_raw.c
+++ linux-next-20210708/drivers/net/wan/hdlc_raw.c
@@ -90,7 +90,7 @@ static int raw_ioctl(struct net_device *
 }
 
 
-static int __init mod_init(void)
+static int __init hdlc_raw_init(void)
 {
 	register_hdlc_protocol(&proto);
 	return 0;
@@ -98,14 +98,14 @@ static int __init mod_init(void)
 
 
 
-static void __exit mod_exit(void)
+static void __exit hdlc_raw_exit(void)
 {
 	unregister_hdlc_protocol(&proto);
 }
 
 
-module_init(mod_init);
-module_exit(mod_exit);
+module_init(hdlc_raw_init);
+module_exit(hdlc_raw_exit);
 
 MODULE_AUTHOR("Krzysztof Halasa <khc@pm.waw.pl>");
 MODULE_DESCRIPTION("Raw HDLC protocol support for generic HDLC");
--- linux-next-20210708.orig/drivers/net/wan/hdlc_raw_eth.c
+++ linux-next-20210708/drivers/net/wan/hdlc_raw_eth.c
@@ -110,7 +110,7 @@ static int raw_eth_ioctl(struct net_devi
 }
 
 
-static int __init mod_init(void)
+static int __init hdlc_eth_init(void)
 {
 	register_hdlc_protocol(&proto);
 	return 0;
@@ -118,14 +118,14 @@ static int __init mod_init(void)
 
 
 
-static void __exit mod_exit(void)
+static void __exit hdlc_eth_exit(void)
 {
 	unregister_hdlc_protocol(&proto);
 }
 
 
-module_init(mod_init);
-module_exit(mod_exit);
+module_init(hdlc_eth_init);
+module_exit(hdlc_eth_exit);
 
 MODULE_AUTHOR("Krzysztof Halasa <khc@pm.waw.pl>");
 MODULE_DESCRIPTION("Ethernet encapsulation support for generic HDLC");
--- linux-next-20210708.orig/drivers/net/wan/hdlc_x25.c
+++ linux-next-20210708/drivers/net/wan/hdlc_x25.c
@@ -365,19 +365,19 @@ static int x25_ioctl(struct net_device *
 	return -EINVAL;
 }
 
-static int __init mod_init(void)
+static int __init hdlc_x25_init(void)
 {
 	register_hdlc_protocol(&proto);
 	return 0;
 }
 
-static void __exit mod_exit(void)
+static void __exit hdlc_x25_exit(void)
 {
 	unregister_hdlc_protocol(&proto);
 }
 
-module_init(mod_init);
-module_exit(mod_exit);
+module_init(hdlc_x25_init);
+module_exit(hdlc_x25_exit);
 
 MODULE_AUTHOR("Krzysztof Halasa <khc@pm.waw.pl>");
 MODULE_DESCRIPTION("X.25 protocol support for generic HDLC");

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 6/6 v2] wireguard: main: rename 'mod_init' & 'mod_exit' functions to be module-specific
  2021-07-11 22:31 [PATCH 0/6 v2] treewide: rename 'mod_init' & 'mod_exit' functions to be module-specific Randy Dunlap
                   ` (3 preceding siblings ...)
  2021-07-11 22:31 ` [PATCH 5/6 v2] net: hdlc: " Randy Dunlap
@ 2021-07-11 22:31 ` Randy Dunlap
  2021-08-08 20:22   ` Jason A. Donenfeld
  4 siblings, 1 reply; 7+ messages in thread
From: Randy Dunlap @ 2021-07-11 22:31 UTC (permalink / raw)
  To: linux-kernel
  Cc: Randy Dunlap, Jason A . Donenfeld, Russell King,
	linux-arm-kernel, Arnd Bergmann, Greg Kroah-Hartman,
	Andres Salomon, linux-geode, Matt Mackall, Herbert Xu,
	linux-crypto, Christian Gromm, Krzysztof Halasa, netdev,
	David S. Miller, Jakub Kicinski, Martin Schiller, linux-x25,
	wireguard

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>
Cc: Jason A. Donenfeld <Jason@zx2c4.com>
Cc: wireguard@lists.zx2c4.com
Cc: netdev@vger.kernel.org
---
v2: change Subject: prefixes and function names (thanks, Jason)

 drivers/net/wireguard/main.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

--- linux-next-20210708.orig/drivers/net/wireguard/main.c
+++ linux-next-20210708/drivers/net/wireguard/main.c
@@ -17,7 +17,7 @@
 #include <linux/genetlink.h>
 #include <net/rtnetlink.h>
 
-static int __init mod_init(void)
+static int __init wg_mod_init(void)
 {
 	int ret;
 
@@ -60,7 +60,7 @@ err_allowedips:
 	return ret;
 }
 
-static void __exit mod_exit(void)
+static void __exit wg_mod_exit(void)
 {
 	wg_genetlink_uninit();
 	wg_device_uninit();
@@ -68,8 +68,8 @@ static void __exit mod_exit(void)
 	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>");

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 6/6 v2] wireguard: main: rename 'mod_init' & 'mod_exit' functions to be module-specific
  2021-07-11 22:31 ` [PATCH 6/6 v2] wireguard: main: " Randy Dunlap
@ 2021-08-08 20:22   ` Jason A. Donenfeld
  0 siblings, 0 replies; 7+ messages in thread
From: Jason A. Donenfeld @ 2021-08-08 20:22 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: LKML, Russell King, linux-arm-kernel, Arnd Bergmann,
	Greg Kroah-Hartman, Andres Salomon, linux-geode, Matt Mackall,
	Herbert Xu, Linux Crypto Mailing List, Christian Gromm,
	Krzysztof Halasa, Netdev, David S. Miller, Jakub Kicinski,
	Martin Schiller, linux-x25, WireGuard mailing list

Hi Randy,

Thanks, I've applied this to the wireguard stable tree, and it'll be
sent off to netdev during the next push there.

Regards,
Jason

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-08-08 20:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-11 22:31 [PATCH 0/6 v2] treewide: rename 'mod_init' & 'mod_exit' functions to be module-specific Randy Dunlap
2021-07-11 22:31 ` [PATCH 2/6 v2] hw_random: " Randy Dunlap
2021-07-11 22:31 ` [PATCH 3/6 v2] lib: crypto: " Randy Dunlap
2021-07-11 22:31 ` [PATCH 4/6 v2] MOST: cdev: " Randy Dunlap
2021-07-11 22:31 ` [PATCH 5/6 v2] net: hdlc: " Randy Dunlap
2021-07-11 22:31 ` [PATCH 6/6 v2] wireguard: main: " Randy Dunlap
2021-08-08 20:22   ` Jason A. Donenfeld

Development discussion of WireGuard

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.vuxu.org/wireguard/0 wireguard/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 wireguard wireguard/ https://inbox.vuxu.org/wireguard \
		wireguard@lists.zx2c4.com
	public-inbox-index wireguard

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.wireguard


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git