Linux cryptographic layer development
 help / color / mirror / Atom feed
* [PATCH] x86_crypto: Fix build warnings about export.h
@ 2025-06-11  2:51 “ChengZhenghan”
  2025-06-11  2:57 ` Herbert Xu
  0 siblings, 1 reply; 3+ messages in thread
From: “ChengZhenghan” @ 2025-06-11  2:51 UTC (permalink / raw)
  To: Herbert Xu, David S . Miller, Thomas Gleixner, Ingo Molnar,
	Borislav Petkov, Dave Hansen, x86, linux-crypto, linux-kernel
  Cc: H . Peter Anvin, ChengZhenghan

From: ChengZhenghan <chengzhenghan@uniontech.com>

I got some build warnings with W=1:
arch/x86/coco/sev/core.c:
arch/x86/crypto/aria_aesni_avx2_glue.c:
 warning: EXPORT_SYMBOL() is used,
 but #include <linux/export.h> is missing
arch/x86/crypto/aria_aesni_avx_glue.c:
 warning: EXPORT_SYMBOL() is used,
 but #include <linux/export.h> is missing
arch/x86/crypto/camellia_aesni_avx_glue.c:
 warning: EXPORT_SYMBOL() is used,
 but #include <linux/export.h> is missing
arch/x86/crypto/camellia_glue.c: warning:
 EXPORT_SYMBOL() is used,
 but #include <linux/export.h> is missing
arch/x86/crypto/curve25519-x86_64.c:
 warning: EXPORT_SYMBOL() is used,
 but #include <linux/export.h> is missing
arch/x86/crypto/serpent_avx_glue.c:
 warning: EXPORT_SYMBOL() is used,
 but #include <linux/export.h> is missing
arch/x86/crypto/sm4_aesni_avx_glue.c:
 warning: EXPORT_SYMBOL() is used,
 but #include <linux/export.h> is missing
arch/x86/crypto/twofish_glue.c:
 warning: EXPORT_SYMBOL() is used,
 but #include <linux/export.h> is missing
arch/x86/crypto/twofish_glue_3way.c:
 warning: EXPORT_SYMBOL() is used,
 but #include <linux/export.h> is missing
so I fixed these build warnings for x86_64.

Signed-off-by: ChengZhenghan <chengzhenghan@uniontech.com>
---
 arch/x86/crypto/aria_aesni_avx2_glue.c    | 1 +
 arch/x86/crypto/aria_aesni_avx_glue.c     | 1 +
 arch/x86/crypto/camellia_aesni_avx_glue.c | 1 +
 arch/x86/crypto/camellia_glue.c           | 1 +
 arch/x86/crypto/curve25519-x86_64.c       | 1 +
 arch/x86/crypto/serpent_avx_glue.c        | 1 +
 arch/x86/crypto/sm4_aesni_avx_glue.c      | 1 +
 arch/x86/crypto/twofish_glue.c            | 1 +
 arch/x86/crypto/twofish_glue_3way.c       | 1 +
 9 files changed, 9 insertions(+)

diff --git a/arch/x86/crypto/aria_aesni_avx2_glue.c b/arch/x86/crypto/aria_aesni_avx2_glue.c
index b4bddcd58457..007b250f774c 100644
--- a/arch/x86/crypto/aria_aesni_avx2_glue.c
+++ b/arch/x86/crypto/aria_aesni_avx2_glue.c
@@ -9,6 +9,7 @@
 #include <crypto/aria.h>
 #include <linux/crypto.h>
 #include <linux/err.h>
+#include <linux/export.h>
 #include <linux/module.h>
 #include <linux/types.h>
 
diff --git a/arch/x86/crypto/aria_aesni_avx_glue.c b/arch/x86/crypto/aria_aesni_avx_glue.c
index ab9b38d05332..4c88ef4eba82 100644
--- a/arch/x86/crypto/aria_aesni_avx_glue.c
+++ b/arch/x86/crypto/aria_aesni_avx_glue.c
@@ -9,6 +9,7 @@
 #include <crypto/aria.h>
 #include <linux/crypto.h>
 #include <linux/err.h>
+#include <linux/export.h>
 #include <linux/module.h>
 #include <linux/types.h>
 
diff --git a/arch/x86/crypto/camellia_aesni_avx_glue.c b/arch/x86/crypto/camellia_aesni_avx_glue.c
index a7d162388142..5c321f255eb7 100644
--- a/arch/x86/crypto/camellia_aesni_avx_glue.c
+++ b/arch/x86/crypto/camellia_aesni_avx_glue.c
@@ -8,6 +8,7 @@
 #include <crypto/algapi.h>
 #include <linux/crypto.h>
 #include <linux/err.h>
+#include <linux/export.h>
 #include <linux/module.h>
 #include <linux/types.h>
 
diff --git a/arch/x86/crypto/camellia_glue.c b/arch/x86/crypto/camellia_glue.c
index 3bd37d664121..cf4cb5daee92 100644
--- a/arch/x86/crypto/camellia_glue.c
+++ b/arch/x86/crypto/camellia_glue.c
@@ -13,6 +13,7 @@
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/types.h>
+#include <linux/export.h>
 #include <crypto/algapi.h>
 
 #include "camellia.h"
diff --git a/arch/x86/crypto/curve25519-x86_64.c b/arch/x86/crypto/curve25519-x86_64.c
index dcfc0de333de..d587f05c3c8c 100644
--- a/arch/x86/crypto/curve25519-x86_64.c
+++ b/arch/x86/crypto/curve25519-x86_64.c
@@ -7,6 +7,7 @@
 #include <crypto/curve25519.h>
 #include <crypto/internal/kpp.h>
 
+#include <linux/export.h>
 #include <linux/types.h>
 #include <linux/jump_label.h>
 #include <linux/kernel.h>
diff --git a/arch/x86/crypto/serpent_avx_glue.c b/arch/x86/crypto/serpent_avx_glue.c
index e640abc1cb8a..9c8b3a335d5c 100644
--- a/arch/x86/crypto/serpent_avx_glue.c
+++ b/arch/x86/crypto/serpent_avx_glue.c
@@ -12,6 +12,7 @@
 #include <linux/types.h>
 #include <linux/crypto.h>
 #include <linux/err.h>
+#include <linux/export.h>
 #include <crypto/algapi.h>
 #include <crypto/serpent.h>
 
diff --git a/arch/x86/crypto/sm4_aesni_avx_glue.c b/arch/x86/crypto/sm4_aesni_avx_glue.c
index 72867fc49ce8..88caf418a06f 100644
--- a/arch/x86/crypto/sm4_aesni_avx_glue.c
+++ b/arch/x86/crypto/sm4_aesni_avx_glue.c
@@ -11,6 +11,7 @@
 #include <asm/fpu/api.h>
 #include <linux/module.h>
 #include <linux/crypto.h>
+#include <linux/export.h>
 #include <linux/kernel.h>
 #include <crypto/internal/skcipher.h>
 #include <crypto/sm4.h>
diff --git a/arch/x86/crypto/twofish_glue.c b/arch/x86/crypto/twofish_glue.c
index 4c67184dc573..9f6b5e858f1d 100644
--- a/arch/x86/crypto/twofish_glue.c
+++ b/arch/x86/crypto/twofish_glue.c
@@ -42,6 +42,7 @@
 #include <crypto/twofish.h>
 #include <linux/init.h>
 #include <linux/module.h>
+#include <linux/export.h>
 #include <linux/types.h>
 
 asmlinkage void twofish_enc_blk(struct twofish_ctx *ctx, u8 *dst,
diff --git a/arch/x86/crypto/twofish_glue_3way.c b/arch/x86/crypto/twofish_glue_3way.c
index 1a1ecfa7f72a..8ec3adb085f3 100644
--- a/arch/x86/crypto/twofish_glue_3way.c
+++ b/arch/x86/crypto/twofish_glue_3way.c
@@ -12,6 +12,7 @@
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/types.h>
+#include <linux/export.h>
 
 #include "twofish.h"
 #include "ecb_cbc_helpers.h"
-- 
2.47.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] x86_crypto: Fix build warnings about export.h
  2025-06-11  2:51 [PATCH] x86_crypto: Fix build warnings about export.h “ChengZhenghan”
@ 2025-06-11  2:57 ` Herbert Xu
  0 siblings, 0 replies; 3+ messages in thread
