Give futex init a proper name
PATCH 1/1 Give futex init a proper name
The futex init function is called init(). This is a pain in the neck when debugging when you code dies in ... init :-)
This renames it to futex_init().
---
kernel/futex.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/futex.c +2 -2
@@ -2158,7 +2158,7 @@ static struct file_system_type futex_fs_ .kill_sb = kill_anon_super, }; -static int __init init (void ) +static int __init futex_init (void ) {u32 curval;int i;
@@ -2194,4 +2194,4 @@ static int __init init(void)return 0 ; } -__initcall (init); +__initcall (futex_init);
Quoted 23 lines · On Thu, 27 Mar 2008 14:52:15 +1100 Benjamin Herrenschmidt <[email protected]>…
The futex init function is called
init(). This is a pain in the neck when debugging when you code dies in ... init :-)This renames it to
futex_init().Signed-off-by Benjamin Herrenschmidt <[email protected]>---
kernel/futex.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)kernel/futex.c +1
-1@@ -2158,7 +2158,7 @@ static struct file_system_type futex_fs_ .kill_sb = kill_anon_super, }; -static int __init init (void ) +static int __init futex_init (void ) {u32 curval;int i;
kernel/futex.c static int __init init(void) · line 2197
Quoted 5 lines
kernel/futex.c +1
-1@@ -2194,4 +2194,4 @@ static int __init init(void)return 0 ; } -__initcall (init); +__initcall (futex_init);
heh, I seem to remember doing about fifty of these in netfilter code a while back.
You have a way to go - there are thirty-odd just in the crypto code.
Quoted 4 lines · Andrew Morton
heh, I seem to remember doing about fifty of these in netfilter code a while back.
You have a way to go - there are thirty-odd just in the crypto code.
Heh, well, let's merge that one and I'll see if I can be bothered fixing the crypto ones :-)
Cheers,
Ben.
PATCH 1/1 init()/fini() clean up in the crypto
In reply to Andrew MortonQuoted 34 lines · Andrew Morton
Quoted 23 lines · On Thu, 27 Mar 2008 14:52:15 +1100 Benjamin Herrenschmidt <[email protected]>…
The futex init function is called
init(). This is a pain in the neck when debugging when you code dies in ... init :-)This renames it to
futex_init().Signed-off-by Benjamin Herrenschmidt <[email protected]>---
kernel/futex.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)kernel/futex.c +1
-1@@ -2158,7 +2158,7 @@ static struct file_system_type futex_fs_ .kill_sb = kill_anon_super, }; -static int __init init (void ) +static int __init futex_init (void ) {u32 curval;int i;kernel/futex.c static int __init init(void) · line 2197
Quoted 5 lines
kernel/futex.c +1
-1@@ -2194,4 +2194,4 @@ static int __init init(void)return 0 ; } -__initcall (init); +__initcall (futex_init);heh, I seem to remember doing about fifty of these in netfilter code a while back.
Quoted 2 lines
You have a way to go - there are thirty-odd just in the crypto code.
This patch cleanups the crypto code, replaces the init() and fini() with the <algorithm name>_init/_fini or init/fini_<algorithm name> (if the <algorithm name>_init/_fini exist)
--
crypto/anubis.c +4 -4
@@ -687,7 +687,7 @@ static struct crypto_alg anubis_alg = { .cia_decrypt = anubis_decrypt } } }; -static int __init init (void ) +static int __init anubis_init (void ) {int ret =0 ;
@@ -695,13 +695,13 @@ static int __init init(void)return ret; } -static void __exit fini(void) +static void __exit anubis_fini(void) {crypto_unregister_alg (&anubis_alg); } -module_init (init); -module_exit (fini); +module_init (anubis_init); +module_exit (anubis_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Anubis Cryptographic Algorithm" );
crypto/blowfish.c +4 -4
@@ -465,18 +465,18 @@ static struct crypto_alg alg = { .cia_decrypt = bf_decrypt } } }; -static int __init init (void ) +static int __init blowfish_init (void ) {return crypto_register_alg (&alg); } -static void __exit fini(void) +static void __exit blowfish_fini(void) {crypto_unregister_alg (&alg); } -module_init (init); -module_exit (fini); +module_init (blowfish_init); +module_exit (blowfish_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Blowfish Cipher Algorithm" );
crypto/cast5.c +4 -4
@@ -817,18 +817,18 @@ static struct crypto_alg alg = { } }; -static int __init init (void ) +static int __init cast5_init (void ) {return crypto_register_alg (&alg); } -static void __exit fini(void) +static void __exit cast5_fini(void) {crypto_unregister_alg (&alg); } -module_init (init); -module_exit (fini); +module_init (cast5_init); +module_exit (cast5_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Cast5 Cipher Algorithm" );
crypto/cast6.c +4 -4
@@ -528,18 +528,18 @@ static struct crypto_alg alg = { } }; -static int __init init (void ) +static int __init cast6_init (void ) {return crypto_register_alg (&alg); } -static void __exit fini(void) +static void __exit cast6_fini(void) {crypto_unregister_alg (&alg); } -module_init (init); -module_exit (fini); +module_init (cast6_init); +module_exit (cast6_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Cast6 Cipher Algorithm" );
crypto/crc32c.c +4 -4
@@ -98,18 +98,18 @@ static struct crypto_alg alg = { } }; -static int __init init (void ) +static int __init crc32c_init (void ) {return crypto_register_alg (&alg); } -static void __exit fini(void) +static void __exit crc32c_fini(void) {crypto_unregister_alg (&alg); } -module_init (init); -module_exit (fini); +module_init (crc32c_init); +module_exit (crc32c_fini);MODULE_AUTHOR ("Clay Haapala <[email protected]>" );MODULE_DESCRIPTION ("CRC32c (Castagnoli) calculations wrapper for lib/crc32c" );
crypto/crypto_null.c +4 -4
@@ -142,7 +142,7 @@ MODULE_ALIAS("compress_null");MODULE_ALIAS ("digest_null" );MODULE_ALIAS ("cipher_null" ); -static int __init init (void ) +static int __init crypto_null_init (void ) {int ret =0 ;
@@ -174,7 +174,7 @@ out_unregister_cipher: goto out; } -static void __exit fini(void) +static void __exit crypto_null_fini(void) {crypto_unregister_alg (&compress_null);crypto_unregister_alg (&digest_null);
@@ -182,8 +182,8 @@ static void __exit fini(void)crypto_unregister_alg (&cipher_null); } -module_init (init); -module_exit (fini); +module_init (crypto_null_init); +module_exit (crypto_null_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Null Cryptographic Algorithms" );
crypto/deflate.c +4 -4
@@ -208,18 +208,18 @@ static struct crypto_alg alg = { .coa_decompress = deflate_decompress } } }; -static int __init init (void ) +static int __init init_deflate (void ) {return crypto_register_alg (&alg); } -static void __exit fini(void) +static void __exit fini_deflate(void) {crypto_unregister_alg (&alg); } -module_init (init); -module_exit (fini); +module_init (init_deflate); +module_exit (fini_deflate);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Deflate Compression Algorithm for IPCOMP" );
crypto/des_generic.c +4 -4
@@ -977,7 +977,7 @@ static struct crypto_alg des3_ede_alg = {MODULE_ALIAS ("des3_ede" ); -static int __init init (void ) +static int __init des_generic_init (void ) {int ret =0 ;
@@ -992,14 +992,14 @@ out:return ret; } -static void __exit fini(void) +static void __exit des_generic_fini(void) {crypto_unregister_alg (&des3_ede_alg);crypto_unregister_alg (&des_alg); } -module_init (init); -module_exit (fini); +module_init (des_generic_init); +module_exit (des_generic_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("DES & Triple DES EDE Cipher Algorithms" );
crypto/fcrypt.c +4 -4
@@ -405,18 +405,18 @@ static struct crypto_alg fcrypt_alg = { .cia_decrypt = fcrypt_decrypt } } }; -static int __init init (void ) +static int __init fcrypt_init (void ) {return crypto_register_alg (&fcrypt_alg); } -static void __exit fini(void) +static void __exit fcrypt_fini(void) {crypto_unregister_alg (&fcrypt_alg); } -module_init (init); -module_exit (fini); +module_init (fcrypt_init); +module_exit (fcrypt_fini);MODULE_LICENSE ("Dual BSD/GPL" );MODULE_DESCRIPTION ("FCrypt Cipher Algorithm" );
crypto/khazad.c +4 -4
@@ -862,7 +862,7 @@ static struct crypto_alg khazad_alg = { .cia_decrypt = khazad_decrypt } } }; -static int __init init (void ) +static int __init khazad_init (void ) {int ret =0 ;
@@ -870,14 +870,14 @@ static int __init init(void)return ret; } -static void __exit fini(void) +static void __exit khazad_fini(void) {crypto_unregister_alg (&khazad_alg); } -module_init (init); -module_exit (fini); +module_init (khazad_init); +module_exit (khazad_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Khazad Cryptographic Algorithm" );
crypto/lzo.c +4 -4
@@ -89,18 +89,18 @@ static struct crypto_alg alg = { .coa_decompress = lzo_decompress } } }; -static int __init init (void ) +static int __init init_lzo (void ) {return crypto_register_alg (&alg); } -static void __exit fini(void) +static void __exit fini_lzo(void) {crypto_unregister_alg (&alg); } -module_init (init); -module_exit (fini); +module_init (init_lzo); +module_exit (fini_lzo);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("LZO Compression Algorithm" );
crypto/md4.c +4 -4
@@ -233,18 +233,18 @@ static struct crypto_alg alg = { .dia_final = md4_final } } }; -static int __init init (void ) +static int __init init_md4 (void ) {return crypto_register_alg (&alg); } -static void __exit fini(void) +static void __exit fini_md4(void) {crypto_unregister_alg (&alg); } -module_init (init); -module_exit (fini); +module_init (init_md4); +module_exit (fini_md4);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("MD4 Message Digest Algorithm" );
crypto/md5.c +4 -4
@@ -228,18 +228,18 @@ static struct crypto_alg alg = { .dia_final = md5_final } } }; -static int __init init (void ) +static int __init init_md5 (void ) {return crypto_register_alg (&alg); } -static void __exit fini(void) +static void __exit fini_md5(void) {crypto_unregister_alg (&alg); } -module_init (init); -module_exit (fini); +module_init (init_md5); +module_exit (fini_md5);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("MD5 Message Digest Algorithm" );
crypto/salsa20_generic.c +4 -4
@@ -237,18 +237,18 @@ static struct crypto_alg alg = { } }; -static int __init init (void ) +static int __init salsa20_generic_init (void ) {return crypto_register_alg (&alg); } -static void __exit fini(void) +static void __exit salsa20_generic_fini(void) {crypto_unregister_alg (&alg); } -module_init (init); -module_exit (fini); +module_init (salsa20_generic_init); +module_exit (salsa20_generic_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Salsa20 stream cipher algorithm" );
crypto/serpent.c +4 -4
@@ -557,7 +557,7 @@ static struct crypto_alg tnepres_alg = { .cia_decrypt = tnepres_decrypt } } }; -static int __init init (void ) +static int __init serpent_init (void ) {int ret =crypto_register_alg (&serpent_alg);
@@ -572,14 +572,14 @@ static int __init init(void)return ret; } -static void __exit fini(void) +static void __exit serpent_fini(void) {crypto_unregister_alg (&tnepres_alg);crypto_unregister_alg (&serpent_alg); } -module_init (init); -module_exit (fini); +module_init (serpent_init); +module_exit (serpent_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Serpent and tnepres (kerneli compatible serpent reversed) Cipher Algorithm" );
crypto/sha1_generic.c +4 -4
@@ -120,18 +120,18 @@ static struct crypto_alg alg = { .dia_final = sha1_final } } }; -static int __init init (void ) +static int __init sha1_generic_init (void ) {return crypto_register_alg (&alg); } -static void __exit fini(void) +static void __exit sha1_generic_fini(void) {crypto_unregister_alg (&alg); } -module_init (init); -module_exit (fini); +module_init (sha1_generic_init); +module_exit (sha1_generic_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("SHA1 Secure Hash Algorithm" );
crypto/sha256_generic.c +4 -4
@@ -353,7 +353,7 @@ static struct crypto_alg sha224 = { .dia_final = sha224_final } } }; -static int __init init (void ) +static int __init sha256_generic_init (void ) {int ret =0 ;
@@ -370,14 +370,14 @@ static int __init init(void)return ret; } -static void __exit fini(void) +static void __exit sha256_generic_fini(void) {crypto_unregister_alg (&sha224);crypto_unregister_alg (&sha256); } -module_init (init); -module_exit (fini); +module_init (sha256_generic_init); +module_exit (sha256_generic_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("SHA-224 and SHA-256 Secure Hash Algorithm" );
crypto/sha512.c +4 -4
@@ -280,7 +280,7 @@ static struct crypto_alg sha384 = {MODULE_ALIAS ("sha384" ); -static int __init init (void ) +static int __init init_sha512 (void ) {int ret =0 ;
@@ -292,14 +292,14 @@ out:return ret; } -static void __exit fini(void) +static void __exit fini_sha512(void) {crypto_unregister_alg (&sha384);crypto_unregister_alg (&sha512); } -module_init (init); -module_exit (fini); +module_init (init_sha512); +module_exit (fini_sha512);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("SHA-512 and SHA-384 Secure Hash Algorithms" );
crypto/tcrypt.c +4 -4
@@ -1775,7 +1775,7 @@ static void do_test(void) } } -static int __init init (void ) +static int __init tcrypt_init (void ) {int err = -ENOMEM ;
@@ -1814,10 +1814,10 @@ static int __init init(void)* If an init function is provided, an exit function must also be provided * to allow module unload. */ -static void __exit fini(void) { } +static void __exit tcrypt_fini(void) { } -module_init (init); -module_exit (fini); +module_init (tcrypt_init); +module_exit (tcrypt_fini);module_param (mode, int,0 );module_param (sec, uint,0 );
crypto/tea.c +4 -4
@@ -267,7 +267,7 @@ static struct crypto_alg xeta_alg = { .cia_decrypt = xeta_decrypt } } }; -static int __init init (void ) +static int __init tea_init (void ) {int ret =0 ;
@@ -292,7 +292,7 @@ out:return ret; } -static void __exit fini(void) +static void __exit tea_fini(void) {crypto_unregister_alg (&tea_alg);crypto_unregister_alg (&xtea_alg);
@@ -302,8 +302,8 @@ static void __exit fini(void)MODULE_ALIAS ("xtea" );MODULE_ALIAS ("xeta" ); -module_init (init); -module_exit (fini); +module_init (tea_init); +module_exit (tea_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("TEA, XTEA & XETA Cryptographic Algorithms" );
crypto/tgr192.c +4 -4
@@ -663,7 +663,7 @@ static struct crypto_alg tgr128 = { .dia_final = tgr128_final}} }; -static int __init init (void ) +static int __init init_tgr192 (void ) {int ret =0 ;
@@ -688,7 +688,7 @@ static int __init init(void)return ret; } -static void __exit fini(void) +static void __exit fini_tgr192(void) {crypto_unregister_alg (&tgr192);crypto_unregister_alg (&tgr160);
@@ -698,8 +698,8 @@ static void __exit fini(void)MODULE_ALIAS ("tgr160" );MODULE_ALIAS ("tgr128" ); -module_init (init); -module_exit (fini); +module_init (init_tgr192); +module_exit (fini_tgr192);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Tiger Message Digest Algorithm" );
crypto/twofish.c +4 -4
@@ -197,18 +197,18 @@ static struct crypto_alg alg = { .cia_decrypt = twofish_decrypt } } }; -static int __init init (void ) +static int __init twofish_init (void ) {return crypto_register_alg (&alg); } -static void __exit fini(void) +static void __exit twofish_fini(void) {crypto_unregister_alg (&alg); } -module_init (init); -module_exit (fini); +module_init (twofish_init); +module_exit (twofish_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Twofish Cipher Algorithm" );
crypto/wp512.c +4 -4
@@ -1146,7 +1146,7 @@ static struct crypto_alg wp256 = { .dia_final = wp256_final } } }; -static int __init init (void ) +static int __init init_wp512 (void ) {int ret =0 ;
@@ -1172,7 +1172,7 @@ out:return ret; } -static void __exit fini(void) +static void __exit fini_wp512(void) {crypto_unregister_alg (&wp512);crypto_unregister_alg (&wp384);
@@ -1182,8 +1182,8 @@ static void __exit fini(void)MODULE_ALIAS ("wp384" );MODULE_ALIAS ("wp256" ); -module_init (init); -module_exit (fini); +module_init (init_wp512); +module_exit (fini_wp512);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Whirlpool Message Digest Algorithm" );
Signature · 4 lines
Thanks & Regards, Kamalesh Babulal, Linux Technology Center, IBM, ISTL.