purge linux/module.h usage

BUG=chromium:878440
TEST=build works

Change-Id: If1c688eaab4ad216de75218e6d6efc761b517449
Reviewed-on: https://chromium-review.googlesource.com/1194713
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
diff --git a/dm-bht.c b/dm-bht.c
index 55d09c4..57ad231 100644
--- a/dm-bht.c
+++ b/dm-bht.c
@@ -18,7 +18,6 @@
 #include <linux/errno.h>
 #include <linux/gfp.h>
 #include <linux/kernel.h>
-#include <linux/module.h>
 #include <linux/mm_types.h>
 #include <linux/scatterlist.h>
 #include <linux/slab.h>  /* k*alloc */
@@ -261,7 +260,6 @@
 			crypto_free_hash(bht->hash_desc[cpu].tfm);
 	return status;
 }
-EXPORT_SYMBOL(dm_bht_create);
 
 static int dm_bht_initialize_entries(struct dm_bht *bht)
 {
@@ -359,7 +357,6 @@
 	BUG_ON(atomic_read(&entry->state) != DM_BHT_ENTRY_PENDING);
 	atomic_set(&entry->state, DM_BHT_ENTRY_READY);
 }
-EXPORT_SYMBOL(dm_bht_read_completed);
 
 /* dm_bht_verify_path
  * Verifies the path. Returns 0 on ok.
@@ -443,7 +440,6 @@
 	dm_bht_read_completed(entry, 0);
 	return 0;
 }
-EXPORT_SYMBOL(dm_bht_zeroread_callback);
 
 /**
  * dm_bht_is_populated - check that entries from disk needed to verify a given
@@ -467,7 +463,6 @@
 
 	return true;
 }
-EXPORT_SYMBOL(dm_bht_is_populated);
 
 /**
  * dm_bht_populate - reads entries from disk needed to verify a given block
@@ -531,7 +526,6 @@
 	DMCRIT("failed to allocate memory for entry->nodes");
 	return -ENOMEM;
 }
-EXPORT_SYMBOL(dm_bht_populate);
 
 
 /**
@@ -552,7 +546,6 @@
 
 	return  dm_bht_verify_path(bht, block, pg, offset);
 }
-EXPORT_SYMBOL(dm_bht_verify_block);
 
 /**
  * dm_bht_destroy - cleans up all memory used by @bht
@@ -596,7 +589,6 @@
 			crypto_free_hash(bht->hash_desc[cpu].tfm);
 	return 0;
 }
-EXPORT_SYMBOL(dm_bht_destroy);
 
 /*-----------------------------------------------
  * Accessors
@@ -610,7 +602,6 @@
 {
 	return bht->sectors;
 }
-EXPORT_SYMBOL(dm_bht_sectors);
 
 /**
  * dm_bht_set_read_cb - set read callback
@@ -621,7 +612,6 @@
 {
 	bht->read_cb = read_cb;
 }
-EXPORT_SYMBOL(dm_bht_set_read_cb);
 
 /**
  * dm_bht_set_root_hexdigest - sets an unverified root digest hash from hex
@@ -644,7 +634,6 @@
 #endif
 	return 0;
 }
-EXPORT_SYMBOL(dm_bht_set_root_hexdigest);
 
 /**
  * dm_bht_root_hexdigest - returns root digest in hex
@@ -662,7 +651,6 @@
 	dm_bht_bin_to_hex(bht->root_digest, hexdigest, bht->digest_size);
 	return 0;
 }
-EXPORT_SYMBOL(dm_bht_root_hexdigest);
 
 /**
  * dm_bht_set_salt - sets the salt used, in hex
diff --git a/include/linux/module.h b/include/linux/module.h
deleted file mode 100644
index 7d85283..0000000
--- a/include/linux/module.h
+++ /dev/null
@@ -1,18 +0,0 @@
-/* Copyright (C) 2012 The Chromium OS Authors. All rights reserved.
- * Use of this source code is governed by the GPL v2 license that can
- * be found in the LICENSE file.
- *
- * Parts of this file are derived from the Linux kernel from the file with
- * the same name and path under include/.
- */
-#ifndef VERITY_INCLUDE_LINUX_MODULE_H_
-#define VERITY_INCLUDE_LINUX_MODULE_H_
-
-#define EXPORT_SYMBOL(x)
-#define MODULE_LICENSE(x)
-#define MODULE_DESCRIPTION(x)
-#define MODULE_ALIAS(x)
-
-#define THIS_MODULE NULL
-
-#endif  /* VERITY_INCLUDE_LINUX_MODULE_H_ */
diff --git a/kernel/md5.c b/kernel/md5.c
index c777180..f5a4693 100644
--- a/kernel/md5.c
+++ b/kernel/md5.c
@@ -1,5 +1,4 @@
 #include <linux/kernel.h>
-#include <linux/module.h>
 #include <linux/cryptohash.h>
 
 #define F1(x, y, z)	(z ^ (x & (y ^ z)))
@@ -92,4 +91,3 @@
 	hash[2] += c;
 	hash[3] += d;
 }
-EXPORT_SYMBOL(md5_transform);
diff --git a/kernel/md5_generic.c b/kernel/md5_generic.c
index 7febeaa..ceab5d4 100644
--- a/kernel/md5_generic.c
+++ b/kernel/md5_generic.c
@@ -18,7 +18,6 @@
 #include <crypto/internal/hash.h>
 #include <crypto/md5.h>
 #include <linux/init.h>