From: Herbert Xu @ 2025-06-11  2:57 UTC (permalink / raw)
  To: “ChengZhenghan”
  Cc: David S . Miller, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Dave Hansen, x86, linux-crypto, linux-kernel, H . Peter Anvin

On Wed, Jun 11, 2025 at 10:51:31AM +0800, “ChengZhenghan” wrote:
> From: ChengZhenghan <chengzhenghan@uniontech.com>
> 
> I got some build warnings with W=1:
> arch/x86/coco/sev/core.c:
> arch/x86/crypto/aria_aesni_avx2_glue.c:
>  warning: EXPORT_SYMBOL() is used,
>  but #include <linux/export.h> is missing
> arch/x86/crypto/aria_aesni_avx_glue.c:
>  warning: EXPORT_SYMBOL() is used,
>  but #include <linux/export.h> is missing
> arch/x86/crypto/camellia_aesni_avx_glue.c:
>  warning: EXPORT_SYMBOL() is used,
>  but #include <linux/export.h> is missing
> arch/x86/crypto/camellia_glue.c: warning:
>  EXPORT_SYMBOL() is used,
>  but #include <linux/export.h> is missing
> arch/x86/crypto/curve25519-x86_64.c:
>  warning: EXPORT_SYMBOL() is used,
>  but #include <linux/export.h> is missing
> arch/x86/crypto/serpent_avx_glue.c:
>  warning: EXPORT_SYMBOL() is used,
>  but #include <linux/export.h> is missing
> arch/x86/crypto/sm4_aesni_avx_glue.c:
>  warning: EXPORT_SYMBOL() is used,
>  but #include <linux/export.h> is missing
> arch/x86/crypto/twofish_glue.c:
>  warning: EXPORT_SYMBOL() is used,
>  but #include <linux/export.h> is missing
> arch/x86/crypto/twofish_glue_3way.c:
>  warning: EXPORT_SYMBOL() is used,
>  but #include <linux/export.h> is missing
> so I fixed these build warnings for x86_64.
> 
> Signed-off-by: ChengZhenghan <chengzhenghan@uniontech.com>
> ---
>  arch/x86/crypto/aria_aesni_avx2_glue.c    | 1 +
>  arch/x86/crypto/aria_aesni_avx_glue.c     | 1 +
>  arch/x86/crypto/camellia_aesni_avx_glue.c | 1 +
>  arch/x86/crypto/camellia_glue.c           | 1 +
>  arch/x86/crypto/curve25519-x86_64.c       | 1 +
>  arch/x86/crypto/serpent_avx_glue.c        | 1 +
>  arch/x86/crypto/sm4_aesni_avx_glue.c      | 1 +
>  arch/x86/crypto/twofish_glue.c            | 1 +
>  arch/x86/crypto/twofish_glue_3way.c       | 1 +
>  9 files changed, 9 insertions(+)

