Skip to content

Commit

Permalink
printk: Remove ratelimit.h from kernel.h
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ingo Molnar committed Sep 22, 2009
1 parent edaac8e commit 3fff4c4
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 3 deletions.
2 changes: 0 additions & 2 deletions include/linux/kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include <linux/bitops.h>
#include <linux/log2.h>
#include <linux/typecheck.h>
#include <linux/ratelimit.h>
#include <linux/dynamic_debug.h>
#include <asm/byteorder.h>
#include <asm/bug.h>
Expand Down Expand Up @@ -241,7 +240,6 @@ asmlinkage int vprintk(const char *fmt, va_list args)
asmlinkage int printk(const char * fmt, ...)
__attribute__ ((format (printf, 1, 2))) __cold;

extern struct ratelimit_state printk_ratelimit_state;
extern int printk_ratelimit(void);
extern bool printk_timed_ratelimit(unsigned long *caller_jiffies,
unsigned int interval_msec);
Expand Down
1 change: 1 addition & 0 deletions include/linux/net.h
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@ static const struct proto_ops name##_ops = { \

#ifdef CONFIG_SYSCTL
#include <linux/sysctl.h>
#include <linux/ratelimit.h>
extern struct ratelimit_state net_ratelimit_state;
#endif

Expand Down
1 change: 1 addition & 0 deletions kernel/printk.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include <linux/bootmem.h>
#include <linux/syscalls.h>
#include <linux/kexec.h>
#include <linux/ratelimit.h>

#include <asm/uaccess.h>

Expand Down
3 changes: 3 additions & 0 deletions kernel/sysctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include <linux/sysrq.h>
#include <linux/highuid.h>
#include <linux/writeback.h>
#include <linux/ratelimit.h>
#include <linux/hugetlb.h>
#include <linux/initrd.h>
#include <linux/key.h>
Expand Down Expand Up @@ -155,6 +156,8 @@ extern int no_unaligned_warning;
extern int unaligned_dump_stack;
#endif

extern struct ratelimit_state printk_ratelimit_state;

#ifdef CONFIG_RT_MUTEXES
extern int max_lock_depth;
#endif
Expand Down
2 changes: 1 addition & 1 deletion lib/ratelimit.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* This file is released under the GPLv2.
*/

#include <linux/kernel.h>
#include <linux/ratelimit.h>
#include <linux/jiffies.h>
#include <linux/module.h>

Expand Down
2 changes: 2 additions & 0 deletions net/core/sysctl_net_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
#include <linux/module.h>
#include <linux/socket.h>
#include <linux/netdevice.h>
#include <linux/ratelimit.h>
#include <linux/init.h>

#include <net/ip.h>
#include <net/sock.h>

Expand Down
2 changes: 2 additions & 0 deletions net/core/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
#include <linux/types.h>
#include <linux/percpu.h>
#include <linux/init.h>
#include <linux/ratelimit.h>

#include <net/sock.h>

#include <asm/byteorder.h>
Expand Down

0 comments on commit 3fff4c4

Please sign in to comment.