Skip to contentSkip to conversation

um: Some minor cleanups

PATCH New Tiwei Bie 1 participant 10 messages Nov 28, 2024

Subsystems (2)
lore
Share & tools
lore

Tiwei Bie

author
#0 lore raw

cover um: Some minor cleanups

Tiwei Bie (9):
um: Mark parse_host_cpu_flags as __init
um: Mark parse_cache_line as __init
um: Mark get_top_address as __init
um: Mark set_stklim as __init
um: Mark install_fatal_handler as __init
um: Mark setup_env_path as __init
um: Remove unused PGD_BOUND macro
um: Remove unused THREAD_NAME_LEN macro
um: Remove unused user_context function

 arch/um/kernel/process.c           | 8 --------
 arch/um/kernel/um_arch.c           | 7 ++++---
 arch/um/os-Linux/main.c            | 8 +++-----
 arch/x86/um/shared/sysdep/ptrace.h | 2 --
 4 files changed, 7 insertions(+), 18 deletions(-)
Signature · 1 line
2.34.1
author
#1 lore raw

PATCH 1/9 um: Mark parse_host_cpu_flags as __init

It's only invoked during boot from get_host_cpu_features().

---
 arch/um/kernel/um_arch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/um/kernel/um_arch.c +1 -1
index 62ddb865eb91..c5e91d3fb64e 100644
@@ -264,7 +264,7 @@ EXPORT_SYMBOL(end_iomem);
 
 #define MIN_VMALLOC (32 * 1024 * 1024)
 
-static void parse_host_cpu_flags(char *line)
+static void __init parse_host_cpu_flags(char *line)
 {
 	int i;
 	for (i = 0; i < 32*NCAPINTS; i++) {
Signature · 1 line
2.34.1
author
#2 lore raw

PATCH 2/9 um: Mark parse_cache_line as __init

In reply to Tiwei Bie

It's only invoked during boot from get_host_cpu_features().

---
 arch/um/kernel/um_arch.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/um/kernel/um_arch.c +2 -1
index c5e91d3fb64e..852267542a06 100644
@@ -272,7 +272,8 @@ static void __init parse_host_cpu_flags(char *line)
 			set_cpu_cap(&boot_cpu_data, i);
 	}
 }
-static void parse_cache_line(char *line)
+
+static void __init parse_cache_line(char *line)
 {
 	long res;
 	char *to_parse = strstr(line, ":");
Signature · 1 line
2.34.1
author
#3 lore raw

PATCH 3/9 um: Mark get_top_address as __init

In reply to Tiwei Bie

It's only invoked during boot from linux_main().

---
 arch/um/kernel/um_arch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/um/kernel/um_arch.c +1 -1
index 852267542a06..3e03a716c6ec 100644
@@ -289,7 +289,7 @@ static void __init parse_cache_line(char *line)
 	}
 }
 
