Fix multiple checkpatch issues
cover Fix multiple checkpatch issues
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(-)
Signature · 1 line
2.7.4
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.
--- kernel/pid_namespace.c | 1 - 1 file changed, 1 deletion(-)
kernel/pid_namespace.c +0 -1
@@ -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
Signature · 1 line
2.7.4
PATCH 2/3 kernel: pid_namespace: Fix line over 80 characters
In reply to Gargi SharmaLine over 80 characters are split to fix the following checkpatch issue:
WARNING: line over 80 characters
--- kernel/pid_namespace.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
kernel/pid_namespace.c +3 -2
@@ -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 ;
Signature · 1 line
2.7.4
PATCH 3/3 kernel: pid_namespace: Do not initialise statics to 0
In reply to Gargi SharmaStatic variables are initialised to 0 by GCC.
Fixes the following checkpatch error:
ERROR: do not initialise statics to 0 or NULL
--- kernel/pid_namespace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/pid_namespace.c +1 -1
@@ -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" ,
Signature · 1 line
2.7.4
RE: [PATCH 1/3] kernel: pid_namespace: Remove return statement from void function
In reply to Gargi SharmaYes, 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 :-)
Quoted 34 lines
-----Original Message-----
From: Gargi Sharma [mailto:[email protected]]
Sent: Sunday, March 26, 2017 10:48 AM
To: Matthew Wilcox <[email protected]>
Cc: [email protected]; Gargi Sharma <[email protected]>
Subject: [PATCH 1/3] kernel:pid_namespace: Remove return statement from void function
zap_pid_ns_processesis a void function and the return statement at the end is not useful.Found with checkpatch.
Signed-off-by Gargi Sharma <[email protected]>--- kernel/pid_namespace.c | 1 - 1 file changed, 1 deletion(-)kernel/pid_namespace.c +0
-1@@ -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
RE: [PATCH 2/3] kernel: pid_namespace: Fix line over 80 characters
In reply to Gargi SharmaOoh, 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'.
Quoted 36 lines
-----Original Message-----
From: Gargi Sharma [mailto:[email protected]]
Sent: Sunday, March 26, 2017 10:48 AM
To: Matthew Wilcox <[email protected]>
Cc: [email protected]; Gargi Sharma <[email protected]>
Subject: [PATCH 2/3] kernel:pid_namespace: Fix line over 80 charactersLine over 80 characters are split to fix the following checkpatch issue:
WARNING: line over 80 charactersSigned-off-by Gargi Sharma <[email protected]>--- kernel/pid_namespace.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)kernel/pid_namespace.c +3
-2@@ -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
Re: [PATCH 2/3] kernel: pid_namespace: Fix line over 80 characters
In reply to Gargi SharmaQuoted 15 lines · Gargi Sharma
Line over 80 characters are split to fix the following checkpatch issue:
WARNING: line over 80 charactersSigned-off-by Gargi Sharma <[email protected] <javascript:>>---
kernel/pid_namespace.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)kernel/pid_namespace.c +0
-0
kernel/pid_namespace.c static void dec_pid_namespaces(struct ucounts *ucounts) · line 96
Quoted 7 lines
kernel/pid_namespace.c +0
-2@@ -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
Quoted 10 lines
kernel/pid_namespace.c +3
-0+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;Signature · 1 line
2.7.4
Re: [PATCH 2/3] kernel: pid_namespace: Fix line over 80 characters
Quoted 22 lines · Arushi Singhal
Quoted 18 lines · Gargi Sharma
Line over 80 characters are split to fix the following checkpatch issue:
WARNING: line over 80 charactersSigned-off-by Gargi Sharma <[email protected]>---
kernel/pid_namespace.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)kernel/pid_namespace.c +0
-0@@ -92,8 +92,9 @@ static void dec_pid_namespaces(struct ucounts *ucounts)dec_ucount (ucounts,UCOUNT_PID_NAMESPACES ); }
Quoted 9 lines
kernel/pid_namespace.c static void dec_pid_namespaces(struct ucounts *ucounts) · line 96
Quoted 4 lines
kernel/pid_namespace.c +0
-2-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
Quoted 10 lines
+static struct
Quoted 9 lines
kernel/pid_namespace.c +2
-0+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 ;Signature · 1 line
2.7.4