Skip to contentSkip to conversation

um: fix unused variable warning

PATCH New Benjamin Berg 1 participant 2 messages Jun 5, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 um: fix unused variable warning

From: Benjamin Berg <[email protected]>

The code was updated to access the PID of the userspace stub process in a different way, making the local cpu variable obsolete. Remove it.

Fixes 406d17c6c370 ("um: Implement kernel side of SECCOMP based process handling")
---
 arch/x86/um/tls_32.c | 3 ---
 1 file changed, 3 deletions(-)
arch/x86/um/tls_32.c +0 -3
index 21cbb70cf771..cb3f17627d16 100644
@@ -25,7 +25,6 @@ int host_gdt_entry_tls_min;
 static int do_set_thread_area(struct task_struct* task, struct user_desc *info)
 {
 	int ret;
-	u32 cpu;
 
 	if (info->entry_number < host_gdt_entry_tls_min ||
 	    info->entry_number >= host_gdt_entry_tls_min + GDT_ENTRY_TLS_ENTRIES)
@@ -41,9 +40,7 @@ static int do_set_thread_area(struct task_struct* task, struct user_desc *info)
 		return 0;
 	}
 
-	cpu = get_cpu();
 	ret = os_set_thread_area(info, task->mm->context.id.pid);
-	put_cpu();
 
 	if (ret)
 		printk(KERN_ERR "PTRACE_SET_THREAD_AREA failed, err = %d, "
Signature · 1 line
2.49.0
#1 lore raw

PATCH 2/2 um: remove "extern" from implementation of sigchld_handler

From: Benjamin Berg <[email protected]>

There is no need to mark the function as extern in the implementation.

Fixes 8420e08fe3a5 ("um: Track userspace children dying in SECCOMP mode")
---
 arch/um/kernel/irq.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/um/kernel/irq.c +2 -2
index f1787be3983c..0dfaf96bb7da 100644
@@ -691,8 +691,8 @@ void __init init_IRQ(void)
 	os_setup_epoll();
 }
 
-extern void sigchld_handler(int sig, struct siginfo *unused_si,
-			    struct uml_pt_regs *regs, void *mc)
+void sigchld_handler(int sig, struct siginfo *unused_si,
+		     struct uml_pt_regs *regs, void *mc)
 {
 	do_IRQ(SIGCHLD_IRQ, regs);
 }
Signature · 1 line
2.49.0