Re: [PATCH 03/32] arc: copy_thread(): rename 'arg' argument to 'kthread_arg'

2015-03-25 Thread Vineet Gupta
On Wednesday 25 March 2015 06:05 PM, Alex Dowad wrote:
>
> On 25/03/15 13:47, Vineet Gupta wrote:
>> On Friday 13 March 2015 11:35 PM, Alex Dowad wrote:
>>
>> Applied to for-next after pruning the comment above.
> Thank you. Is it too late for me to tweak the commit comment?

I already fixed it up !
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 03/32] arc: copy_thread(): rename 'arg' argument to 'kthread_arg'

2015-03-25 Thread Alex Dowad



On 25/03/15 13:47, Vineet Gupta wrote:

On Friday 13 March 2015 11:35 PM, 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 
---
  arch/arc/kernel/process.c | 9 ++---
  1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/arch/arc/kernel/process.c b/arch/arc/kernel/process.c
index fdd8971..cf366bd 100644
--- a/arch/arc/kernel/process.c
+++ b/arch/arc/kernel/process.c
@@ -49,7 +49,9 @@ void arch_cpu_idle(void)
  
  asmlinkage void ret_from_fork(void);
  
-/* Layout of Child kernel mode stack as setup at the end of this function is

+/* Copy architecture-specific thread state
+ *
+ * Layout of Child kernel mode stack as setup at the end of this function is
   *
   * | ...|
   * | ...|
@@ -81,7 +83,7 @@ asmlinkage void ret_from_fork(void);
   * --  <= END of PAGE
   */
  int copy_thread(unsigned long clone_flags,
-   unsigned long usp, unsigned long arg,
+   unsigned long usp, unsigned long kthread_arg,
struct task_struct *p)
  {
struct pt_regs *c_regs;/* child's pt_regs */
@@ -110,9 +112,10 @@ int copy_thread(unsigned long clone_flags,
childksp[1] = (unsigned long)ret_from_fork; /* blink */
  
  	if (unlikely(p->flags & PF_KTHREAD)) {

+   /* kernel thread */

This seems extraneous given that PF_KTHREAD above check makes is obvious that 
this
is a kernel thread.


memset(c_regs, 0, sizeof(struct pt_regs));
  
-		c_callee->r13 = arg; /* argument to kernel thread */

+   c_callee->r13 = kthread_arg;
c_callee->r14 = usp;  /* function */
  
  		return 0;

Applied to for-next after pruning the comment above.

Thank you. Is it too late for me to tweak the commit comment?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 03/32] arc: copy_thread(): rename 'arg' argument to 'kthread_arg'

2015-03-25 Thread Vineet Gupta
On Friday 13 March 2015 11:35 PM, 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 
> ---
>  arch/arc/kernel/process.c | 9 ++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/arch/arc/kernel/process.c b/arch/arc/kernel/process.c
> index fdd8971..cf366bd 100644
> --- a/arch/arc/kernel/process.c
> +++ b/arch/arc/kernel/process.c
> @@ -49,7 +49,9 @@ void arch_cpu_idle(void)
>  
>  asmlinkage void ret_from_fork(void);
>  
> -/* Layout of Child kernel mode stack as setup at the end of this function is
> +/* Copy architecture-specific thread state
> + *
> + * Layout of Child kernel mode stack as setup at the end of this function is
>   *
>   * | ...|
>   * | ...|
> @@ -81,7 +83,7 @@ asmlinkage void ret_from_fork(void);
>   * --  <= END of PAGE
>   */
>  int copy_thread(unsigned long clone_flags,
> - unsigned long usp, unsigned long arg,
> + unsigned long usp, unsigned long kthread_arg,
>   struct task_struct *p)
>  {
>   struct pt_regs *c_regs;/* child's pt_regs */
> @@ -110,9 +112,10 @@ int copy_thread(unsigned long clone_flags,
>   childksp[1] = (unsigned long)ret_from_fork; /* blink */
>  
>   if (unlikely(p->flags & PF_KTHREAD)) {
> + /* kernel thread */

This seems extraneous given that PF_KTHREAD above check makes is obvious that 
this
is a kernel thread.

>   memset(c_regs, 0, sizeof(struct pt_regs));
>  
> - c_callee->r13 = arg; /* argument to kernel thread */
> + c_callee->r13 = kthread_arg;
>   c_callee->r14 = usp;  /* function */
>  
>   return 0;

Applied to for-next after pruning the comment above.

Thx,
-Vineet
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 03/32] arc: copy_thread(): rename 'arg' argument to 'kthread_arg'

2015-03-13 Thread Alex Dowad
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 
---
 arch/arc/kernel/process.c | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/arch/arc/kernel/process.c b/arch/arc/kernel/process.c
index fdd8971..cf366bd 100644
--- a/arch/arc/kernel/process.c
+++ b/arch/arc/kernel/process.c
@@ -49,7 +49,9 @@ void arch_cpu_idle(void)
 
 asmlinkage void ret_from_fork(void);
 
-/* Layout of Child kernel mode stack as setup at the end of this function is
+/* Copy architecture-specific thread state
+ *
+ * Layout of Child kernel mode stack as setup at the end of this function is
  *
  * | ...|
  * | ...|
@@ -81,7 +83,7 @@ asmlinkage void ret_from_fork(void);
  * --  <= END of PAGE
  */
 int copy_thread(unsigned long clone_flags,
-   unsigned long usp, unsigned long arg,
+   unsigned long usp, unsigned long kthread_arg,
struct task_struct *p)
 {
struct pt_regs *c_regs;/* child's pt_regs */
@@ -110,9 +112,10 @@ int copy_thread(unsigned long clone_flags,
childksp[1] = (unsigned long)ret_from_fork; /* blink */
 
if (unlikely(p->flags & PF_KTHREAD)) {
+   /* kernel thread */
memset(c_regs, 0, sizeof(struct pt_regs));
 
-   c_callee->r13 = arg; /* argument to kernel thread */
+   c_callee->r13 = kthread_arg;
c_callee->r14 = usp;  /* function */
 
return 0;
-- 
2.0.0.GIT

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/