From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758113AbdHYTCH (ORCPT ); Fri, 25 Aug 2017 15:02:07 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:42544 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755334AbdHYTCF (ORCPT ); Fri, 25 Aug 2017 15:02:05 -0400 Date: Fri, 25 Aug 2017 21:01:02 +0200 (CEST) From: Thomas Gleixner To: Prarit Bhargava cc: linux-kernel@vger.kernel.org, Mark Salyzyn , Jonathan Corbet , Petr Mladek , Sergey Senozhatsky , Steven Rostedt , John Stultz , Stephen Boyd , Andrew Morton , Greg Kroah-Hartman , "Paul E. McKenney" , Christoffer Dall , Deepa Dinamani , Ingo Molnar , Joel Fernandes , Kees Cook , Peter Zijlstra , Geert Uytterhoeven , "Luis R. Rodriguez" , Nicholas Piggin , "Jason A. Donenfeld" , Olof Johansson , Josh Poimboeuf , linux-doc@vger.kernel.org Subject: Re: [PATCH 2/2 v9] printk: Add monotonic, boottime, and realtime timestamps In-Reply-To: <1503681619-5326-3-git-send-email-prarit@redhat.com> Message-ID: References: <1503681619-5326-1-git-send-email-prarit@redhat.com> <1503681619-5326-3-git-send-email-prarit@redhat.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 25 Aug 2017, Prarit Bhargava wrote: > + > + if (printk_time_source == PRINTK_TIME_UNDEFINED) > + printk_time_source = _printk_time; > +#ifndef CONFIG_PRINTK_TIME_DEBUG > + else if ((printk_time_source != _printk_time) && > + (_printk_time != PRINTK_TIME_DISABLED)) { You can avoid the #ifdef ugliness by writing this as: } else if (IS_ENABLED(CONFIG_PRINTK_DEBUG) && printk_time_source != _prinkt_time && _printk_time != PRINTK_TIME_DISABLED) { Aside of that I'm not too fond of that extra config switch. Why shouldn't we allow the admin to switch between time sources as he sees fit by default? It's not Joe user who is allowed to do that and in general we give admins the biggest guns we have to shoot themself in the foot. Seriously, switching it is not making anything explode, insecure or whatever dangerous. It's merily changing the time stamp source so dmesg and syslog get harder to parse. Thanks, tglx