All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] Fix multiple checkpatch issues
@ 2017-03-26 14:48 Gargi Sharma
  2017-03-26 14:48 ` [PATCH 1/3] kernel: pid_namespace: Remove return statement from void function Gargi Sharma
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Gargi Sharma @ 2017-03-26 14:48 UTC (permalink / raw)
  To: mawilcox; +Cc: outreachy-kernel, Gargi Sharma

This file fixes multiple checkpatch issues in pid_namespace.c file.

Gargi Sharma (3):
  kernel: pid_namespace: Remove return statement from void function
  kernel: pid_namespace: Fix line over 80 characters
  kernel: pid_namespace: Do not initialise statics to 0

 kernel/pid_namespace.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

-- 
2.7.4



^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/3] kernel: pid_namespace: Remove return statement from void function
  2017-03-26 14:48 [PATCH 0/3] Fix multiple checkpatch issues Gargi Sharma
@ 2017-03-26 14:48 ` Gargi Sharma
  2017-03-27 15:50   ` Matthew Wilcox
  2017-03-26 14:48 ` [PATCH 2/3] kernel: pid_namespace: Fix line over 80 characters Gargi Sharma
  2017-03-26 14:48 ` [PATCH 3/3] kernel: pid_namespace: Do not initialise statics to 0 Gargi Sharma
  2 siblings, 1 reply; 8+ messages in thread
From: Gargi Sharma @ 2017-03-26 14:48 UTC (permalink / raw)
  To: mawilcox; +Cc: outreachy-kernel, Gargi Sharma

zap_pid_ns_processes is a void function and the return
statement at the end is not useful.

Found with checkpatch.

Signed-off-by: Gargi Sharma <gs051095@gmail.com>
---
 kernel/pid_namespace.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/kernel/pid_namespace.c b/kernel/pid_namespace.c
index 5f29687..6ace1e3 100644
--- a/kernel/pid_namespace.c
+++ b/kernel/pid_namespace.c
@@ -287,7 +287,6 @@ void zap_pid_ns_processes(struct pid_namespace *pid_ns)
 		current->signal->group_exit_code = pid_ns->reboot;
 
 	acct_exit_ns(pid_ns);
-	return;
 }
 
 #ifdef CONFIG_CHECKPOINT_RESTORE
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/3] kernel: pid_namespace: Fix line over 80 characters
  2017-03-26 14:48 [PATCH 0/3] Fix multiple checkpatch issues Gargi Sharma
  2017-03-26 14:48 ` [PATCH 1/3] kernel: pid_namespace: Remove return statement from void function Gargi Sharma
@ 2017-03-26 14:48 ` Gargi Sharma
  2017-03-27 15:51   ` Matthew Wilcox
  2017-03-27 19:12   ` Arushi Singhal
  2017-03-26 14:48 ` [PATCH 3/3] kernel: pid_namespace: Do not initialise statics to 0 Gargi Sharma
  2 siblings, 2 replies; 8+ messages in thread
From: Gargi Sharma @ 2017-03-26 14:48 UTC (permalink / raw)
  To: mawilcox; +Cc: outreachy-kernel, Gargi Sharma

Line over 80 characters are split to fix the following checkpatch
issue:
WARNING: line over 80 characters

Signed-off-by: Gargi Sharma <gs051095@gmail.com>
---
 kernel/pid_namespace.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/kernel/pid_namespace.c b/kernel/pid_namespace.c
index 6ace1e3..18f5385 100644
--- a/kernel/pid_namespace.c
+++ b/kernel/pid_namespace.c
@@ -92,8 +92,9 @@ static void dec_pid_namespaces(struct ucounts *ucounts)
 	dec_ucount(ucounts, UCOUNT_PID_NAMESPACES);
 }
 
-static struct pid_namespace *create_pid_namespace(struct user_namespace *user_ns,
-	struct pid_namespace *parent_pid_ns)
+static struct
+pid_namespace *create_pid_namespace(struct user_namespace *user_ns,
+				    struct pid_namespace *parent_pid_ns)
 {
 	struct pid_namespace *ns;
 	unsigned int level = parent_pid_ns->level + 1;
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 3/3] kernel: pid_namespace: Do not initialise statics to 0
  2017-03-26 14:48 [PATCH 0/3] Fix multiple checkpatch issues Gargi Sharma
  2017-03-26 14:48 ` [PATCH 1/3] kernel: pid_namespace: Remove return statement from void function Gargi Sharma
  2017-03-26 14:48 ` [PATCH 2/3] kernel: pid_namespace: Fix line over 80 characters Gargi Sharma
