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