aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2014-01-23 18:54:16 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-01-23 19:36:56 -0500
commitc28aa1f0a847c36daa4280b611e2b54bad75c576 (patch)
tree38c36fb3a1a989f95979e5e48e8b1f21fef88bcf
parent8f073bd0d0bf7c519854a196215a837abbfbdc62 (diff)
printk/cache: mark printk_once test variable __read_mostly
Add #include <linux/cache.h> to define __read_mostly. Convert cache.h to use uapi/linux/kernel.h instead of linux/kernel.h to avoid recursive #includes. Convert the ALIGN macro to __ALIGN_KERNEL. printk_once only sets the bool variable tested once so mark it __read_mostly. Neaten the alignment so it matches the rest of the pr_<level>_once #defines too. Signed-off-by: Joe Perches <joe@perches.com> Reviewed-by: James Hogan <james.hogan@imgtec.com> Cc: Wu Fengguang <fengguang.wu@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--arch/ia64/include/asm/processor.h1
-rw-r--r--include/linux/cache.h4
-rw-r--r--include/linux/printk.h19
3 files changed, 13 insertions, 11 deletions
diff --git a/arch/ia64/include/asm/processor.h b/arch/ia64/include/asm/processor.h
index 5a84b3a50741..efd1b927ccb7 100644
--- a/arch/ia64/include/asm/processor.h
+++ b/arch/ia64/include/asm/processor.h
@@ -71,6 +71,7 @@
71#include <linux/compiler.h> 71#include <linux/compiler.h>
72#include <linux/threads.h> 72#include <linux/threads.h>
73#include <linux/types.h> 73#include <linux/types.h>
74#include <linux/bitops.h>
74 75
75#include <asm/fpu.h> 76#include <asm/fpu.h>
76#include <asm/page.h> 77#include <asm/page.h>
diff --git a/include/linux/cache.h b/include/linux/cache.h
index 4c570653ab84..17e7e82d2aa7 100644
--- a/include/linux/cache.h
+++ b/include/linux/cache.h
@@ -1,11 +1,11 @@
1#ifndef __LINUX_CACHE_H 1#ifndef __LINUX_CACHE_H
2#define __LINUX_CACHE_H 2#define __LINUX_CACHE_H
3 3
4#include <linux/kernel.h> 4#include <uapi/linux/kernel.h>
5#include <asm/cache.h> 5#include <asm/cache.h>
6 6
7#ifndef L1_CACHE_ALIGN 7#ifndef L1_CACHE_ALIGN
8#define L1_CACHE_ALIGN(x) ALIGN(x, L1_CACHE_BYTES) 8#define L1_CACHE_ALIGN(x) __ALIGN_KERNEL(x, L1_CACHE_BYTES)
9#endif 9#endif
10 10
11#ifndef SMP_CACHE_BYTES 11#ifndef SMP_CACHE_BYTES
diff --git a/include/linux/printk.h b/include/linux/printk.h
index 694925837a16..cc6f74d65167 100644
--- a/include/linux/printk.h
+++ b/include/linux/printk.h
@@ -5,6 +5,7 @@
5#include <linux/init.h> 5#include <linux/init.h>
6#include <linux/kern_levels.h> 6#include <linux/kern_levels.h>
7#include <linux/linkage.h> 7#include <linux/linkage.h>
8#include <linux/cache.h>
8 9
9extern const char linux_banner[]; 10extern const char linux_banner[];
10extern const char linux_proc_banner[]; 11extern const char linux_proc_banner[];
@@ -253,17 +254,17 @@ extern asmlinkage void dump_stack(void) __cold;
253 */ 254 */
254 255
255#ifdef CONFIG_PRINTK 256#ifdef CONFIG_PRINTK
256#define printk_once(fmt, ...) \ 257#define printk_once(fmt, ...) \
257({ \ 258({ \
258 static bool __print_once; \ 259 static bool __print_once __read_mostly; \
259 \ 260 \
260 if (!__print_once) { \ 261 if (!__print_once) { \
261 __print_once = true; \ 262 __print_once = true; \
262 printk(fmt, ##__VA_ARGS__); \ 263 printk(fmt, ##__VA_ARGS__); \
263 } \ 264 } \
264}) 265})
265#else 266#else
266#define printk_once(fmt, ...) \ 267#define printk_once(fmt, ...) \
267 no_printk(fmt, ##__VA_ARGS__) 268 no_printk(fmt, ##__VA_ARGS__)
268#endif 269#endif
269 270