Skip to content

Commit

Permalink
[CRYPTO] all: Clean up init()/fini()
Browse files Browse the repository at this point in the history
On Thu, Mar 27, 2008 at 03:40:36PM +0100, Bodo Eggert wrote:
> Kamalesh Babulal <[email protected]> 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 <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
kamalesh-babulal authored and herbertx committed Apr 21, 2008
1 parent 7dc748e commit 3af5b90
Show file tree
Hide file tree
Showing 23 changed files with 92 additions and 92 deletions.
8 changes: 4 additions & 4 deletions crypto/anubis.c
Original file line number Diff line number Diff line change
Expand Up @@ -687,21 +687,21 @@ static struct crypto_alg anubis_alg = {
.cia_decrypt = anubis_decrypt } }
};

static int __init init(void)
static int __init anubis_mod_init(void)
{
int ret = 0;

ret = crypto_register_alg(&anubis_alg);
return ret;
}

static void __exit fini(void)
static void __exit anubis_mod_fini(void)
{
crypto_unregister_alg(&anubis_alg);
}

module_init(init);
module_exit(fini);
module_init(anubis_mod_init);
module_exit(anubis_mod_fini);

MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Anubis Cryptographic Algorithm");
8 changes: 4 additions & 4 deletions crypto/blowfish.c
Original file line number Diff line number Diff line change
Expand Up @@ -465,18 +465,18 @@ static struct crypto_alg alg = {
.cia_decrypt = bf_decrypt } }
};

static int __init init(void)
static int __init blowfish_mod_init(void)
{
return crypto_register_alg(&alg);
}

static void __exit fini(void)
static void __exit blowfish_mod_fini(void)
{
crypto_unregister_alg(&alg);
}

module_init(init);
module_exit(fini);
module_init(blowfish_mod_init);
module_exit(blowfish_mod_fini);

MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Blowfish Cipher Algorithm");
8 changes: 4 additions & 4 deletions crypto/cast5.c
Original file line number Diff line number Diff line change
Expand Up @@ -817,18 +817,18 @@ static struct crypto_alg alg = {
}
};

static int __init init(void)
static int __init cast5_mod_init(void)
{
return crypto_register_alg(&alg);
}

static void __exit fini(void)
static void __exit cast5_mod_fini(void)
{
crypto_unregister_alg(&alg);
}

module_init(init);
module_exit(fini);
module_init(cast5_mod_init);
module_exit(cast5_mod_fini);

MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Cast5 Cipher Algorithm");
Expand Down
8 changes: 4 additions & 4 deletions crypto/cast6.c
Original file line number Diff line number Diff line change
Expand Up @@ -528,18 +528,18 @@ static struct crypto_alg alg = {
}
};

static int __init init(void)
static int __init cast6_mod_init(void)
{
return crypto_register_alg(&alg);
}

static void __exit fini(void)
static void __exit cast6_mod_fini(void)
{
crypto_unregister_alg(&alg);
}

module_init(init);
module_exit(fini);
module_init(cast6_mod_init);
module_exit(cast6_mod_fini);

MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Cast6 Cipher Algorithm");
8 changes: 4 additions & 4 deletions crypto/crc32c.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,18 +98,18 @@ static struct crypto_alg alg = {
}
};

static int __init init(void)
static int __init crc32c_mod_init(void)
{
return crypto_register_alg(&alg);
}

static void __exit fini(void)
static void __exit crc32c_mod_fini(void)
{
crypto_unregister_alg(&alg);
}

module_init(init);
module_exit(fini);
module_init(crc32c_mod_init);
module_exit(crc32c_mod_fini);

MODULE_AUTHOR("Clay Haapala <[email protected]>");
MODULE_DESCRIPTION("CRC32c (Castagnoli) calculations wrapper for lib/crc32c");
Expand Down
8 changes: 4 additions & 4 deletions crypto/crypto_null.c
Original file line number Diff line number Diff line change
Expand Up @@ -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_mod_init(void)
{
int ret = 0;

Expand Down Expand Up @@ -174,16 +174,16 @@ static int __init init(void)
goto out;
}

static void __exit fini(void)
static void __exit crypto_null_mod_fini(void)
{
crypto_unregister_alg(&compress_null);
crypto_unregister_alg(&digest_null);
crypto_unregister_alg(&skcipher_null);
crypto_unregister_alg(&cipher_null);
}

module_init(init);
module_exit(fini);
module_init(crypto_null_mod_init);
module_exit(crypto_null_mod_fini);

MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Null Cryptographic Algorithms");
8 changes: 4 additions & 4 deletions crypto/deflate.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,18 +208,18 @@ static struct crypto_alg alg = {
.coa_decompress = deflate_decompress } }
};

static int __init init(void)
static int __init deflate_mod_init(void)
{
return crypto_register_alg(&alg);
}

static void __exit fini(void)
static void __exit deflate_mod_fini(void)
{
crypto_unregister_alg(&alg);
}

module_init(init);
module_exit(fini);
module_init(deflate_mod_init);
module_exit(deflate_mod_fini);

MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Deflate Compression Algorithm for IPCOMP");
Expand Down
8 changes: 4 additions & 4 deletions crypto/des_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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_mod_init(void)
{
int ret = 0;

Expand All @@ -992,14 +992,14 @@ static int __init init(void)
return ret;
}

static void __exit fini(void)
static void __exit des_generic_mod_fini(void)
{
crypto_unregister_alg(&des3_ede_alg);
crypto_unregister_alg(&des_alg);
}

