* [PATCH 16/32] metag: copy_thread(): rename 'arg' argument to 'kthread_arg' [not found] <1426270496-26362-1-git-send-email-alexinbeijing@gmail.com> @ 2015-03-13 18:14 ` Alex Dowad 2015-03-16 11:39 ` James Hogan 0 siblings, 1 reply; 7+ messages in thread From: Alex Dowad @ 2015-03-13 18:14 UTC (permalink / raw) To: linux-kernel; +Cc: James Hogan, open list:METAG ARCHITECTURE 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 <alexinbeijing@gmail.com> --- arch/metag/kernel/process.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/metag/kernel/process.c b/arch/metag/kernel/process.c index 483dff9..dcb4609 100644 --- a/arch/metag/kernel/process.c +++ b/arch/metag/kernel/process.c @@ -174,8 +174,11 @@ void show_regs(struct pt_regs *regs) show_trace(NULL, (unsigned long *)regs->ctx.AX[0].U0, regs); } +/* + * Copy architecture-specific thread state + */ int copy_thread(unsigned long clone_flags, unsigned long usp, - unsigned long arg, struct task_struct *tsk) + unsigned long kthread_arg, struct task_struct *tsk) { struct pt_regs *childregs = task_pt_regs(tsk); void *kernel_context = ((void *) childregs + @@ -204,10 +207,11 @@ int copy_thread(unsigned long clone_flags, unsigned long usp, childregs->ctx.AX[0].U0 = (unsigned long) kernel_context; /* Set D1Ar1=arg and D1RtP=usp (fn) */ childregs->ctx.DX[4].U1 = usp; - childregs->ctx.DX[3].U1 = arg; + childregs->ctx.DX[3].U1 = kthread_arg; tsk->thread.int_depth = 2; return 0; } + /* * Get a pointer to where the new child's register block should have * been pushed. -- 2.0.0.GIT ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 16/32] metag: copy_thread(): rename 'arg' argument to 'kthread_arg' 2015-03-13 18:14 ` [PATCH 16/32] metag: copy_thread(): rename 'arg' argument to 'kthread_arg' Alex Dowad @ 2015-03-16 11:39 ` James Hogan 2015-03-16 13:13 ` [PATCHv2 " Alex Dowad 0 siblings, 1 reply; 7+ messages in thread From: James Hogan @ 2015-03-16 11:39 UTC (permalink / raw) To: Alex Dowad, linux-kernel; +Cc: METAG ARCHITECTURE [-- Attachment #1: Type: text/plain, Size: 1880 bytes --] On 13/03/15 18:14, Alex Dowad wrote: > 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 <alexinbeijing@gmail.com> > --- > arch/metag/kernel/process.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/arch/metag/kernel/process.c b/arch/metag/kernel/process.c > index 483dff9..dcb4609 100644 > --- a/arch/metag/kernel/process.c > +++ b/arch/metag/kernel/process.c > @@ -174,8 +174,11 @@ void show_regs(struct pt_regs *regs) > show_trace(NULL, (unsigned long *)regs->ctx.AX[0].U0, regs); > } > > +/* > + * Copy architecture-specific thread state > + */ > int copy_thread(unsigned long clone_flags, unsigned long usp, > - unsigned long arg, struct task_struct *tsk) > + unsigned long kthread_arg, struct task_struct *tsk) > { > struct pt_regs *childregs = task_pt_regs(tsk); > void *kernel_context = ((void *) childregs + > @@ -204,10 +207,11 @@ int copy_thread(unsigned long clone_flags, unsigned long usp, > childregs->ctx.AX[0].U0 = (unsigned long) kernel_context; > /* Set D1Ar1=arg and D1RtP=usp (fn) */ Please update this comment too (ctx.DX[3].U1 stores the D1Ar1 register). Other than that: Acked-by: James Hogan <james.hogan@imgtec.com> I'll assume you plan to get all these patches merged together rather than via individual arch trees unless you say otherwise. Cheers James > childregs->ctx.DX[4].U1 = usp; > - childregs->ctx.DX[3].U1 = arg; > + childregs->ctx.DX[3].U1 = kthread_arg; > tsk->thread.int_depth = 2; > return 0; > } > + > /* > * Get a pointer to where the new child's register block should have > * been pushed. > [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 819 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCHv2 16/32] metag: copy_thread(): rename 'arg' argument to 'kthread_arg' 2015-03-16 11:39 ` James Hogan @ 2015-03-16 13:13 ` Alex Dowad 2015-03-16 14:31 ` James Hogan 0 siblings, 1 reply; 7+ messages in thread From: Alex Dowad @ 2015-03-16 13:13 UTC (permalink / raw) To: james.hogan; +Cc: linux-kernel, linux-metag The 'arg' argument to copy_thread() is only ever used when forking a new kernel thread. Hence, rename it to 'kthread_arg' for clarity. Signed-off-by: Alex Dowad <alexinbeijing@gmail.com> --- James Hogan, Thanks for reviewing this patch. The comment has been updated as you suggested. You said: "I'll assume you plan to get all these patches merged together rather than via individual arch trees..." The truth is that I am as green as green can be and have no idea how I plan to get these patches merged. I was just reading the Linux source and saw what looked like an opportunity to make the code a tiny bit easier to read. If you have any suggestions on how to proceed, please let me know. Kind regards, Alex Dowad arch/metag/kernel/process.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/metag/kernel/process.c b/arch/metag/kernel/process.c index 483dff9..dcb4609 100644 --- a/arch/metag/kernel/process.c +++ b/arch/metag/kernel/process.c @@ -174,8 +174,11 @@ void show_regs(struct pt_regs *regs) show_trace(NULL, (unsigned long *)regs->ctx.AX[0].U0, regs); } +/* + * Copy architecture-specific thread state + */ int copy_thread(unsigned long clone_flags, unsigned long usp, - unsigned long arg, struct task_struct *tsk) + unsigned long kthread_arg, struct task_struct *tsk) { struct pt_regs *childregs = task_pt_regs(tsk); void *kernel_context = ((void *) childregs + @@ -204,10 +207,11 @@ int copy_thread(unsigned long clone_flags, unsigned long usp, childregs->ctx.AX[0].U0 = (unsigned long) kernel_context; - /* Set D1Ar1=arg and D1RtP=usp (fn) */ + /* Set D1Ar1=kthread_arg and D1RtP=usp (fn) */ childregs->ctx.DX[4].U1 = usp; - childregs->ctx.DX[3].U1 = arg; + childregs->ctx.DX[3].U1 = kthread_arg; tsk->thread.int_depth = 2; return 0; } + /* * Get a pointer to where the new child's register block should have * been pushed. -- 2.0.0.GIT ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCHv2 16/32] metag: copy_thread(): rename 'arg' argument to 'kthread_arg' 2015-03-16 13:13 ` [PATCHv2 " Alex Dowad @ 2015-03-16 14:31 ` James Hogan 2015-03-16 14:38 ` Alex Dowad 2015-03-16 14:38 ` [PATCHv3 " Alex Dowad 0 siblings, 2 replies; 7+ messages in thread From: James Hogan @ 2015-03-16 14:31 UTC (permalink / raw) To: Alex Dowad; +Cc: linux-kernel, linux-metag [-- Attachment #1: Type: text/plain, Size: 1855 bytes --] Hi Alex, On 16/03/15 13:13, Alex Dowad wrote: > The 'arg' argument to copy_thread() is only ever used when forking a new > kernel thread. Hence, rename it to 'kthread_arg' for clarity. > > Signed-off-by: Alex Dowad <alexinbeijing@gmail.com> > --- > > James Hogan, > > Thanks for reviewing this patch. The comment has been updated as you suggested. > > You said: "I'll assume you plan to get all these patches merged together rather than > via individual arch trees..." The truth is that I am as green as green can be and have > no idea how I plan to get these patches merged. I was just reading the Linux source and > saw what looked like an opportunity to make the code a tiny bit easier to read. If you > have any suggestions on how to proceed, please let me know. I guess there are 3 main paths: 1) Ask individual arch maintainers to apply the patches if possible, since it doesn't have dependencies on other patches you're submitting. 2) Gather acks from maintainers for the remaining patches and ask Andrew Morton or another relevant maintainer to apply them (Andrew often picks up misc patches like this I believe). 3) Or gather acks for remaining patches and send a pull request to Linus yourself during the next merge window. Btw, the whitespace seems to be corrupted here, so the patch won't apply: > - /* Set D1Ar1=arg and D1RtP=usp (fn) */ ^^^ currently this is indented with tabs not spaces > + /* Set D1Ar1=kthread_arg and D1RtP=usp (fn) */ ^^^ and this has a space before a tab Cheers James > childregs->ctx.DX[4].U1 = usp; > - childregs->ctx.DX[3].U1 = arg; > + childregs->ctx.DX[3].U1 = kthread_arg; > tsk->thread.int_depth = 2; > return 0; > } > + > /* > * Get a pointer to where the new child's register block should have > * been pushed. > [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 819 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCHv2 16/32] metag: copy_thread(): rename 'arg' argument to 'kthread_arg' 2015-03-16 14:31 ` James Hogan @ 2015-03-16 14:38 ` Alex Dowad 2015-03-16 14:38 ` [PATCHv3 " Alex Dowad 1 sibling, 0 replies; 7+ messages in thread From: Alex Dowad @ 2015-03-16 14:38 UTC (permalink / raw) To: James Hogan; +Cc: linux-kernel, linux-metag On 16/03/15 16:31, James Hogan wrote: > Hi Alex, > > On 16/03/15 13:13, Alex Dowad wrote: >> The 'arg' argument to copy_thread() is only ever used when forking a new >> kernel thread. Hence, rename it to 'kthread_arg' for clarity. >> >> Signed-off-by: Alex Dowad <alexinbeijing@gmail.com> >> --- >> >> James Hogan, >> >> Thanks for reviewing this patch. The comment has been updated as you suggested. >> >> You said: "I'll assume you plan to get all these patches merged together rather than >> via individual arch trees..." The truth is that I am as green as green can be and have >> no idea how I plan to get these patches merged. I was just reading the Linux source and >> saw what looked like an opportunity to make the code a tiny bit easier to read. If you >> have any suggestions on how to proceed, please let me know. > I guess there are 3 main paths: > 1) Ask individual arch maintainers to apply the patches if possible, > since it doesn't have dependencies on other patches you're submitting. > 2) Gather acks from maintainers for the remaining patches and ask Andrew > Morton or another relevant maintainer to apply them (Andrew often picks > up misc patches like this I believe). > 3) Or gather acks for remaining patches and send a pull request to Linus > yourself during the next merge window. > > > Btw, the whitespace seems to be corrupted here, so the patch won't apply: Grrr. Sending again. Thanks for the pointers on merge workflow. I doubt that I will get the attention of each and every arch maintainer, but let's see what will happen. Thanks again. > >> - /* Set D1Ar1=arg and D1RtP=usp (fn) */ > ^^^ currently this is indented with tabs not spaces > >> + /* Set D1Ar1=kthread_arg and D1RtP=usp (fn) */ > ^^^ and this has a space before a tab > > Cheers > James ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCHv3 16/32] metag: copy_thread(): rename 'arg' argument to 'kthread_arg' 2015-03-16 14:31 ` James Hogan 2015-03-16 14:38 ` Alex Dowad @ 2015-03-16 14:38 ` Alex Dowad [not found] ` <1426516727-20692-1-git-send-email-alexinbeijing-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 1 sibling, 1 reply; 7+ messages in thread From: Alex Dowad @ 2015-03-16 14:38 UTC (permalink / raw) To: james.hogan; +Cc: linux-kernel, linux-metag The 'arg' argument to copy_thread() is only ever used when forking a new kernel thread. Hence, rename it to 'kthread_arg' for clarity. Signed-off-by: Alex Dowad <alexinbeijing@gmail.com> --- Fixed problem with whitespace, sending again. AD arch/metag/kernel/process.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/metag/kernel/process.c b/arch/metag/kernel/process.c index 483dff9..dcb4609 100644 --- a/arch/metag/kernel/process.c +++ b/arch/metag/kernel/process.c @@ -174,8 +174,11 @@ void show_regs(struct pt_regs *regs) show_trace(NULL, (unsigned long *)regs->ctx.AX[0].U0, regs); } +/* + * Copy architecture-specific thread state + */ int copy_thread(unsigned long clone_flags, unsigned long usp, - unsigned long arg, struct task_struct *tsk) + unsigned long kthread_arg, struct task_struct *tsk) { struct pt_regs *childregs = task_pt_regs(tsk); void *kernel_context = ((void *) childregs + @@ -204,10 +207,11 @@ int copy_thread(unsigned long clone_flags, unsigned long usp, childregs->ctx.AX[0].U0 = (unsigned long) kernel_context; - /* Set D1Ar1=arg and D1RtP=usp (fn) */ + /* Set D1Ar1=kthread_arg and D1RtP=usp (fn) */ childregs->ctx.DX[4].U1 = usp; - childregs->ctx.DX[3].U1 = arg; + childregs->ctx.DX[3].U1 = kthread_arg; tsk->thread.int_depth = 2; return 0; } + /* * Get a pointer to where the new child's register block should have * been pushed. -- 2.0.0.GIT ^ permalink raw reply related [flat|nested] 7+ messages in thread
[parent not found: <1426516727-20692-1-git-send-email-alexinbeijing-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>]
* Re: [PATCHv3 16/32] metag: copy_thread(): rename 'arg' argument to 'kthread_arg' [not found] ` <1426516727-20692-1-git-send-email-alexinbeijing-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> @ 2015-03-16 14:52 ` James Hogan 0 siblings, 0 replies; 7+ messages in thread From: James Hogan @ 2015-03-16 14:52 UTC (permalink / raw) To: Alex Dowad Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA, linux-metag-u79uwXL29TY76Z2rM5mHXA [-- Attachment #1: Type: text/plain, Size: 1809 bytes --] On 16/03/15 14:38, Alex Dowad wrote: > The 'arg' argument to copy_thread() is only ever used when forking a new > kernel thread. Hence, rename it to 'kthread_arg' for clarity. > > Signed-off-by: Alex Dowad <alexinbeijing-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > --- > > Fixed problem with whitespace, sending again. AD > > arch/metag/kernel/process.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/arch/metag/kernel/process.c b/arch/metag/kernel/process.c > index 483dff9..dcb4609 100644 > --- a/arch/metag/kernel/process.c > +++ b/arch/metag/kernel/process.c > @@ -174,8 +174,11 @@ void show_regs(struct pt_regs *regs) > show_trace(NULL, (unsigned long *)regs->ctx.AX[0].U0, regs); > } > > +/* > + * Copy architecture-specific thread state > + */ > int copy_thread(unsigned long clone_flags, unsigned long usp, > - unsigned long arg, struct task_struct *tsk) > + unsigned long kthread_arg, struct task_struct *tsk) > { > struct pt_regs *childregs = task_pt_regs(tsk); > void *kernel_context = ((void *) childregs + > @@ -204,10 +207,11 @@ int copy_thread(unsigned long clone_flags, unsigned long usp, > childregs->ctx.AX[0].U0 = (unsigned long) kernel_context; > - /* Set D1Ar1=arg and D1RtP=usp (fn) */ > + /* Set D1Ar1=kthread_arg and D1RtP=usp (fn) */ FYI this still has a space before the tab, and isn't indented to the same level as the surrounding code, but I'll just fix that up when I apply it. Thanks James > childregs->ctx.DX[4].U1 = usp; > - childregs->ctx.DX[3].U1 = arg; > + childregs->ctx.DX[3].U1 = kthread_arg; > tsk->thread.int_depth = 2; > return 0; > } > + > /* > * Get a pointer to where the new child's register block should have > * been pushed. > [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 819 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2015-03-16 14:52 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1426270496-26362-1-git-send-email-alexinbeijing@gmail.com>
2015-03-13 18:14 ` [PATCH 16/32] metag: copy_thread(): rename 'arg' argument to 'kthread_arg' Alex Dowad
2015-03-16 11:39 ` James Hogan
2015-03-16 13:13 ` [PATCHv2 " Alex Dowad
2015-03-16 14:31 ` James Hogan
2015-03-16 14:38 ` Alex Dowad
2015-03-16 14:38 ` [PATCHv3 " Alex Dowad
[not found] ` <1426516727-20692-1-git-send-email-alexinbeijing-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-03-16 14:52 ` James Hogan
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox