From: "Tiwei Bie" <tiwei.btw@antgroup.com>
To: richard@nod.at, anton.ivanov@cambridgegreys.com,
johannes@sipsolutions.net
Cc: <linux-um@lists.infradead.org>, <linux-kernel@vger.kernel.org>,
"Tiwei Bie" <tiwei.btw@antgroup.com>
Subject: [PATCH 5/7] um: Add an internal header shared among the user code
Date: Tue, 23 Apr 2024 19:24:55 +0800 [thread overview]
Message-ID: <20240423112457.2409319-6-tiwei.btw@antgroup.com> (raw)
In-Reply-To: <20240423112457.2409319-1-tiwei.btw@antgroup.com>
Move relevant declarations to this header. This will address
below -Wmissing-prototypes warnings:
arch/um/os-Linux/elf_aux.c:26:13: warning: no previous prototype for ‘scan_elf_aux’ [-Wmissing-prototypes]
arch/um/os-Linux/mem.c:213:13: warning: no previous prototype for ‘check_tmpexec’ [-Wmissing-prototypes]
arch/um/os-Linux/skas/process.c:107:6: warning: no previous prototype for ‘wait_stub_done’ [-Wmissing-prototypes]
Signed-off-by: Tiwei Bie <tiwei.btw@antgroup.com>
---
arch/um/os-Linux/internal.h | 20 ++++++++++++++++++++
arch/um/os-Linux/main.c | 2 --
arch/um/os-Linux/skas/mem.c | 2 --
arch/um/os-Linux/start_up.c | 2 --
arch/um/scripts/Makefile.rules | 3 ++-
5 files changed, 22 insertions(+), 7 deletions(-)
create mode 100644 arch/um/os-Linux/internal.h
diff --git a/arch/um/os-Linux/internal.h b/arch/um/os-Linux/internal.h
new file mode 100644
index 000000000000..2a0ea7853658
--- /dev/null
+++ b/arch/um/os-Linux/internal.h
@@ -0,0 +1,20 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef __UM_OS_LINUX_INTERNAL_H
+#define __UM_OS_LINUX_INTERNAL_H
+
+/*
+ * elf_aux.c
+ */
+extern void scan_elf_aux(char **envp);
+
+/*
+ * mem.c
+ */
+extern void check_tmpexec(void);
+
+/*
+ * skas/process.c
+ */
+extern void wait_stub_done(int pid);
+
+#endif /* __UM_OS_LINUX_INTERNAL_H */
diff --git a/arch/um/os-Linux/main.c b/arch/um/os-Linux/main.c
index e82164f90288..9880cfcb9b8a 100644
--- a/arch/um/os-Linux/main.c
+++ b/arch/um/os-Linux/main.c
@@ -102,8 +102,6 @@ static void setup_env_path(void)
}
}
-extern void scan_elf_aux( char **envp);
-
int __init main(int argc, char **argv, char **envp)
{
char **new_argv;
diff --git a/arch/um/os-Linux/skas/mem.c b/arch/um/os-Linux/skas/mem.c
index 953fb10f3f93..1b0502fb5c75 100644
--- a/arch/um/os-Linux/skas/mem.c
+++ b/arch/um/os-Linux/skas/mem.c
@@ -20,8 +20,6 @@
extern char batch_syscall_stub[], __syscall_stub_start[];
-extern void wait_stub_done(int pid);
-
static inline unsigned long *check_init_stack(struct mm_id * mm_idp,
unsigned long *stack)
{
diff --git a/arch/um/os-Linux/start_up.c b/arch/um/os-Linux/start_up.c
index 6b21061c431c..f920c837428e 100644
--- a/arch/um/os-Linux/start_up.c
+++ b/arch/um/os-Linux/start_up.c
@@ -222,8 +222,6 @@ static void __init check_ptrace(void)
check_sysemu();
}
-extern void check_tmpexec(void);
-
static void __init check_coredump_limit(void)
{
struct rlimit lim;
diff --git a/arch/um/scripts/Makefile.rules b/arch/um/scripts/Makefile.rules
index a8b7d9dab0a6..b8ea5f3bb1fb 100644
--- a/arch/um/scripts/Makefile.rules
+++ b/arch/um/scripts/Makefile.rules
@@ -9,7 +9,8 @@ USER_OBJS += $(filter %_user.o,$(obj-y) $(USER_SINGLE_OBJS))
USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file))
$(USER_OBJS:.o=.%): \
- c_flags = -Wp,-MD,$(depfile) $(USER_CFLAGS) -include $(srctree)/include/linux/kern_levels.h -include user.h $(CFLAGS_$(basetarget).o)
+ c_flags = -Wp,-MD,$(depfile) $(USER_CFLAGS) -include $(srctree)/include/linux/kern_levels.h \
+ -include user.h -include $(srctree)/arch/um/os-Linux/internal.h $(CFLAGS_$(basetarget).o)
# These are like USER_OBJS but filter USER_CFLAGS through unprofile instead of
# using it directly.
--
2.34.1
next prev parent reply other threads:[~2024-04-23 11:25 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-23 11:24 [PATCH 0/7] um: A follow-up series of -Wmissing-prototypes fixes Tiwei Bie
2024-04-23 11:24 ` [PATCH 1/7] um: Fix -Wmissing-prototypes warnings for (rt_)sigreturn Tiwei Bie
2024-04-23 11:24 ` [PATCH 2/7] um: Fix the -Wmissing-prototypes warning for __switch_mm Tiwei Bie
2024-04-23 11:29 ` Johannes Berg
2024-04-23 12:11 ` Tiwei Bie
2024-04-23 11:24 ` [PATCH 3/7] um: Fix the -Wmissing-prototypes warning for get_thread_reg Tiwei Bie
2024-04-23 11:30 ` Johannes Berg
2024-04-23 11:24 ` [PATCH 4/7] um: Fix the declaration of kasan_map_memory Tiwei Bie
2024-04-23 11:24 ` Tiwei Bie [this message]
2024-04-23 11:30 ` [PATCH 5/7] um: Add an internal header shared among the user code Johannes Berg
2024-04-23 12:09 ` Tiwei Bie
2024-04-23 12:22 ` Johannes Berg
2024-04-23 12:29 ` Tiwei Bie
2024-04-23 11:24 ` [PATCH 6/7] um: Fix -Wmissing-prototypes warnings for __vdso_* Tiwei Bie
2024-04-23 11:24 ` [PATCH 7/7] um: Remove unused do_get_thread_area function Tiwei Bie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240423112457.2409319-6-tiwei.btw@antgroup.com \
--to=tiwei.btw@antgroup.com \
--cc=anton.ivanov@cambridgegreys.com \
--cc=johannes@sipsolutions.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-um@lists.infradead.org \
--cc=richard@nod.at \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox