Skip to contentSkip to conversation

sched.h: make max_threads "extern int" to fix sparse warning

PATCH New Paul Gortmaker 1 participant 1 message Feb 6, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sched.h: make max_threads "extern int" to fix sparse warning

Fixes:

kernel/fork.c:93:5: warning: symbol 'max_threads' was not declared. Should it be static?

Cc Ingo Molnar <[email protected]>
Cc Peter Zijlstra <[email protected]>
---
 include/linux/sched.h | 1 +
 kernel/kmod.c         | 2 --
 kernel/sysctl.c       | 2 +-
 3 files changed, 2 insertions(+), 3 deletions(-)
include/linux/sched.h +1 -0
index 69c6089944c8..af544d650617 100644
@@ -163,6 +163,7 @@ extern void get_avenrun(unsigned long *loads, unsigned long offset, int shift);
 
 extern unsigned long total_forks;
 extern int nr_threads;
+extern int max_threads;
 DECLARE_PER_CPU(unsigned long, process_counts);
 extern int nr_processes(void);
 extern unsigned long nr_running(void);
kernel/kmod.c +0 -2
index 55a36537fef4..4aa49adec5dd 100644
@@ -44,8 +44,6 @@
 
 #include <trace/events/module.h>
 
-extern int max_threads;
-
 static struct workqueue_struct *khelper_wq;
 
 /*
kernel/sysctl.c +1 -1
index 7754ff16f334..c8ac136fcec1 100644
@@ -22,6 +22,7 @@
 #include <linux/mm.h>
 #include <linux/swap.h>
 #include <linux/slab.h>
+#include <linux/sched.h>
 #include <linux/sysctl.h>
 #include <linux/bitmap.h>
 #include <linux/signal.h>
@@ -96,7 +97,6 @@
 #if defined(CONFIG_SYSCTL)
 
 /* External variables not in a header file. */
-extern int max_threads;
 extern int suid_dumpable;
 #ifdef CONFIG_COREDUMP
 extern int core_uses_pid;
Signature · 1 line
1.8.5.2