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.
Unified · Split
| @@ -8,9 +8,10 @@ · 7 unmodified lines | ||
| 8 | 8 | #ifndef _CRYPTO_AEAD_H |
| 9 | 9 | #define _CRYPTO_AEAD_H |
| 10 | 10 | |
| 11 | +#include <linux/container_of.h> | |
| 11 | 12 | #include <linux/crypto.h> |
| 12 | −#include <linux/kernel.h> | |
| 13 | 13 | #include <linux/slab.h> |
| 14 | +#include <linux/types.h> | |
| 14 | 15 | |
| 15 | 16 | /** |
| 16 | 17 | * DOC: Authenticated Encryption With Associated Data (AEAD) Cipher API |
| @@ -73,6 +74,7 @@ · 56 unmodified lines | ||
| 73 | 74 | */ |
| 74 | 75 | |
| 75 | 76 | struct crypto_aead; |
| 77 | +struct scatterlist; | |
| 76 | 78 | |
| 77 | 79 | /** |
| 78 | 80 | * struct aead_request - AEAD request |
| @@ -7,9 +7,11 @@ · 6 unmodified lines | ||
| 7 | 7 | #ifndef _CRYPTO_ALGAPI_H |
| 8 | 8 | #define _CRYPTO_ALGAPI_H |
| 9 | 9 | |
| 10 | +#include <linux/align.h> | |
| 10 | 11 | #include <linux/crypto.h> |
| 12 | +#include <linux/kconfig.h> | |
| 11 | 13 | #include <linux/list.h> |
| 12 | −#include <linux/kernel.h> | |
| 14 | +#include <linux/types.h> | |
| 13 | 15 | |
| 14 | 16 | /* |
| 15 | 17 | * Maximum values for blocksize and alignmask, used to allocate |
| @@ -24,6 +26,7 @@ · 8 unmodified lines | ||
| 24 | 26 | struct crypto_aead; |
| 25 | 27 | struct crypto_instance; |
| 26 | 28 | struct module; |
| 29 | +struct notifier_block; | |
| 27 | 30 | struct rtattr; |
| 28 | 31 | struct seq_file; |
| 29 | 32 | struct sk_buff; |
| @@ -5,7 +5,6 @@ · 4 unmodified lines | ||
| 5 | 5 | |
| 6 | 6 | #include <linux/bug.h> |
| 7 | 7 | #include <linux/types.h> |
| 8 | −#include <linux/kernel.h> | |
| 9 | 8 | #include <linux/string.h> |
| 10 | 9 | |
| 11 | 10 | enum blake2b_lengths { |
| @@ -7,8 +7,8 @@ · 6 unmodified lines | ||
| 7 | 7 | #define _CRYPTO_BLAKE2S_H |
| 8 | 8 | |
| 9 | 9 | #include <linux/bug.h> |
| 10 | +#include <linux/kconfig.h> | |
| 10 | 11 | #include <linux/types.h> |
| 11 | −#include <linux/kernel.h> | |
| 12 | 12 | #include <linux/string.h> |
| 13 | 13 | |
| 14 | 14 | enum blake2s_lengths { |
| @@ -13,7 +13,8 @@ · 12 unmodified lines | ||
| 13 | 13 | #ifndef _CRYPTO_CRYPT_H |
| 14 | 14 | #define _CRYPTO_CRYPT_H |
| 15 | 15 | |
| 16 | −#include <linux/kernel.h> | |
| 16 | +#include <linux/types.h> | |
| 17 | + | |
| 17 | 18 | #include <crypto/aead.h> |
| 18 | 19 | #include <crypto/hash.h> |
| 19 | 20 | #include <crypto/skcipher.h> |
| @@ -9,8 +9,10 @@ · 8 unmodified lines | ||
| 9 | 9 | |
| 10 | 10 | #include <linux/crypto.h> |
| 11 | 11 | #include <linux/list.h> |
| 12 | −#include <linux/kernel.h> | |
| 13 | 12 | #include <linux/kthread.h> |
| 13 | +#include <linux/spinlock.h> | |
| 14 | +#include <linux/types.h> | |
| 15 | + | |
| 14 | 16 | #include <crypto/algapi.h> |
| 15 | 17 | #include <crypto/aead.h> |
| 16 | 18 | #include <crypto/akcipher.h> |
| @@ -18,6 +20,8 @@ · 1 unmodified line | ||
| 18 | 20 | #include <crypto/skcipher.h> |
| 19 | 21 | #include <crypto/kpp.h> |
| 20 | 22 | |
| 23 | +struct device; | |
| 24 | + | |
| 21 | 25 | #define ENGINE_NAME_LEN 30 |
| 22 | 26 | /* |
| 23 | 27 | * struct crypto_engine - crypto hardware engine |
| @@ -9,8 +9,8 @@ · 8 unmodified lines | ||
| 9 | 9 | #ifndef _CRYPTO_PCRYPT_H |
| 10 | 10 | #define _CRYPTO_PCRYPT_H |
| 11 | 11 | |
| 12 | +#include <linux/container_of.h> | |
| 12 | 13 | #include <linux/crypto.h> |
| 13 | −#include <linux/kernel.h> | |
| 14 | 14 | #include <linux/padata.h> |
| 15 | 15 | |
| 16 | 16 | struct pcrypt_request { |
| @@ -12,8 +12,9 @@ · 11 unmodified lines | ||
| 12 | 12 | #define _CRYPTO_SCATTERWALK_H |
| 13 | 13 | |
| 14 | 14 | #include <crypto/algapi.h> |
| 15 | + | |
| 15 | 16 | #include <linux/highmem.h> |
| 16 | −#include <linux/kernel.h> | |
| 17 | +#include <linux/mm.h> | |
| 17 | 18 | #include <linux/scatterlist.h> |
| 18 | 19 | |
| 19 | 20 | static inline void scatterwalk_crypto_chain(struct scatterlist *head, |
| @@ -8,9 +8,13 @@ · 7 unmodified lines | ||
| 8 | 8 | #ifndef _CRYPTO_SKCIPHER_H |
| 9 | 9 | #define _CRYPTO_SKCIPHER_H |
| 10 | 10 | |
| 11 | +#include <linux/container_of.h> | |
| 11 | 12 | #include <linux/crypto.h> |
| 12 | −#include <linux/kernel.h> | |
| 13 | 13 | #include <linux/slab.h> |
| 14 | +#include <linux/string.h> | |
| 15 | +#include <linux/types.h> | |
| 16 | + | |
| 17 | +struct scatterlist; | |
| 14 | 18 | |
| 15 | 19 | /** |
| 16 | 20 | * struct skcipher_request - Symmetric key cipher request |