aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/printk/printk.c
diff options
context:
space:
mode:
authorAlex Elder <elder@linaro.org>2014-08-06 19:09:05 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-08-06 21:01:24 -0400
commite99aa461660a6413b11da887fb499e04a0f46803 (patch)
tree178dc2d1eddad3d97e4cf5cb15c2c723458b0b5f /kernel/printk/printk.c
parent0b90fec3b990b50d77944bc73c1ba4b031dfa52f (diff)
printk: use a clever macro
Use the IS_ENABLED() macro rather than #ifdef blocks to set certain global values. Signed-off-by: Alex Elder <elder@linaro.org> Acked-by: Borislav Petkov <bp@suse.de> Reviewed-by: Petr Mladek <pmladek@suse.cz> Cc: Andi Kleen <ak@linux.intel.com> Cc: Jan Kara <jack@suse.cz> Cc: John Stultz <john.stultz@linaro.org> Cc: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/printk/printk.c')
-rw-r--r--kernel/printk/printk.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index 4bae344c1ec3..ac86838227ed 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -454,11 +454,7 @@ static int log_store(int facility, int level,
454 return msg->text_len; 454 return msg->text_len;
455} 455}
456 456
457#ifdef CONFIG_SECURITY_DMESG_RESTRICT 457int dmesg_restrict = IS_ENABLED(CONFIG_SECURITY_DMESG_RESTRICT);
458int dmesg_restrict = 1;
459#else
460int dmesg_restrict;
461#endif
462 458
463static int syslog_action_restricted(int type) 459static int syslog_action_restricted(int type)
464{ 460{
@@ -988,11 +984,7 @@ static inline void boot_delay_msec(int level)
988} 984}
989#endif 985#endif
990 986
991#if defined(CONFIG_PRINTK_TIME) 987static bool printk_time = IS_ENABLED(CONFIG_PRINTK_TIME);
992static bool printk_time = 1;
993#else
994static bool printk_time;
995#endif
996module_param_named(time, printk_time, bool, S_IRUGO | S_IWUSR); 988module_param_named(time, printk_time, bool, S_IRUGO | S_IWUSR);
997 989
998static size_t print_time(u64 ts, char *buf) 990static size_t print_time(u64 ts, char *buf)