The patch titled Subject: printk: use a clever macro has been added to the -mm tree. Its filename is printk-use-a-clever-macro.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/printk-use-a-clever-macro.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/printk-use-a-clever-macro.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Alex Elder <elder@xxxxxxxxxx> Subject: 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@xxxxxxxxxx> Acked-by: Borislav Petkov <bp@xxxxxxx> Reviewed-by: Petr Mladek <pmladek@xxxxxxx> Cc: Andi Kleen <ak@xxxxxxxxxxxxxxx> Cc: Jan Kara <jack@xxxxxxx> Cc: John Stultz <john.stultz@xxxxxxxxxx> Cc: Steven Rostedt <rostedt@xxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- kernel/printk/printk.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff -puN kernel/printk/printk.c~printk-use-a-clever-macro kernel/printk/printk.c --- a/kernel/printk/printk.c~printk-use-a-clever-macro +++ a/kernel/printk/printk.c @@ -454,11 +454,7 @@ static int log_store(int facility, int l return msg->text_len; } -#ifdef CONFIG_SECURITY_DMESG_RESTRICT -int dmesg_restrict = 1; -#else -int dmesg_restrict; -#endif +int dmesg_restrict = IS_ENABLED(CONFIG_SECURITY_DMESG_RESTRICT); static int syslog_action_restricted(int type) { @@ -988,11 +984,7 @@ static inline void boot_delay_msec(int l } #endif -#if defined(CONFIG_PRINTK_TIME) -static bool printk_time = 1; -#else -static bool printk_time; -#endif +static bool printk_time = IS_ENABLED(CONFIG_PRINTK_TIME); module_param_named(time, printk_time, bool, S_IRUGO | S_IWUSR); static size_t print_time(u64 ts, char *buf) _ Patches currently in -mm which might be from elder@xxxxxxxxxx are printk-tweak-do_syslog-to-match-comments.patch printk-rename-default_message_loglevel.patch printk-fix-some-comments.patch printk-use-a-clever-macro.patch printk-miscellaneous-cleanups.patch linux-next.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html