-static unsigned long get_top_address(char **envp)
+static unsigned long __init get_top_address(char **envp)
 {
 	unsigned long top_addr = (unsigned long) &top_addr;
 	int i;
Signature · 1 line
2.34.1
author
#4 lore raw

PATCH 4/9 um: Mark set_stklim as __init

In reply to Tiwei Bie

It's only invoked during boot from main().

---
 arch/um/os-Linux/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/um/os-Linux/main.c +1 -1
index 0afcdeb8995b..cf9697aa17f3 100644
@@ -25,7 +25,7 @@
 
 long elf_aux_hwcap;
 
-static void set_stklim(void)
+static void __init set_stklim(void)
 {
 	struct rlimit lim;
 
Signature · 1 line
2.34.1
author
#5 lore raw

PATCH 5/9 um: Mark install_fatal_handler as __init

In reply to Tiwei Bie

It's only invoked during boot from main().

---
 arch/um/os-Linux/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/um/os-Linux/main.c +1 -1
index cf9697aa17f3..3f394f25e059 100644
@@ -48,7 +48,7 @@ static void last_ditch_exit(int sig)
 	exit(1);
 }
 
-static void install_fatal_handler(int sig)
+static void __init install_fatal_handler(int sig)
 {
 	struct sigaction action;
 
Signature · 1 line
2.34.1
author
#6 lore raw

PATCH 6/9 um: Mark setup_env_path as __init

In reply to Tiwei Bie

It's only invoked during boot from main().

---
 arch/um/os-Linux/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/um/os-Linux/main.c +1 -1
index 3f394f25e059..3f0be24b3633 100644
@@ -73,7 +73,7 @@ static void __init install_fatal_handler(int sig)
 
 #define UML_LIB_PATH	":" OS_LIB_PATH "/uml"
 
-static void setup_env_path(void)
+static void __init setup_env_path(void)
 {
 	char *new_path = NULL;
 	char *old_path = NULL;
Signature · 1 line
2.34.1
author
#7 lore raw

PATCH 7/9 um: Remove unused PGD_BOUND macro

In reply to Tiwei Bie

It's no longer used since commit 11100b1dfb6e ("uml: delete unused code").

---
 arch/um/os-Linux/main.c | 1 -
 1 file changed, 1 deletion(-)
arch/um/os-Linux/main.c +0 -1
index 3f0be24b3633..13f3bfeb6378 100644
@@ -19,7 +19,6 @@
 #include <um_malloc.h>
 #include "internal.h"
 
-#define PGD_BOUND (4 * 1024 * 1024)
 #define STACKSIZE (8 * 1024 * 1024)
 #define THREAD_NAME_LEN (256)
 
Signature · 1 line
2.34.1
author
#8 lore raw

PATCH 8/9 um: Remove unused THREAD_NAME_LEN macro

In reply to Tiwei Bie

It's no longer used since commit 42fda66387da ("uml: throw out CONFIG_MODE_TT").

---
 arch/um/os-Linux/main.c | 1 -
 1 file changed, 1 deletion(-)
arch/um/os-Linux/main.c +0 -1
index 13f3bfeb6378..3c63ce19e3bf 100644
@@ -20,7 +20,6 @@
 #include "internal.h"
 
 #define STACKSIZE (8 * 1024 * 1024)
-#define THREAD_NAME_LEN (256)
 
 long elf_aux_hwcap;
 
Signature · 1 line
2.34.1
author
#9 lore raw

PATCH 9/9 um: Remove unused user_context function

In reply to Tiwei Bie

It's no longer used since commit 6aa802ce6acc ("uml: throw out CHOOSE_MODE").

---
 arch/um/kernel/process.c           | 8 --------
 arch/x86/um/shared/sysdep/ptrace.h | 2 --
 2 files changed, 10 deletions(-)
arch/um/kernel/process.c +0 -8
index 30bdc0a87dc8..e5a2d4d897e0 100644
@@ -213,14 +213,6 @@ int __uml_cant_sleep(void) {
 	/* Is in_interrupt() really needed? */
 }
 
-int user_context(unsigned long sp)
-{
-	unsigned long stack;
-
-	stack = sp & (PAGE_MASK << CONFIG_KERNEL_STACK_ORDER);
-	return stack != (unsigned long) current_thread_info();
-}
-
 extern exitcall_t __uml_exitcall_begin, __uml_exitcall_end;
 
 void do_uml_exitcalls(void)
arch/x86/um/shared/sysdep/ptrace.h +0 -2
index 2dd4ca6713f8..8f7476ff6e95 100644
@@ -74,8 +74,6 @@ struct uml_pt_regs {
 #define UPT_FAULTINFO(r) (&(r)->faultinfo)
 #define UPT_IS_USER(r) ((r)->is_user)
 
-extern int user_context(unsigned long sp);
-
 extern int arch_init_registers(int pid);
 
 #endif /* __SYSDEP_X86_PTRACE_H */
Signature · 1 line
2.34.1