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

[CRYPTO] all: Clean up init()/fini()

On Thu, Mar 27, 2008 at 03:40:36PM +0100, Bodo Eggert wrote:
> Kamalesh Babulal <kamalesh@linux.vnet.ibm.com> wrote:
>
> > This patch cleanups the crypto code, replaces the init() and fini()
> > with the <algorithm name>_init/_fini
>
> This part ist OK.
>
> > or init/fini_<algorithm name> (if the
> > <algorithm name>_init/_fini exist)
>
> Having init_foo and foo_init won't be a good thing, will it? I'd start
> confusing them.
>
> What about foo_modinit instead?

Thanks for the suggestion, the init() is replaced with

<algorithm name>_mod_init ()

and fini () is replaced with <algorithm name>_mod_fini.

Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Kamalesh Babulal and committed by
Herbert Xu
3af5b90b 7dc748e4

+92 -92
+4 -4
crypto/anubis.c
··· 687 687 .cia_decrypt = anubis_decrypt } } 688 688 }; 689 689 690 - static int __init init(void) 690 + static int __init anubis_mod_init(void) 691 691 { 692 692 int ret = 0; 693 693 ··· 695 695 return ret; 696 696 } 697 697 698 - static void __exit fini(void) 698 + static void __exit anubis_mod_fini(void) 699 699 { 700 700 crypto_unregister_alg(&anubis_alg); 701 701 } 702 702 703 - module_init(init); 704 - module_exit(fini); 703 + module_init(anubis_mod_init); 704 + module_exit(anubis_mod_fini); 705 705 706 706 MODULE_LICENSE("GPL"); 707 707 MODULE_DESCRIPTION("Anubis Cryptographic Algorithm");
+4 -4
crypto/blowfish.c
··· 465 465 .cia_decrypt = bf_decrypt } } 466 466 }; 467 467 468 - static int __init init(void) 468 + static int __init blowfish_mod_init(void) 469 469 { 470 470 return crypto_register_alg(&alg); 471 471 } 472 472 473 - static void __exit fini(void) 473 + static void __exit blowfish_mod_fini(void) 474 474 { 475 475 crypto_unregister_alg(&alg); 476 476 } 477 477 478 - module_init(init); 479 - module_exit(fini); 478 + module_init(blowfish_mod_init); 479 + module_exit(blowfish_mod_fini); 480 480 481 481 MODULE_LICENSE("GPL"); 482 482 MODULE_DESCRIPTION("Blowfish Cipher Algorithm");
+4 -4
crypto/cast5.c
··· 817 817 } 818 818 }; 819 819 820 - static int __init init(void) 820 + static int __init cast5_mod_init(void) 821 821 { 822 822 return crypto_register_alg(&alg); 823 823 } 824 824 825 - static void __exit fini(void) 825 + static void __exit cast5_mod_fini(void) 826 826 { 827 827 crypto_unregister_alg(&alg); 828 828 } 829 829 830 - module_init(init); 831 - module_exit(fini); 830 + module_init(cast5_mod_init); 831 + module_exit(cast5_mod_fini); 832 832 833 833 MODULE_LICENSE("GPL"); 834 834 MODULE_DESCRIPTION("Cast5 Cipher Algorithm");
+4 -4
crypto/cast6.c
··· 528 528 } 529 529 }; 530 530 531 - static int __init init(void) 531 + static int __init cast6_mod_init(void) 532 532 { 533 533 return crypto_register_alg(&alg); 534 534 } 535 535 536 - static void __exit fini(void) 536 + static void __exit cast6_mod_fini(void) 537 537 { 538 538 crypto_unregister_alg(&alg); 539 539 } 540 540 541 - module_init(init); 542 - module_exit(fini); 541 + module_init(cast6_mod_init); 542 + module_exit(cast6_mod_fini); 543 543 544 544 MODULE_LICENSE("GPL"); 545 545 MODULE_DESCRIPTION("Cast6 Cipher Algorithm");
+4 -4
crypto/crc32c.c
··· 98 98 } 99 99 }; 100 100 101 - static int __init init(void) 101 + static int __init crc32c_mod_init(void) 102 102 { 103 103 return crypto_register_alg(&alg); 104 104 } 105 105 106 - static void __exit fini(void) 106 + static void __exit crc32c_mod_fini(void) 107 107 { 108 108 crypto_unregister_alg(&alg); 109 109 } 110 110 111 - module_init(init); 112 - module_exit(fini); 111 + module_init(crc32c_mod_init); 112 + module_exit(crc32c_mod_fini); 113 113 114 114 MODULE_AUTHOR("Clay Haapala <chaapala@cisco.com>"); 115 115 MODULE_DESCRIPTION("CRC32c (Castagnoli) calculations wrapper for lib/crc32c");
+4 -4
crypto/crypto_null.c
··· 142 142 MODULE_ALIAS("digest_null"); 143 143 MODULE_ALIAS("cipher_null"); 144 144 145 - static int __init init(void) 145 + static int __init crypto_null_mod_init(void) 146 146 { 147 147 int ret = 0; 148 148 ··· 174 174 goto out; 175 175 } 176 176 177 - static void __exit fini(void) 177 + static void __exit crypto_null_mod_fini(void) 178 178 { 179 179 crypto_unregister_alg(&compress_null); 180 180 crypto_unregister_alg(&digest_null); ··· 182 182 crypto_unregister_alg(&cipher_null); 183 183 } 184 184 185 - module_init(init); 186 - module_exit(fini); 185 + module_init(crypto_null_mod_init); 186 + module_exit(crypto_null_mod_fini); 187 187 188 188 MODULE_LICENSE("GPL"); 189 189 MODULE_DESCRIPTION("Null Cryptographic Algorithms");
+4 -4
crypto/deflate.c
··· 208 208 .coa_decompress = deflate_decompress } } 209 209 }; 210 210 211 - static int __init init(void) 211 + static int __init deflate_mod_init(void) 212 212 { 213 213 return crypto_register_alg(&alg); 214 214 } 215 215 216 - static void __exit fini(void) 216 + static void __exit deflate_mod_fini(void) 217 217 { 218 218 crypto_unregister_alg(&alg); 219 219 } 220 220 221 - module_init(init); 222 - module_exit(fini); 221 + module_init(deflate_mod_init); 222 + module_exit(deflate_mod_fini); 223 223 224 224 MODULE_LICENSE("GPL"); 225 225 MODULE_DESCRIPTION("Deflate Compression Algorithm for IPCOMP");
+4 -4
crypto/des_generic.c
··· 977 977 978 978 MODULE_ALIAS("des3_ede"); 979 979 980 - static int __init init(void) 980 + static int __init des_generic_mod_init(void) 981 981 { 982 982 int ret = 0; 983 983 ··· 992 992 return ret; 993 993 } 994 994 995 - static void __exit fini(void) 995 + static void __exit des_generic_mod_fini(void) 996 996 { 997 997 crypto_unregister_alg(&des3_ede_alg); 998 998 crypto_unregister_alg(&des_alg); 999 999 } 1000 1000 1001 - module_init(init); 1002 - module_exit(fini); 1001 + module_init(des_generic_mod_init); 1002 + module_exit(des_generic_mod_fini); 1003 1003 1004 1004 MODULE_LICENSE("GPL"); 1005 1005 MODULE_DESCRIPTION("DES & Triple DES EDE Cipher Algorithms");
+4 -4
crypto/fcrypt.c
··· 405 405 .cia_decrypt = fcrypt_decrypt } } 406 406 }; 407 407 408 - static int __init init(void) 408 + static int __init fcrypt_mod_init(void) 409 409 { 410 410 return crypto_register_alg(&fcrypt_alg); 411 411 } 412 412 413 - static void __exit fini(void) 413 + static void __exit fcrypt_mod_fini(void) 414 414 { 415 415 crypto_unregister_alg(&fcrypt_alg); 416 416 } 417 417 418 - module_init(init); 419 - module_exit(fini); 418 + module_init(fcrypt_mod_init); 419 + module_exit(fcrypt_mod_fini); 420 420 421 421 MODULE_LICENSE("Dual BSD/GPL"); 422 422 MODULE_DESCRIPTION("FCrypt Cipher Algorithm");
+4 -4
crypto/khazad.c
··· 862 862 .cia_decrypt = khazad_decrypt } } 863 863 }; 864 864 865 - static int __init init(void) 865 + static int __init khazad_mod_init(void) 866 866 { 867 867 int ret = 0; 868 868 ··· 870 870 return ret; 871 871 } 872 872 873 - static void __exit fini(void) 873 + static void __exit khazad_mod_fini(void) 874 874 { 875 875 crypto_unregister_alg(&khazad_alg); 876 876 } 877 877 878 878 879 - module_init(init); 880 - module_exit(fini); 879 + module_init(khazad_mod_init); 880 + module_exit(khazad_mod_fini); 881 881 882 882 MODULE_LICENSE("GPL"); 883 883 MODULE_DESCRIPTION("Khazad Cryptographic Algorithm");
+4 -4
crypto/lzo.c
··· 89 89 .coa_decompress = lzo_decompress } } 90 90 }; 91 91 92 - static int __init init(void) 92 + static int __init lzo_mod_init(void) 93 93 { 94 94 return crypto_register_alg(&alg); 95 95 } 96 96 97 - static void __exit fini(void) 97 + static void __exit lzo_mod_fini(void) 98 98 { 99 99 crypto_unregister_alg(&alg); 100 100 } 101 101 102 - module_init(init); 103 - module_exit(fini); 102 + module_init(lzo_mod_init); 103 + module_exit(lzo_mod_fini); 104 104 105 105 MODULE_LICENSE("GPL"); 106 106 MODULE_DESCRIPTION("LZO Compression Algorithm");
+4 -4
crypto/md4.c
··· 233 233 .dia_final = md4_final } } 234 234 }; 235 235 236 - static int __init init(void) 236 + static int __init md4_mod_init(void) 237 237 { 238 238 return crypto_register_alg(&alg); 239 239 } 240 240 241 - static void __exit fini(void) 241 + static void __exit md4_mod_fini(void) 242 242 { 243 243 crypto_unregister_alg(&alg); 244 244 } 245 245 246 - module_init(init); 247 - module_exit(fini); 246 + module_init(md4_mod_init); 247 + module_exit(md4_mod_fini); 248 248 249 249 MODULE_LICENSE("GPL"); 250 250 MODULE_DESCRIPTION("MD4 Message Digest Algorithm");
+4 -4
crypto/md5.c
··· 228 228 .dia_final = md5_final } } 229 229 }; 230 230 231 - static int __init init(void) 231 + static int __init md5_mod_init(void) 232 232 { 233 233 return crypto_register_alg(&alg); 234 234 } 235 235 236 - static void __exit fini(void) 236 + static void __exit md5_mod_fini(void) 237 237 { 238 238 crypto_unregister_alg(&alg); 239 239 } 240 240 241 - module_init(init); 242 - module_exit(fini); 241 + module_init(md5_mod_init); 242 + module_exit(md5_mod_fini); 243 243 244 244 MODULE_LICENSE("GPL"); 245 245 MODULE_DESCRIPTION("MD5 Message Digest Algorithm");
+4 -4
crypto/salsa20_generic.c
··· 237 237 } 238 238 }; 239 239 240 - static int __init init(void) 240 + static int __init salsa20_generic_mod_init(void) 241 241 { 242 242 return crypto_register_alg(&alg); 243 243 } 244 244 245 - static void __exit fini(void) 245 + static void __exit salsa20_generic_mod_fini(void) 246 246 { 247 247 crypto_unregister_alg(&alg); 248 248 } 249 249 250 - module_init(init); 251 - module_exit(fini); 250 + module_init(salsa20_generic_mod_init); 251 + module_exit(salsa20_generic_mod_fini); 252 252 253 253 MODULE_LICENSE("GPL"); 254 254 MODULE_DESCRIPTION ("Salsa20 stream cipher algorithm");
+4 -4
crypto/serpent.c
··· 557 557 .cia_decrypt = tnepres_decrypt } } 558 558 }; 559 559 560 - static int __init init(void) 560 + static int __init serpent_mod_init(void) 561 561 { 562 562 int ret = crypto_register_alg(&serpent_alg); 563 563 ··· 572 572 return ret; 573 573 } 574 574 575 - static void __exit fini(void) 575 + static void __exit serpent_mod_fini(void) 576 576 { 577 577 crypto_unregister_alg(&tnepres_alg); 578 578 crypto_unregister_alg(&serpent_alg); 579 579 } 580 580 581 - module_init(init); 582 - module_exit(fini); 581 + module_init(serpent_mod_init); 582 + module_exit(serpent_mod_fini); 583 583 584 584 MODULE_LICENSE("GPL"); 585 585 MODULE_DESCRIPTION("Serpent and tnepres (kerneli compatible serpent reversed) Cipher Algorithm");
+4 -4
crypto/sha1_generic.c
··· 120 120 .dia_final = sha1_final } } 121 121 }; 122 122 123 - static int __init init(void) 123 + static int __init sha1_generic_mod_init(void) 124 124 { 125 125 return crypto_register_alg(&alg); 126 126 } 127 127 128 - static void __exit fini(void) 128 + static void __exit sha1_generic_mod_fini(void) 129 129 { 130 130 crypto_unregister_alg(&alg); 131 131 } 132 132 133 - module_init(init); 134 - module_exit(fini); 133 + module_init(sha1_generic_mod_init); 134 + module_exit(sha1_generic_mod_fini); 135 135 136 136 MODULE_LICENSE("GPL"); 137 137 MODULE_DESCRIPTION("SHA1 Secure Hash Algorithm");
+4 -4
crypto/sha256_generic.c
··· 353 353 .dia_final = sha224_final } } 354 354 }; 355 355 356 - static int __init init(void) 356 + static int __init sha256_generic_mod_init(void) 357 357 { 358 358 int ret = 0; 359 359 ··· 370 370 return ret; 371 371 } 372 372 373 - static void __exit fini(void) 373 + static void __exit sha256_generic_mod_fini(void) 374 374 { 375 375 crypto_unregister_alg(&sha224); 376 376 crypto_unregister_alg(&sha256); 377 377 } 378 378 379 - module_init(init); 380 - module_exit(fini); 379 + module_init(sha256_generic_mod_init); 380 + module_exit(sha256_generic_mod_fini); 381 381 382 382 MODULE_LICENSE("GPL"); 383 383 MODULE_DESCRIPTION("SHA-224 and SHA-256 Secure Hash Algorithm");
+4 -4
crypto/sha512_generic.c
··· 278 278 } 279 279 }; 280 280 281 - static int __init init(void) 281 + static int __init sha512_generic_mod_init(void) 282 282 { 283 283 int ret = 0; 284 284 ··· 290 290 return ret; 291 291 } 292 292 293 - static void __exit fini(void) 293 + static void __exit sha512_generic_mod_fini(void) 294 294 { 295 295 crypto_unregister_alg(&sha384); 296 296 crypto_unregister_alg(&sha512); 297 297 } 298 298 299 - module_init(init); 300 - module_exit(fini); 299 + module_init(sha512_generic_mod_init); 300 + module_exit(sha512_generic_mod_fini); 301 301 302 302 MODULE_LICENSE("GPL"); 303 303 MODULE_DESCRIPTION("SHA-512 and SHA-384 Secure Hash Algorithms");
+4 -4
crypto/tcrypt.c
··· 1810 1810 } 1811 1811 } 1812 1812 1813 - static int __init init(void) 1813 + static int __init tcrypt_mod_init(void) 1814 1814 { 1815 1815 int err = -ENOMEM; 1816 1816 ··· 1849 1849 * If an init function is provided, an exit function must also be provided 1850 1850 * to allow module unload. 1851 1851 */ 1852 - static void __exit fini(void) { } 1852 + static void __exit tcrypt_mod_fini(void) { } 1853 1853 1854 - module_init(init); 1855 - module_exit(fini); 1854 + module_init(tcrypt_mod_init); 1855 + module_exit(tcrypt_mod_fini); 1856 1856 1857 1857 module_param(mode, int, 0); 1858 1858 module_param(sec, uint, 0);
+4 -4
crypto/tea.c
··· 267 267 .cia_decrypt = xeta_decrypt } } 268 268 }; 269 269 270 - static int __init init(void) 270 + static int __init tea_mod_init(void) 271 271 { 272 272 int ret = 0; 273 273 ··· 292 292 return ret; 293 293 } 294 294 295 - static void __exit fini(void) 295 + static void __exit tea_mod_fini(void) 296 296 { 297 297 crypto_unregister_alg(&tea_alg); 298 298 crypto_unregister_alg(&xtea_alg); ··· 302 302 MODULE_ALIAS("xtea"); 303 303 MODULE_ALIAS("xeta"); 304 304 305 - module_init(init); 306 - module_exit(fini); 305 + module_init(tea_mod_init); 306 + module_exit(tea_mod_fini); 307 307 308 308 MODULE_LICENSE("GPL"); 309 309 MODULE_DESCRIPTION("TEA, XTEA & XETA Cryptographic Algorithms");
+4 -4
crypto/tgr192.c
··· 663 663 .dia_final = tgr128_final}} 664 664 }; 665 665 666 - static int __init init(void) 666 + static int __init tgr192_mod_init(void) 667 667 { 668 668 int ret = 0; 669 669 ··· 688 688 return ret; 689 689 } 690 690 691 - static void __exit fini(void) 691 + static void __exit tgr192_mod_fini(void) 692 692 { 693 693 crypto_unregister_alg(&tgr192); 694 694 crypto_unregister_alg(&tgr160); ··· 698 698 MODULE_ALIAS("tgr160"); 699 699 MODULE_ALIAS("tgr128"); 700 700 701 - module_init(init); 702 - module_exit(fini); 701 + module_init(tgr192_mod_init); 702 + module_exit(tgr192_mod_fini); 703 703 704 704 MODULE_LICENSE("GPL"); 705 705 MODULE_DESCRIPTION("Tiger Message Digest Algorithm");
+4 -4
crypto/twofish.c
··· 197 197 .cia_decrypt = twofish_decrypt } } 198 198 }; 199 199 200 - static int __init init(void) 200 + static int __init twofish_mod_init(void) 201 201 { 202 202 return crypto_register_alg(&alg); 203 203 } 204 204 205 - static void __exit fini(void) 205 + static void __exit twofish_mod_fini(void) 206 206 { 207 207 crypto_unregister_alg(&alg); 208 208 } 209 209 210 - module_init(init); 211 - module_exit(fini); 210 + module_init(twofish_mod_init); 211 + module_exit(twofish_mod_fini); 212 212 213 213 MODULE_LICENSE("GPL"); 214 214 MODULE_DESCRIPTION ("Twofish Cipher Algorithm");
+4 -4
crypto/wp512.c
··· 1146 1146 .dia_final = wp256_final } } 1147 1147 }; 1148 1148 1149 - static int __init init(void) 1149 + static int __init wp512_mod_init(void) 1150 1150 { 1151 1151 int ret = 0; 1152 1152 ··· 1172 1172 return ret; 1173 1173 } 1174 1174 1175 - static void __exit fini(void) 1175 + static void __exit wp512_mod_fini(void) 1176 1176 { 1177 1177 crypto_unregister_alg(&wp512); 1178 1178 crypto_unregister_alg(&wp384); ··· 1182 1182 MODULE_ALIAS("wp384"); 1183 1183 MODULE_ALIAS("wp256"); 1184 1184 1185 - module_init(init); 1186 - module_exit(fini); 1185 + module_init(wp512_mod_init); 1186 + module_exit(wp512_mod_fini); 1187 1187 1188 1188 MODULE_LICENSE("GPL"); 1189 1189 MODULE_DESCRIPTION("Whirlpool Message Digest Algorithm");