@ 2017-03-26 14:48 ` Gargi Sharma
  2 siblings, 0 replies; 8+ messages in thread
From: Gargi Sharma @ 2017-03-26 14:48 UTC (permalink / raw)
  To: mawilcox; +Cc: outreachy-kernel, Gargi Sharma

Static variables are initialised to 0 by GCC.
Fixes the following checkpatch error:
ERROR: do not initialise statics to 0 or NULL

Signed-off-by: Gargi Sharma <gs051095@gmail.com>
---
 kernel/pid_namespace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/pid_namespace.c b/kernel/pid_namespace.c
index 18f5385..071ebd3 100644
--- a/kernel/pid_namespace.c
+++ b/kernel/pid_namespace.c
@@ -311,7 +311,7 @@ static int pid_ns_ctl_handler(struct ctl_table *table, int write,
 }
 
 extern int pid_max;
-static int zero = 0;
+static int zero;
 static struct ctl_table pid_ns_ctl_table[] = {
 	{
 		.procname = "ns_last_pid",
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* RE: [PATCH 1/3] kernel: pid_namespace: Remove return statement from void function
  2017-03-26 14:48 ` [PATCH 1/3] kernel: pid_namespace: Remove return statement from void function Gargi Sharma
@ 2017-03-27 15:50   ` Matthew Wilcox
  0 siblings, 0 replies; 8+ messages in thread
From: Matthew Wilcox @ 2017-03-27 15:50 UTC (permalink / raw)
  To: Gargi Sharma; +Cc: outreachy-kernel, Varsha Rao

Yes, I agree.

I'm going to start a git tree with these various cleanups in it so Gargi and Varsha aren't duplicating each other's work so much :-)

> -----Original Message-----
> From: Gargi Sharma [mailto:gs051095@gmail.com]
> Sent: Sunday, March 26, 2017 10:48 AM
> To: Matthew Wilcox <mawilcox@microsoft.com>
> Cc: outreachy-kernel@googlegroups.com; Gargi Sharma
> <gs051095@gmail.com>
> Subject: [PATCH 1/3] kernel: pid_namespace: Remove return statement from
> void function
> 
> zap_pid_ns_processes is a void function and the return
> statement at the end is not useful.
> 
> Found with checkpatch.
> 
> Signed-off-by: Gargi Sharma <gs051095@gmail.com>
> ---
>  kernel/pid_namespace.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/kernel/pid_namespace.c b/kernel/pid_namespace.c
> index 5f29687..6ace1e3 100644
> --- a/kernel/pid_namespace.c
> +++ b/kernel/pid_namespace.c
> @@ -287,7 +287,6 @@ void zap_pid_ns_processes(struct pid_namespace
> *pid_ns)
>  		current->signal->group_exit_code = pid_ns->reboot;
> 
>  	acct_exit_ns(pid_ns);
> -	return;
>  }
> 
>  #ifdef CONFIG_CHECKPOINT_RESTORE
> --
> 2.7.4


^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [PATCH 2/3] kernel: pid_namespace: Fix line over 80 characters
  2017-03-26 14:48 ` [PATCH 2/3] kernel: pid_namespace: Fix line over 80 characters Gargi Sharma
@ 2017-03-27 15:51   ` Matthew Wilcox
  2017-03-27 19:12   ` Arushi Singhal
  1 sibling, 0 replies; 8+ messages in thread
From: Matthew Wilcox @ 2017-03-27 15:51 UTC (permalink / raw)
  To: Gargi Sharma; +Cc: outreachy-kernel

Ooh, no, don't split it here.  People grep for 'struct pid_namespace' and this split will mean they don't find it.  I would probably split it between the '*' and the 'create'.  You could also split it between the 'static' and the 'struct'.

> -----Original Message-----
> From: Gargi Sharma [mailto:gs051095@gmail.com]
> Sent: Sunday, March 26, 2017 10:48 AM
> To: Matthew Wilcox <mawilcox@microsoft.com>
> Cc: outreachy-kernel@googlegroups.com; Gargi Sharma
> <gs051095@gmail.com>
> Subject: [PATCH 2/3] kernel: pid_namespace: Fix line over 80 characters
> 
> Line over 80 characters are split to fix the following checkpatch
> issue:
> WARNING: line over 80 characters
> 
> Signed-off-by: Gargi Sharma <gs051095@gmail.com>
> ---
>  kernel/pid_namespace.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/pid_namespace.c b/kernel/pid_namespace.c
> index 6ace1e3..18f5385 100644
> --- a/kernel/pid_namespace.c
> +++ b/kernel/pid_namespace.c
> @@ -92,8 +92,9 @@ static void dec_pid_namespaces(struct ucounts *ucounts)
>  	dec_ucount(ucounts, UCOUNT_PID_NAMESPACES);
>  }
> 
> -static struct pid_namespace *create_pid_namespace(struct user_namespace
> *user_ns,
> -	struct pid_namespace *parent_pid_ns)
> +static struct
> +pid_namespace *create_pid_namespace(struct user_namespace *user_ns,
> +				    struct pid_namespace *parent_pid_ns)
>  {
>  	struct pid_namespace *ns;
>  	unsigned int level = parent_pid_ns->level + 1;
> --
> 2.7.4


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/3] kernel: pid_namespace: Fix line over 80 characters
  2017-03-26 14:48 ` [PATCH 2/3] kernel: pid_namespace: Fix line over 80 characters Gargi Sharma
  2017-03-27 15:51   ` Matthew Wilcox