-#include <linux/module.h>
 #include <linux/string.h>
 #include <linux/types.h>
 #include <linux/cryptohash.h>
@@ -149,7 +148,7 @@
 		.cra_name	=	"md5",
 		.cra_flags	=	CRYPTO_ALG_TYPE_SHASH,
 		.cra_blocksize	=	MD5_HMAC_BLOCK_SIZE,
-		.cra_module	=	THIS_MODULE,
+		.cra_module	=	NULL,
 	}
 };
 
@@ -165,6 +164,3 @@
 
 module_init(md5_mod_init);
 module_exit(md5_mod_fini);
-
-MODULE_LICENSE("GPL");
-MODULE_DESCRIPTION("MD5 Message Digest Algorithm");
diff --git a/kernel/sha1.c b/kernel/sha1.c
index f33271d..fe1518b 100644
--- a/kernel/sha1.c
+++ b/kernel/sha1.c
@@ -6,7 +6,6 @@
  */
 
 #include <linux/kernel.h>
-#include <linux/module.h>
 #include <linux/bitops.h>
 #include <asm/unaligned.h>
 
@@ -183,7 +182,6 @@
 	digest[3] += D;
 	digest[4] += E;
 }
-EXPORT_SYMBOL(sha_transform);
 
 /**
  * sha_init - initialize the vectors for a SHA1 digest
diff --git a/kernel/sha1_generic.c b/kernel/sha1_generic.c
index 0416091..4327a99 100644
--- a/kernel/sha1_generic.c
+++ b/kernel/sha1_generic.c
@@ -18,7 +18,6 @@
  */
 #include <crypto/internal/hash.h>
 #include <linux/init.h>
-#include <linux/module.h>
 #include <linux/mm.h>
 #include <linux/cryptohash.h>
 #include <linux/types.h>
@@ -131,7 +130,7 @@
 		.cra_driver_name=	"sha1-generic",
 		.cra_flags	=	CRYPTO_ALG_TYPE_SHASH,
 		.cra_blocksize	=	SHA1_BLOCK_SIZE,
-		.cra_module	=	THIS_MODULE,
+		.cra_module	=	NULL,
 	}
 };
 
@@ -147,8 +146,3 @@
 
 module_init(sha1_generic_mod_init);
 module_exit(sha1_generic_mod_fini);
-
-MODULE_LICENSE("GPL");
-MODULE_DESCRIPTION("SHA1 Secure Hash Algorithm");
-
-MODULE_ALIAS("sha1");
diff --git a/kernel/sha256_generic.c b/kernel/sha256_generic.c
index 24df957..6db50d4 100644
--- a/kernel/sha256_generic.c
+++ b/kernel/sha256_generic.c
@@ -19,7 +19,6 @@
  */
 #include <crypto/internal/hash.h>
 #include <linux/init.h>
-#include <linux/module.h>
 #include <linux/mm.h>
 #include <linux/types.h>
 #include <crypto/sha.h>
@@ -350,7 +349,7 @@
 		.cra_driver_name=	"sha256-generic",
 		.cra_flags	=	CRYPTO_ALG_TYPE_SHASH,
 		.cra_blocksize	=	SHA256_BLOCK_SIZE,
-		.cra_module	=	THIS_MODULE,
+		.cra_module	=	NULL,
 	}
 };
 
@@ -365,7 +364,7 @@
 		.cra_driver_name=	"sha224-generic",
 		.cra_flags	=	CRYPTO_ALG_TYPE_SHASH,
 		.cra_blocksize	=	SHA224_BLOCK_SIZE,
-		.cra_module	=	THIS_MODULE,
+		.cra_module	=	NULL,
 	}
 };
 
@@ -394,9 +393,3 @@
 
 module_init(sha256_generic_mod_init);
 module_exit(sha256_generic_mod_fini);
-
-MODULE_LICENSE("GPL");
-MODULE_DESCRIPTION("SHA-224 and SHA-256 Secure Hash Algorithm");
-
-MODULE_ALIAS("sha224");
-MODULE_ALIAS("sha256");
diff --git a/kernel/sha512_generic.c b/kernel/sha512_generic.c
index 9ed9f60..2236498 100644
--- a/kernel/sha512_generic.c
+++ b/kernel/sha512_generic.c
@@ -12,7 +12,6 @@
  */
 #include <crypto/internal/hash.h>
 #include <linux/kernel.h>
-#include <linux/module.h>
 #include <linux/mm.h>
 #include <linux/init.h>
 #include <linux/crypto.h>
@@ -255,7 +254,7 @@
 		.cra_name	=	"sha512",
 		.cra_flags	=	CRYPTO_ALG_TYPE_SHASH,
 		.cra_blocksize	=	SHA512_BLOCK_SIZE,
-		.cra_module	=	THIS_MODULE,
+		.cra_module	=	NULL,
 	}
 };
 
@@ -269,7 +268,7 @@
 		.cra_name	=	"sha384",
 		.cra_flags	=	CRYPTO_ALG_TYPE_SHASH,
 		.cra_blocksize	=	SHA384_BLOCK_SIZE,
-		.cra_module	=	THIS_MODULE,
+		.cra_module	=	NULL,
 	}
 };
 
@@ -293,9 +292,3 @@
 
 module_init(sha512_generic_mod_init);
 module_exit(sha512_generic_mod_fini);
-
-MODULE_LICENSE("GPL");
-MODULE_DESCRIPTION("SHA-512 and SHA-384 Secure Hash Algorithms");
-
-MODULE_ALIAS("sha384");
-MODULE_ALIAS("sha512");