crypto: api - Replace kernel.h with the necessary inclusions
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Fri, 10 Dec 2021 14:30:09 +0000 (16:30 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 17 Dec 2021 05:59:48 +0000 (16:59 +1100)
When kernel.h is used in the headers it adds a lot into dependency hell,
especially when there are circular dependencies are involved.

Replace kernel.h inclusion with the list of what is really being used.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
include/crypto/aead.h
include/crypto/algapi.h
include/crypto/blake2b.h
include/crypto/blake2s.h
include/crypto/cryptd.h
include/crypto/engine.h
include/crypto/pcrypt.h
include/crypto/scatterwalk.h
include/crypto/skcipher.h

index 5af914c1ab8eeb59649b9ad00a4c3f5174f2570c..14db3bee0519ee850369d6bc4ecb017d3f105f6d 100644 (file)
@@ -8,9 +8,10 @@
 #ifndef _CRYPTO_AEAD_H
 #define _CRYPTO_AEAD_H
 
+#include <linux/container_of.h>
 #include <linux/crypto.h>
-#include <linux/kernel.h>
 #include <linux/slab.h>
+#include <linux/types.h>
 
 /**
  * DOC: Authenticated Encryption With Associated Data (AEAD) Cipher API
@@ -73,6 +74,7 @@
  */
 
 struct crypto_aead;
+struct scatterlist;
 
 /**
  *     struct aead_request - AEAD request
index 5f6841c73e5a753d58bc17ff33a437ae2b12b486..f76ec723ceaee086c49d4420ee15b6f47e5bc225 100644 (file)
@@ -7,9 +7,11 @@
 #ifndef _CRYPTO_ALGAPI_H
 #define _CRYPTO_ALGAPI_H
 
+#include <linux/align.h>
 #include <linux/crypto.h>
+#include <linux/kconfig.h>
 #include <linux/list.h>
-#include <linux/kernel.h>
+#include <linux/types.h>
 
 /*
  * Maximum values for blocksize and alignmask, used to allocate
@@ -24,6 +26,7 @@
 struct crypto_aead;
 struct crypto_instance;
 struct module;
+struct notifier_block;
 struct rtattr;
 struct seq_file;
 struct sk_buff;
index 18875f16f8cadf58f8f804454259ac92adcb3e54..0c01762853494efc3e59479b603faaf83d091f6c 100644 (file)
@@ -5,7 +5,6 @@
 
 #include <linux/bug.h>
 #include <linux/types.h>
-#include <linux/kernel.h>
 #include <linux/string.h>
 
 enum blake2b_lengths {
index bc3fb59442ce5e87a45c02560dc83523a7f18e60..df3c6c2f95531ea777c14113fa79ff0b205af5e9 100644 (file)
@@ -7,8 +7,8 @@
 #define _CRYPTO_BLAKE2S_H
 
 #include <linux/bug.h>
+#include <linux/kconfig.h>
 #include <linux/types.h>
-#include <linux/kernel.h>
 #include <linux/string.h>
 
 enum blake2s_lengths {
index 23169f4d87e6387f69a8e90bec0f04836a1a2531..796d986e58e118d9f415fb3cd663f91bc6d0a663 100644 (file)
@@ -13,7 +13,8 @@
 #ifndef _CRYPTO_CRYPT_H
 #define _CRYPTO_CRYPT_H
 
-#include <linux/kernel.h>
+#include <linux/types.h>
+
 #include <crypto/aead.h>
 #include <crypto/hash.h>
 #include <crypto/skcipher.h>
index fd4f2fa23f51c54c78436108718af8bf93b6c5e0..ae133e98d8131c38999540c67f57e8dcca7f8744 100644 (file)
@@ -9,8 +9,10 @@
 
 #include <linux/crypto.h>
 #include <linux/list.h>
-#include <linux/kernel.h>
 #include <linux/kthread.h>
+#include <linux/spinlock.h>
+#include <linux/types.h>
+
 #include <crypto/algapi.h>
 #include <crypto/aead.h>
 #include <crypto/akcipher.h>
@@ -18,6 +20,8 @@
 #include <crypto/skcipher.h>
 #include <crypto/kpp.h>
 
+struct device;
+
 #define ENGINE_NAME_LEN        30
 /*
  * struct crypto_engine - crypto hardware engine
index b9bc3436196a35bb04ff0f72b47b10406d85389d..234d7cf3cf5ead658c97356003c599433a7fc3e5 100644 (file)
@@ -9,8 +9,8 @@
 #ifndef _CRYPTO_PCRYPT_H
 #define _CRYPTO_PCRYPT_H
 
+#include <linux/container_of.h>
 #include <linux/crypto.h>
-#include <linux/kernel.h>
 #include <linux/padata.h>
 
 struct pcrypt_request {
index 7af08174a7212c88f75f20da8280494b987667c1..6407b4b61350d9615d1a59723daaf2de7444020e 100644 (file)
@@ -12,8 +12,9 @@
 #define _CRYPTO_SCATTERWALK_H
 
 #include <crypto/algapi.h>
+
 #include <linux/highmem.h>
-#include <linux/kernel.h>
+#include <linux/mm.h>
 #include <linux/scatterlist.h>
 
 static inline void scatterwalk_crypto_chain(struct scatterlist *head,
index ef0fc9ed4342e6dca5f48efb2e705877c576d7f1..39f5b67c3069808a78282528e2ca486d1f1b4ba0 100644 (file)
@@ -8,9 +8,13 @@
 #ifndef _CRYPTO_SKCIPHER_H
 #define _CRYPTO_SKCIPHER_H
 
+#include <linux/container_of.h>
 #include <linux/crypto.h>
-#include <linux/kernel.h>
 #include <linux/slab.h>
+#include <linux/string.h>
+#include <linux/types.h>
+
+struct scatterlist;
 
 /**
  *     struct skcipher_request - Symmetric key cipher request