]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
printk/cache: Mark printk_once test variable __read_mostly
authorJoe Perches <joe@perches.com>
Wed, 15 Jan 2014 05:55:26 +0000 (16:55 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 15 Jan 2014 05:55:26 +0000 (16:55 +1100)
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>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/cache.h
include/linux/printk.h

index 4c570653ab84f9822ba9e1e1f19a41242c16b74f..17e7e82d2aa758f9888419a9c03aa4059e16b247 100644 (file)
@@ -1,11 +1,11 @@
 #ifndef __LINUX_CACHE_H
 #define __LINUX_CACHE_H
 
-#include <linux/kernel.h>
+#include <uapi/linux/kernel.h>
 #include <asm/cache.h>
 
 #ifndef L1_CACHE_ALIGN
-#define L1_CACHE_ALIGN(x) ALIGN(x, L1_CACHE_BYTES)
+#define L1_CACHE_ALIGN(x) __ALIGN_KERNEL(x, L1_CACHE_BYTES)
 #endif
 
 #ifndef SMP_CACHE_BYTES
index 694925837a1645bb7297cc9254efee7173a32197..cc6f74d65167b47f4a59da3c8af04190329cf6f5 100644 (file)
@@ -5,6 +5,7 @@
 #include <linux/init.h>
 #include <linux/kern_levels.h>
 #include <linux/linkage.h>
+#include <linux/cache.h>
 
 extern const char linux_banner[];
 extern const char linux_proc_banner[];
@@ -253,17 +254,17 @@ extern asmlinkage void dump_stack(void) __cold;
  */
 
 #ifdef CONFIG_PRINTK
-#define printk_once(fmt, ...)                  \
-({                                             \
-       static bool __print_once;               \
-                                               \
-       if (!__print_once) {                    \
-               __print_once = true;            \
-               printk(fmt, ##__VA_ARGS__);     \
-       }                                       \
+#define printk_once(fmt, ...)                                  \
+({                                                             \
+       static bool __print_once __read_mostly;                 \
+                                                               \
+       if (!__print_once) {                                    \
+               __print_once = true;                            \
+               printk(fmt, ##__VA_ARGS__);                     \
+       }                                                       \
 })
 #else
-#define printk_once(fmt, ...)                  \
+#define printk_once(fmt, ...)                                  \
        no_printk(fmt, ##__VA_ARGS__)
 #endif