module.h always includes export.h so this is not needed at all.

Cheers,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] x86_crypto: Fix build warnings about export.h
@ 2025-06-11  3:33 “ChengZhenghan”
  0 siblings, 0 replies; 3+ messages in thread
From: “ChengZhenghan” @ 2025-06-11  3:33 UTC (permalink / raw)
  To: Herbert Xu, David S . Miller, Thomas Gleixner, Ingo Molnar,
	Borislav Petkov, Dave Hansen, x86, linux-crypto, linux-kernel
  Cc: H . Peter Anvin, ChengZhenghan, WangYuli

Dear Herbert Xu,

I hope this email finds you well.

My patch aims to resolve the issue where indirect header inclusion fails to work when the compiler warning level is set to W=1. Under W=1, this warning appears.

A similar patch addressing a related issue can be found here:
https://lore.kernel.org/linux-kbuild/CAK7LNARQFBuUY2YzUnPuyEdTAVy=B91L5NyYGzhY-kAr3SYsRQ@mail.gmail.com/T/#mbc002a0dcd1607c273295caedecfd827fb2da54e

Thank you for your time and consideration!

Best regards,
Cheng Zhenghan

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-06-11  3:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-11  2:51 [PATCH] x86_crypto: Fix build warnings about export.h “ChengZhenghan”
2025-06-11  2:57 ` Herbert Xu
  -- strict thread matches above, loose matches on Subject: below --
2025-06-11  3:33 “ChengZhenghan”

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox