Commit e99aa461 authored by Alex Elder's avatar Alex Elder Committed by Linus Torvalds

printk: use a clever macro

Use the IS_ENABLED() macro rather than #ifdef blocks to set certain
global values.
Signed-off-by: default avatarAlex Elder <elder@linaro.org>
Acked-by: default avatarBorislav Petkov <bp@suse.de>
Reviewed-by: default avatarPetr 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: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 0b90fec3
...@@ -454,11 +454,7 @@ static int log_store(int facility, int level, ...@@ -454,11 +454,7 @@ static int log_store(int facility, int level,
return msg->text_len; return msg->text_len;
} }
#ifdef CONFIG_SECURITY_DMESG_RESTRICT int dmesg_restrict = IS_ENABLED(CONFIG_SECURITY_DMESG_RESTRICT);
int dmesg_restrict = 1;
#else
int dmesg_restrict;
#endif
static int syslog_action_restricted(int type) static int syslog_action_restricted(int type)
{ {
...@@ -988,11 +984,7 @@ static inline void boot_delay_msec(int level) ...@@ -988,11 +984,7 @@ static inline void boot_delay_msec(int level)
} }
#endif #endif
#if defined(CONFIG_PRINTK_TIME) static bool printk_time = IS_ENABLED(CONFIG_PRINTK_TIME);
static bool printk_time = 1;
#else
static bool printk_time;
#endif
module_param_named(time, printk_time, bool, S_IRUGO | S_IWUSR); module_param_named(time, printk_time, bool, S_IRUGO | S_IWUSR);
static size_t print_time(u64 ts, char *buf) static size_t print_time(u64 ts, char *buf)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment