Thread (1 message) 1 message, 1 author, 2015-03-13
STALE4126d

[PATCH 29/32] um: copy_thread(): rename 'arg' argument to 'kthread_arg'

From: Alex Dowad <hidden>
Date: 2015-03-13 18:17:19
Also in: lkml
Subsystem: the rest, user-mode linux (uml) · Maintainers: Linus Torvalds, Richard Weinberger, Anton Ivanov, Johannes Berg

The 'arg' argument to copy_thread() is only ever used when forking a new
kernel thread. Hence, rename it to 'kthread_arg' for clarity (and consistency
with do_fork() and other arch-specific implementations of copy_thread()).

Signed-off-by: Alex Dowad <redacted>
---
 arch/um/kernel/process.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c
index f17bca8..80ac9fe 100644
--- a/arch/um/kernel/process.c
+++ b/arch/um/kernel/process.c
@@ -149,8 +149,11 @@ void fork_handler(void)
 	userspace(&current->thread.regs.regs);
 }
 
+/*
+ * Copy architecture-specific thread state
+ */
 int copy_thread(unsigned long clone_flags, unsigned long sp,
-		unsigned long arg, struct task_struct * p)
+		unsigned long kthread_arg, struct task_struct *p)
 {
 	void (*handler)(void);
 	int kthread = current->flags & PF_KTHREAD;
@@ -159,6 +162,7 @@ int copy_thread(unsigned long clone_flags, unsigned long sp,
 	p->thread = (struct thread_struct) INIT_THREAD;
 
 	if (!kthread) {
+		/* user thread */
 	  	memcpy(&p->thread.regs.regs, current_pt_regs(),
 		       sizeof(p->thread.regs.regs));
 		PT_REGS_SET_SYSCALL_RETURN(&p->thread.regs, 0);
@@ -169,9 +173,10 @@ int copy_thread(unsigned long clone_flags, unsigned long sp,
 
 		arch_copy_thread(&current->thread.arch, &p->thread.arch);
 	} else {
+		/* kernel thread */
 		get_safe_registers(p->thread.regs.regs.gp, p->thread.regs.regs.fp);
 		p->thread.request.u.thread.proc = (int (*)(void *))sp;
-		p->thread.request.u.thread.arg = (void *)arg;
+		p->thread.request.u.thread.arg = (void *)kthread_arg;
 		handler = new_thread_handler;
 	}
 
-- 
2.0.0.GIT
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help