Commit 3fff4c42bd0a89869a0eb1e7874cc06ffa4aa0f5

Authored by Ingo Molnar
1 parent edaac8e316

printk: Remove ratelimit.h from kernel.h

Decouple kernel.h from ratelimit.h: the global declaration of
printk's ratelimit_state is not needed, and it leads to messy
circular dependencies due to ratelimit.h's (new) adding of a
spinlock_types.h include.

Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: David S. Miller <davem@davemloft.net>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>

Showing 7 changed files with 10 additions and 3 deletions Side-by-side Diff

include/linux/kernel.h
... ... @@ -15,7 +15,6 @@
15 15 #include <linux/bitops.h>
16 16 #include <linux/log2.h>
17 17 #include <linux/typecheck.h>
18   -#include <linux/ratelimit.h>
19 18 #include <linux/dynamic_debug.h>
20 19 #include <asm/byteorder.h>
21 20 #include <asm/bug.h>
... ... @@ -241,7 +240,6 @@
241 240 asmlinkage int printk(const char * fmt, ...)
242 241 __attribute__ ((format (printf, 1, 2))) __cold;
243 242  
244   -extern struct ratelimit_state printk_ratelimit_state;
245 243 extern int printk_ratelimit(void);
246 244 extern bool printk_timed_ratelimit(unsigned long *caller_jiffies,
247 245 unsigned int interval_msec);
... ... @@ -358,6 +358,7 @@
358 358  
359 359 #ifdef CONFIG_SYSCTL
360 360 #include <linux/sysctl.h>
  361 +#include <linux/ratelimit.h>
361 362 extern struct ratelimit_state net_ratelimit_state;
362 363 #endif
363 364  
... ... @@ -33,6 +33,7 @@
33 33 #include <linux/bootmem.h>
34 34 #include <linux/syscalls.h>
35 35 #include <linux/kexec.h>
  36 +#include <linux/ratelimit.h>
36 37  
37 38 #include <asm/uaccess.h>
38 39  
... ... @@ -37,6 +37,7 @@
37 37 #include <linux/sysrq.h>
38 38 #include <linux/highuid.h>
39 39 #include <linux/writeback.h>
  40 +#include <linux/ratelimit.h>
40 41 #include <linux/hugetlb.h>
41 42 #include <linux/initrd.h>
42 43 #include <linux/key.h>
... ... @@ -154,6 +155,8 @@
154 155 extern int no_unaligned_warning;
155 156 extern int unaligned_dump_stack;
156 157 #endif
  158 +
  159 +extern struct ratelimit_state printk_ratelimit_state;
157 160  
158 161 #ifdef CONFIG_RT_MUTEXES
159 162 extern int max_lock_depth;
... ... @@ -9,7 +9,7 @@
9 9 * This file is released under the GPLv2.
10 10 */
11 11  
12   -#include <linux/kernel.h>
  12 +#include <linux/ratelimit.h>
13 13 #include <linux/jiffies.h>
14 14 #include <linux/module.h>
15 15  
net/core/sysctl_net_core.c
... ... @@ -10,7 +10,9 @@
10 10 #include <linux/module.h>
11 11 #include <linux/socket.h>
12 12 #include <linux/netdevice.h>
  13 +#include <linux/ratelimit.h>
13 14 #include <linux/init.h>
  15 +
14 16 #include <net/ip.h>
15 17 #include <net/sock.h>
16 18  
... ... @@ -24,6 +24,8 @@
24 24 #include <linux/types.h>
25 25 #include <linux/percpu.h>
26 26 #include <linux/init.h>
  27 +#include <linux/ratelimit.h>
  28 +
27 29 #include <net/sock.h>
28 30  
29 31 #include <asm/byteorder.h>