@ 2017-03-27 19:12   ` Arushi Singhal
  2017-03-27 19:15     ` Arushi Singhal
  1 sibling, 1 reply; 8+ messages in thread
From: Arushi Singhal @ 2017-03-27 19:12 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: mawilcox, gs051095


[-- Attachment #1.1: Type: text/plain, Size: 1152 bytes --]



On Sunday, March 26, 2017 at 8:18:57 PM UTC+5:30, Gargi Sharma wrote:
>
> Line over 80 characters are split to fix the following checkpatch 
> issue: 
> WARNING: line over 80 characters 
>
> Signed-off-by: Gargi Sharma <gs05...@gmail.com <javascript:>> 
> --- 
>  kernel/pid_namespace.c | 5 +++-- 
>  1 file changed, 3 insertions(+), 2 deletions(-) 
>
> diff --git a/kernel/pid_namespace.c b/kernel/pid_namespace.c 
> index 6ace1e3..18f5385 100644 
> --- a/kernel/pid_namespace.c 
> +++ b/kernel/pid_namespace.c 
> @@ -92,8 +92,9 @@ static void dec_pid_namespaces(struct ucounts *ucounts) 
>          dec_ucount(ucounts, UCOUNT_PID_NAMESPACES); 
>  } 
>   
> -static struct pid_namespace *create_pid_namespace(struct user_namespace 
> *user_ns, 
> -        struct pid_namespace *parent_pid_ns) 
>
Hi Gargi
I think I have already made this change
 Thanks
Arushi

> +static struct 
> +pid_namespace *create_pid_namespace(struct user_namespace *user_ns, 
> +                                    struct pid_namespace *parent_pid_ns) 
>  { 
>          struct pid_namespace *ns; 
>          unsigned int level = parent_pid_ns->level + 1; 
> -- 
> 2.7.4 
>
>

[-- Attachment #1.2: Type: text/html, Size: 1796 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/3] kernel: pid_namespace: Fix line over 80 characters
  2017-03-27 19:12   ` Arushi Singhal
@ 2017-03-27 19:15     ` Arushi Singhal
  0 siblings, 0 replies; 8+ messages in thread
From: Arushi Singhal @ 2017-03-27 19:15 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: mawilcox, gs051095


[-- Attachment #1.1: Type: text/plain, Size: 1336 bytes --]



On Tuesday, March 28, 2017 at 12:42:53 AM UTC+5:30, Arushi Singhal wrote:
>
>
>
> On Sunday, March 26, 2017 at 8:18:57 PM UTC+5:30, Gargi Sharma wrote:
>>
>> Line over 80 characters are split to fix the following checkpatch 
>> issue: 
>> WARNING: line over 80 characters 
>>
>> Signed-off-by: Gargi Sharma <gs05...@gmail.com> 
>> --- 
>>  kernel/pid_namespace.c | 5 +++-- 
>>  1 file changed, 3 insertions(+), 2 deletions(-) 
>>
>> diff --git a/kernel/pid_namespace.c b/kernel/pid_namespace.c 
>> index 6ace1e3..18f5385 100644 
>> --- a/kernel/pid_namespace.c 
>> +++ b/kernel/pid_namespace.c 
>> @@ -92,8 +92,9 @@ static void dec_pid_namespaces(struct ucounts *ucounts) 
>>          dec_ucount(ucounts, UCOUNT_PID_NAMESPACES); 
>>  } 
>>   
>> -static struct pid_namespace *create_pid_namespace(struct user_namespace 
>> *user_ns, 
>> -        struct pid_namespace *parent_pid_ns) 
>>
> Hi Gargi
> I think I have already made this change
>  Thanks
> Arushi
>
Sorry
My bad I have done the similar patch but not on same.
Thanks
Arushi 

> +static struct 
>> +pid_namespace *create_pid_namespace(struct user_namespace *user_ns, 
>> +                                    struct pid_namespace *parent_pid_ns) 
>>  { 
>>          struct pid_namespace *ns; 
>>          unsigned int level = parent_pid_ns->level + 1; 
>> -- 
>> 2.7.4 
>>
>>

[-- Attachment #1.2: Type: text/html, Size: 2090 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-03-27 19:15 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-26 14:48 [PATCH 0/3] Fix multiple checkpatch issues Gargi Sharma
2017-03-26 14:48 ` [PATCH 1/3] kernel: pid_namespace: Remove return statement from void function Gargi Sharma
2017-03-27 15:50   ` Matthew Wilcox
2017-03-26 14:48 ` [PATCH 2/3] kernel: pid_namespace: Fix line over 80 characters Gargi Sharma
2017-03-27 15:51   ` Matthew Wilcox
2017-03-27 19:12   ` Arushi Singhal
2017-03-27 19:15     ` Arushi Singhal
2017-03-26 14:48 ` [PATCH 3/3] kernel: pid_namespace: Do not initialise statics to 0 Gargi Sharma

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.