diff mbox series

crypto: x86/camellia - Replace kernel.h with the necessary inclusions

Message ID 65634fb748cc0ce2cc5bafaf904cb5f76bd4edc4.1654414362.git.christophe.jaillet@wanadoo.fr
State New
Headers show
Series crypto: x86/camellia - Replace kernel.h with the necessary inclusions | expand

Commit Message

Christophe JAILLET June 5, 2022, 7:32 a.m. UTC
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: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 arch/x86/crypto/camellia.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Herbert Xu June 9, 2022, 10:15 a.m. UTC | #1
On Sun, Jun 05, 2022 at 09:32:53AM +0200, Christophe JAILLET wrote:
> 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: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
>  arch/x86/crypto/camellia.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/x86/crypto/camellia.h b/arch/x86/crypto/camellia.h
> index 1dcea79e8f8e..547fb7e30928 100644
> --- a/arch/x86/crypto/camellia.h
> +++ b/arch/x86/crypto/camellia.h
> @@ -4,7 +4,7 @@
>  
>  #include <crypto/b128ops.h>
>  #include <linux/crypto.h>
> -#include <linux/kernel.h>
> +#include <linux/types.h>
>  
>  #define CAMELLIA_MIN_KEY_SIZE	16
>  #define CAMELLIA_MAX_KEY_SIZE	32

This is not sufficient.  For example, asmlinkage isn't explicitly
defined by any of these header files so it would be relying on an
implicit inclusion which is prone to breakage.

Did you audit the entire file?

Cheers,
diff mbox series

Patch

diff --git a/arch/x86/crypto/camellia.h b/arch/x86/crypto/camellia.h
index 1dcea79e8f8e..547fb7e30928 100644
--- a/arch/x86/crypto/camellia.h
+++ b/arch/x86/crypto/camellia.h
@@ -4,7 +4,7 @@ 
 
 #include <crypto/b128ops.h>
 #include <linux/crypto.h>
-#include <linux/kernel.h>
+#include <linux/types.h>
 
 #define CAMELLIA_MIN_KEY_SIZE	16
 #define CAMELLIA_MAX_KEY_SIZE	32