um: Minor fixes and cleanups
cover um: Minor fixes and cleanups
From: Tiwei Bie <[email protected]>
Tiwei Bie (4):
um: Make unscheduled_userspace_iterations static
um: Make mm_list and mm_list_lock static
um: Avoid redefining ARCH_HAS_CACHE_LINE_SIZE
um: rtc: Avoid shadowing err in uml_rtc_start()
arch/um/Kconfig | 4 +--- arch/um/drivers/rtc_user.c | 2 +- arch/um/kernel/skas/mmu.c | 4 ++-- arch/um/os-Linux/skas/process.c | 2 +- 4 files changed, 5 insertions(+), 7 deletions(-)
Signature · 1 line
2.34.1
PATCH 1/4 um: Make unscheduled_userspace_iterations static
From: Tiwei Bie <[email protected]>
It's only used within process.c. Make it static.
--- arch/um/os-Linux/skas/process.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/um/os-Linux/skas/process.c +1 -1
@@ -548,7 +548,7 @@ int start_userspace(struct mm_id *mm_id)return err; } -int unscheduled_userspace_iterations; +static int unscheduled_userspace_iterations;extern unsigned long tt_extra_sched_jiffies;void userspace (struct uml_pt_regs *regs)
Signature · 1 line
2.34.1
PATCH 2/4 um: Make mm_list and mm_list_lock static
In reply to Tiwei BieFrom: Tiwei Bie <[email protected]>
They are only used within mmu.c. Make them static.
--- arch/um/kernel/skas/mmu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/um/kernel/skas/mmu.c +2 -2
@@ -20,8 +20,8 @@/* Ensure the stub_data struct covers the allocated area */ static_assert (sizeof (struct stub_data ) ==STUB_DATA_PAGES *UM_KERN_PAGE_SIZE ); -spinlock_t mm_list_lock; -struct list_head mm_list; +static spinlock_t mm_list_lock; +static struct list_head mm_list;int init_new_context (struct task_struct *task,struct mm_struct *mm) {
Signature · 1 line
2.34.1
PATCH 3/4 um: Avoid redefining ARCH_HAS_CACHE_LINE_SIZE
In reply to Tiwei BieFrom: Tiwei Bie <[email protected]>
There is a generic ARCH_HAS_CACHE_LINE_SIZE option introduced by commit c2280be81de4 ("mm: generalize ARCH_HAS_CACHE_LINE_SIZE") in mm/Kconfig. Select that instead.
--- arch/um/Kconfig | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
arch/um/Kconfig +1 -3
@@ -6,6 +6,7 @@ config UML bool default y select ARCH_WANTS_DYNAMIC_TASK_STRUCT + select ARCH_HAS_CACHE_LINE_SIZE select ARCH_HAS_CPU_FINALIZE_INIT select ARCH_HAS_FORTIFY_SOURCE select ARCH_HAS_GCOV_PROFILE_ALL
@@ -83,9 +84,6 @@ config NR_CPUS range 1 1 default 1 -config ARCH_HAS_CACHE_LINE_SIZE - def_bool y - source "arch/$(HEADER_ARCH)/um/Kconfig" config MAY_HAVE_RUNTIME_DEPS
Signature · 1 line
2.34.1
PATCH 4/4 um: rtc: Avoid shadowing err in uml_rtc_start()
In reply to Tiwei BieFrom: Tiwei Bie <[email protected]>
Remove the declaration of 'err' inside the 'if (timetravel)' block, as it would otherwise be unavailable outside that block, potentially leading to uml_rtc_start() returning an uninitialized value.
--- arch/um/drivers/rtc_user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/um/drivers/rtc_user.c +1 -1
@@ -28,7 +28,7 @@ int uml_rtc_start(bool timetravel)int err;if (timetravel) { -int err =os_pipe (uml_rtc_irq_fds,1 ,1 ); + err =os_pipe (uml_rtc_irq_fds,1 ,1 );if (err) goto fail; }else {
Signature · 1 line
2.34.1