module_init(init);
module_exit(fini);
module_init(des_generic_mod_init);
module_exit(des_generic_mod_fini);

MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("DES & Triple DES EDE Cipher Algorithms");
Expand Down
8 changes: 4 additions & 4 deletions crypto/fcrypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -405,18 +405,18 @@ static struct crypto_alg fcrypt_alg = {
.cia_decrypt = fcrypt_decrypt } }
};

static int __init init(void)
static int __init fcrypt_mod_init(void)
{
return crypto_register_alg(&fcrypt_alg);
}

static void __exit fini(void)
static void __exit fcrypt_mod_fini(void)
{
crypto_unregister_alg(&fcrypt_alg);
}

module_init(init);
module_exit(fini);
module_init(fcrypt_mod_init);
module_exit(fcrypt_mod_fini);

MODULE_LICENSE("Dual BSD/GPL");
MODULE_DESCRIPTION("FCrypt Cipher Algorithm");
Expand Down
8 changes: 4 additions & 4 deletions crypto/khazad.c
Original file line number Diff line number Diff line change
Expand Up @@ -862,22 +862,22 @@ static struct crypto_alg khazad_alg = {
.cia_decrypt = khazad_decrypt } }
};

static int __init init(void)
static int __init khazad_mod_init(void)
{
int ret = 0;

ret = crypto_register_alg(&khazad_alg);
return ret;
}

static void __exit fini(void)
static void __exit khazad_mod_fini(void)
{
crypto_unregister_alg(&khazad_alg);
}


module_init(init);
module_exit(fini);
module_init(khazad_mod_init);
module_exit(khazad_mod_fini);

MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Khazad Cryptographic Algorithm");
8 changes: 4 additions & 4 deletions crypto/lzo.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,18 +89,18 @@ static struct crypto_alg alg = {
.coa_decompress = lzo_decompress } }
};

static int __init init(void)
static int __init lzo_mod_init(void)
{
return crypto_register_alg(&alg);
}

static void __exit fini(void)
static void __exit lzo_mod_fini(void)
{
crypto_unregister_alg(&alg);
}

module_init(init);
module_exit(fini);
module_init(lzo_mod_init);
module_exit(lzo_mod_fini);

MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("LZO Compression Algorithm");
8 changes: 4 additions & 4 deletions crypto/md4.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,18 +233,18 @@ static struct crypto_alg alg = {
.dia_final = md4_final } }
};

static int __init init(void)
static int __init md4_mod_init(void)
{
return crypto_register_alg(&alg);
}

static void __exit fini(void)
static void __exit md4_mod_fini(void)
{
crypto_unregister_alg(&alg);
}

module_init(init);
module_exit(fini);
module_init(md4_mod_init);
module_exit(md4_mod_fini);

MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("MD4 Message Digest Algorithm");
Expand Down
8 changes: 4 additions & 4 deletions crypto/md5.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,18 +228,18 @@ static struct crypto_alg alg = {
.dia_final = md5_final } }
};

static int __init init(void)
static int __init md5_mod_init(void)
{
return crypto_register_alg(&alg);
}

static void __exit fini(void)
static void __exit md5_mod_fini(void)
{
crypto_unregister_alg(&alg);
}

module_init(init);
module_exit(fini);
module_init(md5_mod_init);
module_exit(md5_mod_fini);

MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("MD5 Message Digest Algorithm");
8 changes: 4 additions & 4 deletions crypto/salsa20_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,18 +237,18 @@ static struct crypto_alg alg = {
}
};

static int __init init(void)
static int __init salsa20_generic_mod_init(void)
{
return crypto_register_alg(&alg);
}

static void __exit fini(void)
static void __exit salsa20_generic_mod_fini(void)
{
crypto_unregister_alg(&alg);
}

module_init(init);
module_exit(fini);
module_init(salsa20_generic_mod_init);
module_exit(salsa20_generic_mod_fini);

MODULE_LICENSE("GPL");
MODULE_DESCRIPTION ("Salsa20 stream cipher algorithm");
Expand Down
8 changes: 4 additions & 4 deletions crypto/serpent.c
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ static struct crypto_alg tnepres_alg = {
.cia_decrypt = tnepres_decrypt } }
};

static int __init init(void)
static int __init serpent_mod_init(void)
{
int ret = crypto_register_alg(&serpent_alg);

Expand All @@ -572,14 +572,14 @@ static int __init init(void)
return ret;
}

static void __exit fini(void)
static void __exit serpent_mod_fini(void)
{
crypto_unregister_alg(&tnepres_alg);
crypto_unregister_alg(&serpent_alg);
}

module_init(init);
module_exit(fini);
module_init(serpent_mod_init);
module_exit(serpent_mod_fini);

MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Serpent and tnepres (kerneli compatible serpent reversed) Cipher Algorithm");
Expand Down
8 changes: 4 additions & 4 deletions crypto/sha1_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,18 +120,18 @@ static struct crypto_alg alg = {
.dia_final = sha1_final } }
};

static int __init init(void)
static int __init sha1_generic_mod_init(void)
{
return crypto_register_alg(&alg);
}

static void __exit fini(void)
static void __exit sha1_generic_mod_fini(void)
{
crypto_unregister_alg(&alg);
}

module_init(init);
module_exit(fini);
module_init(sha1_generic_mod_init);
module_exit(sha1_generic_mod_fini);

MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("SHA1 Secure Hash Algorithm");
Expand Down
Loading

0 comments on commit 3af5b90

Please sign in to comment.