linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] init: Fix build warnings about export.h
@ 2025-06-08 14:12 Huacai Chen
  2025-06-09  0:36 ` Masahiro Yamada
  0 siblings, 1 reply; 2+ messages in thread
From: Huacai Chen @ 2025-06-08 14:12 UTC (permalink / raw)
  To: Masahiro Yamada, linux-kbuild, Andrew Morton, Alexander Viro,
	Christian Brauner, Jan Kara
  Cc: chenhuacai, linux-mm, linux-kernel, Huacai Chen

After commit a934a57a42f64a4 ("scripts/misc-check: check missing #include
<linux/export.h> when W=1") and 7d95680d64ac8e836c ("scripts/misc-check:
check unnecessary #include <linux/export.h> when W=1"), we get some build
warnings with W=1:

init/main.c: warning: EXPORT_SYMBOL() is used, but #include <linux/export.h> is missing
init/initramfs.c: warning: EXPORT_SYMBOL() is used, but #include <linux/export.h> is missing

So fix these build warnings for the init code.

Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
---
 init/initramfs.c | 1 +
 init/main.c      | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/init/initramfs.c b/init/initramfs.c
index 72bad44a1d41..097673b97784 100644
--- a/init/initramfs.c
+++ b/init/initramfs.c
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0
 #include <linux/init.h>
 #include <linux/async.h>
+#include <linux/export.h>
 #include <linux/fs.h>
 #include <linux/slab.h>
 #include <linux/types.h>
diff --git a/init/main.c b/init/main.c
index 2cf5e9ea84d8..bfdf0fd76eb3 100644
--- a/init/main.c
+++ b/init/main.c
@@ -12,7 +12,8 @@
 
 #define DEBUG		/* Enable initcall_debug */
 
 #include <linux/types.h>
+#include <linux/export.h>
 #include <linux/extable.h>
 #include <linux/module.h>
 #include <linux/proc_fs.h>
-- 
2.47.1


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

* Re: [PATCH] init: Fix build warnings about export.h
  2025-06-08 14:12 [PATCH] init: Fix build warnings about export.h Huacai Chen
@ 2025-06-09  0:36 ` Masahiro Yamada
  0 siblings, 0 replies; 2+ messages in thread
From: Masahiro Yamada @ 2025-06-09  0:36 UTC (permalink / raw)
  To: Huacai Chen
  Cc: linux-kbuild, Andrew Morton, Alexander Viro, Christian Brauner,
	Jan Kara, chenhuacai, linux-mm, linux-kernel

On Sun, Jun 8, 2025 at 11:12 PM Huacai Chen <chenhuacai@loongson.cn> wrote:
>
> After commit a934a57a42f64a4 ("scripts/misc-check: check missing #include
> <linux/export.h> when W=1") and 7d95680d64ac8e836c ("scripts/misc-check:
> check unnecessary #include <linux/export.h> when W=1"), we get some build
> warnings with W=1:
>
> init/main.c: warning: EXPORT_SYMBOL() is used, but #include <linux/export.h> is missing
> init/initramfs.c: warning: EXPORT_SYMBOL() is used, but #include <linux/export.h> is missing
>
> So fix these build warnings for the init code.
>
> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>

Thank you for your contribution.

Reviewed-by: Masahiro Yamada <masahiroy@kernel.org>


-- 
Best Regards
Masahiro Yamada

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

end of thread, other threads:[~2025-06-09  0:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-08 14:12 [PATCH] init: Fix build warnings about export.h Huacai Chen
2025-06-09  0:36 ` Masahiro Yamada

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).