Skip to contentSkip to conversation

pid_namespace: Remove externs from .c files

PATCH In review sayli karnik 2 participants 2 messages Mar 26, 2017 Namespaces:

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pid_namespace: Remove externs from .c files

Fix checkpatch issue: Externs should be avoided in .c files

---
 include/linux/pid_namespace.h | 1 +
 kernel/pid_namespace.c        | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)
include/linux/pid_namespace.h +1 -0
index c2a989d..5a7e664 100644
@@ -66,6 +66,7 @@ static inline struct pid_namespace *get_pid_ns(struct pid_namespace *ns)
 	return ns;
 }
 
+extern int pid_max;
 extern struct pid_namespace *copy_pid_ns(unsigned long flags,
 	struct user_namespace *user_ns, struct pid_namespace *ns);
 extern void zap_pid_ns_processes(struct pid_namespace *pid_ns);
kernel/pid_namespace.c +0 -1
index de461aa..37e2b52 100644
@@ -311,7 +311,6 @@ static int pid_ns_ctl_handler(struct ctl_table *table, int write,
 	return proc_dointvec_minmax(&tmp, write, buffer, lenp, ppos);
 }
 
-extern int pid_max;
 static int zero = 0;
 static struct ctl_table pid_ns_ctl_table[] = {
 	{
Signature · 1 line
2.7.4
#1 lore raw
Quoted 25 lines · sayli karnik

Fix checkpatch issue: Externs should be avoided in .c files

---
 include/linux/pid_namespace.h | 1 +
 kernel/pid_namespace.c        | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)
include/linux/pid_namespace.h +1 -0
index c2a989d..5a7e664 100644
@@ -66,6 +66,7 @@ static inline struct pid_namespace *get_pid_ns(struct pid_namespace *ns)
 	return ns;
 }
 
+extern int pid_max;
 extern struct pid_namespace *copy_pid_ns(unsigned long flags,
 	struct user_namespace *user_ns, struct pid_namespace *ns);
 extern void zap_pid_ns_processes(struct pid_namespace *pid_ns);
kernel/pid_namespace.c +0 -0
index de461aa..37e2b52 100644

kernel/pid_namespace.c static int pid_ns_ctl_handler(struct ctl_table *table, int write, · line 315

Quoted 6 lines
kernel/pid_namespace.c +0 -1
@@ -311,7 +311,6 @@ static int pid_ns_ctl_handler(struct ctl_table *table, int write,
 	return proc_dointvec_minmax(&tmp, write, buffer, lenp, ppos);
 }
 
-extern int pid_max;
 static int zero = 0;
 static struct ctl_table pid_ns_ctl_table[] = {

I wondered whether this structure could be const. It seems that it is not completely trivial to do that, but there is a structure just below this one that could be const.

julia

Quoted 11 lines
kernel/pid_namespace.c +0 -1
 	{
--

2.7.4

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20170326151131.GA14870%40sayli-HP-15-Notebook-PC.
For more options, visit https://groups.google.com/d/optout.