Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

printk: declare printk_ratelimit_state in ratelimit.h

Adding declaration of printk_ratelimit_state in ratelimit.h removes
potential build breakage and following sparse warning:

kernel/printk.c:1426:1: warning: symbol 'printk_ratelimit_state' was not declared. Should it be static?

[akpm@linux-foundation.org: remove unneeded ifdef]
Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Namhyung Kim and committed by
Linus Torvalds
f5d87d85 674dff65

+2 -2
+2
include/linux/ratelimit.h
··· 36 36 rs->begin = 0; 37 37 } 38 38 39 + extern struct ratelimit_state printk_ratelimit_state; 40 + 39 41 extern int ___ratelimit(struct ratelimit_state *rs, const char *func); 40 42 #define __ratelimit(state) ___ratelimit(state, __func__) 41 43
-2
kernel/sysctl.c
··· 161 161 extern int unaligned_dump_stack; 162 162 #endif 163 163 164 - extern struct ratelimit_state printk_ratelimit_state; 165 - 166 164 #ifdef CONFIG_PROC_SYSCTL 167 165 static int proc_do_cad_pid(struct ctl_table *table, int write, 168 166 void __user *buffer, size_t *lenp, loff_t *ppos);