All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] kernel: pid: Multiple checkpatch issues.
@ 2017-03-28 20:45 Arushi Singhal
  2017-03-28 20:45 ` [PATCH 1/5] kernel: pid: remove space after open square bracket Arushi Singhal
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Arushi Singhal @ 2017-03-28 20:45 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: linux-kernel, Arushi Singhal

Fix multiple checkpatch.pl issue to improve code readability.

Arushi Singhal (5):
  kernel: pid: remove space after open square bracket
  kernel: pid.c: Add space before the open parenthesis
  kernel: pid: Fix line over 80 characters
  kernel: pid_namespace: Remove return statement from void function
  kernel: pid_namespace.c: Do not initialise statics to 0.

 kernel/pid.c           |  8 +++++---
 kernel/pid_namespace.c | 10 ++++++----
 2 files changed, 11 insertions(+), 7 deletions(-)

-- 
2.11.0



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

* [PATCH 1/5] kernel: pid: remove space after open square bracket
  2017-03-28 20:45 [PATCH 0/5] kernel: pid: Multiple checkpatch issues Arushi Singhal
@ 2017-03-28 20:45 ` Arushi Singhal
  2017-03-28 20:45 ` [PATCH 2/5] kernel: pid.c: Add space before the open parenthesis Arushi Singhal
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Arushi Singhal @ 2017-03-28 20:45 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: linux-kernel, Arushi Singhal

Remove the space after open square bracket as reported by checkpatch.pl.

Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
---
 kernel/pid.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/pid.c b/kernel/pid.c
index 0143ac0ddceb..59ec7a671e06 100644
--- a/kernel/pid.c
+++ b/kernel/pid.c
@@ -71,7 +71,7 @@ static inline int mk_pid(struct pid_namespace *pid_ns,
 struct pid_namespace init_pid_ns = {
 	.kref = KREF_INIT(2),
 	.pidmap = {
-		[ 0 ... PIDMAP_ENTRIES-1] = { ATOMIC_INIT(BITS_PER_PAGE), NULL }
+		[0 ... PIDMAP_ENTRIES-1] = { ATOMIC_INIT(BITS_PER_PAGE), NULL }
 	},
 	.last_pid = 0,
 	.nr_hashed = PIDNS_HASH_ADDING,
-- 
2.11.0



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

* [PATCH 2/5] kernel: pid.c: Add space before the open parenthesis
  2017-03-28 20:45 [PATCH 0/5] kernel: pid: Multiple checkpatch issues Arushi Singhal
  2017-03-28 20:45 ` [PATCH 1/5] kernel: pid: remove space after open square bracket Arushi Singhal
@ 2017-03-28 20:45 ` Arushi Singhal
  2017-03-28 20:45 ` [PATCH 3/5] kernel: pid: Fix line over 80 characters Arushi Singhal
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Arushi Singhal @ 2017-03-28 20:45 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: linux-kernel, Arushi Singhal

Add the space before open parenthesis as reported by checkpatch.pl

Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
---
 kernel/pid.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/pid.c b/kernel/pid.c
index 59ec7a671e06..5822142ca92a 100644
--- a/kernel/pid.c
+++ b/kernel/pid.c
@@ -266,7 +266,7 @@ void free_pid(struct pid *pid)
 		struct upid *upid = pid->numbers + i;
 		struct pid_namespace *ns = upid->ns;
 		hlist_del_rcu(&upid->pid_chain);
-		switch(--ns->nr_hashed) {
+		switch (--ns->nr_hashed) {
 		case 2:
 		case 1:
 			/* When all that is left in the pid namespace
-- 
2.11.0



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

* [PATCH 3/5] kernel: pid: Fix line over 80 characters
  2017-03-28 20:45 [PATCH 0/5] kernel: pid: Multiple checkpatch issues Arushi Singhal
  2017-03-28 20:45 ` [PATCH 1/5] kernel: pid: remove space after open square bracket Arushi Singhal
  2017-03-28 20:45 ` [PATCH 2/5] kernel: pid.c: Add space before the open parenthesis Arushi Singhal
@ 2017-03-28 20:45 ` Arushi Singhal
  2017-03-28 20:45 ` [PATCH 4/5] kernel: pid_namespace: Remove return statement from void function Arushi Singhal
  2017-03-28 20:45 ` [PATCH 5/5] kernel: pid_namespace.c: Do not initialise statics to 0 Arushi Singhal
  4 siblings, 0 replies; 6+ messages in thread
From: Arushi Singhal @ 2017-03-28 20:45 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: linux-kernel, Arushi Singhal

This patch splits line over 80 characters addressing checkpatch.pl
warning

Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
---
 kernel/pid.c           | 4 +++-
 kernel/pid_namespace.c | 7 +++++--
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/kernel/pid.c b/kernel/pid.c
index 5822142ca92a..dd514309d982 100644
--- a/kernel/pid.c
+++ b/kernel/pid.c
@@ -439,7 +439,9 @@ struct task_struct *pid_task(struct pid *pid, enum pid_type type)
 		first = rcu_dereference_check(hlist_first_rcu(&pid->tasks[type]),
 					      lockdep_tasklist_lock_is_held());
 		if (first)
-			result = hlist_entry(first, struct task_struct, pids[(type)].node);
+			result = hlist_entry(first,
+					     struct task_struct,
+					     pids[(type)].node);
 	}
 	return result;
 }
diff --git a/kernel/pid_namespace.c b/kernel/pid_namespace.c
index de461aa0bf9a..778959ecd5c3 100644
--- a/kernel/pid_namespace.c
+++ b/kernel/pid_namespace.c
@@ -75,7 +75,9 @@ static struct kmem_cache *create_pid_cachep(int nr_ids)
 
 static void proc_cleanup_work(struct work_struct *work)
 {
-	struct pid_namespace *ns = container_of(work, struct pid_namespace, proc_work);
+	struct pid_namespace *ns = container_of(work,
+						struct pid_namespace,
+						proc_work);
 	pid_ns_release_proc(ns);
 }
 
@@ -89,7 +91,8 @@ static struct ucounts *inc_pid_namespaces(struct user_namespace *ns)
 
 static void dec_pid_namespaces(struct ucounts *ucounts)
 {
-	dec_ucount(ucounts, UCOUNT_PID_NAMESPACES);
+	dec_ucount(ucounts,
+		   UCOUNT_PID_NAMESPACES);
 }
 
 static struct pid_namespace *create_pid_namespace(struct user_namespace *user_ns,
-- 
2.11.0



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

* [PATCH 4/5] kernel: pid_namespace: Remove return statement from void function
  2017-03-28 20:45 [PATCH 0/5] kernel: pid: Multiple checkpatch issues Arushi Singhal
                   ` (2 preceding siblings ...)
  2017-03-28 20:45 ` [PATCH 3/5] kernel: pid: Fix line over 80 characters Arushi Singhal
@ 2017-03-28 20:45 ` Arushi Singhal
  2017-03-28 20:45 ` [PATCH 5/5] kernel: pid_namespace.c: Do not initialise statics to 0 Arushi Singhal
  4 siblings, 0 replies; 6+ messages in thread
From: Arushi Singhal @ 2017-03-28 20:45 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: linux-kernel, Arushi Singhal

Remove the return statement from void function as is not useful.

Signed-off-by: Arushi Singhal <arushisinghal19971997@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 778959ecd5c3..be35c2fe725f 100644
--- a/kernel/pid_namespace.c
+++ b/kernel/pid_namespace.c
@@ -291,7 +291,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.11.0



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

* [PATCH 5/5] kernel: pid_namespace.c: Do not initialise statics to 0.
  2017-03-28 20:45 [PATCH 0/5] kernel: pid: Multiple checkpatch issues Arushi Singhal
                   ` (3 preceding siblings ...)
  2017-03-28 20:45 ` [PATCH 4/5] kernel: pid_namespace: Remove return statement from void function Arushi Singhal
@ 2017-03-28 20:45 ` Arushi Singhal
  4 siblings, 0 replies; 6+ messages in thread
From: Arushi Singhal @ 2017-03-28 20:45 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: linux-kernel, Arushi Singhal

Do not initialise statics to 0.
static variable by default initialise to 0,so no need to explicite
initialisation.
This issue was found by checkpatch.

Signed-off-by: Arushi Singhal <arushisinghal19971997@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 be35c2fe725f..1bfbee50177b 100644
--- a/kernel/pid_namespace.c
+++ b/kernel/pid_namespace.c
@@ -314,7 +314,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.11.0



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

end of thread, other threads:[~2017-03-28 20:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-28 20:45 [PATCH 0/5] kernel: pid: Multiple checkpatch issues Arushi Singhal
2017-03-28 20:45 ` [PATCH 1/5] kernel: pid: remove space after open square bracket Arushi Singhal
2017-03-28 20:45 ` [PATCH 2/5] kernel: pid.c: Add space before the open parenthesis Arushi Singhal
2017-03-28 20:45 ` [PATCH 3/5] kernel: pid: Fix line over 80 characters Arushi Singhal
2017-03-28 20:45 ` [PATCH 4/5] kernel: pid_namespace: Remove return statement from void function Arushi Singhal
2017-03-28 20:45 ` [PATCH 5/5] kernel: pid_namespace.c: Do not initialise statics to 0 Arushi Singhal

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.