From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754542AbcBPJCE (ORCPT ); Tue, 16 Feb 2016 04:02:04 -0500 Received: from mail.skyhub.de ([78.46.96.112]:51247 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754389AbcBPJBl (ORCPT ); Tue, 16 Feb 2016 04:01:41 -0500 Date: Tue, 16 Feb 2016 10:01:38 +0100 From: Borislav Petkov To: Ingo Molnar Cc: Chen Yucong , tglx@linutronix.de, hpa@zytor.com, x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] x86/kernel: use pr_() and dev_ Message-ID: <20160216090138.GA3902@pd.tnic> References: <1455423047-8571-1-git-send-email-slaoub@gmail.com> <20160214140808.GB32622@pd.tnic> <20160216082431.GA3335@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20160216082431.GA3335@gmail.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 16, 2016 at 09:24:31AM +0100, Ingo Molnar wrote: > Hm, so I suspect the other patch I already applied is buggy as well? Yap. pr_debug() is ugly to use: /* If you are writing a driver, please use dev_dbg instead */ #if defined(CONFIG_DYNAMIC_DEBUG) /* dynamic_pr_debug() uses pr_fmt() internally so we don't need it here */ #define pr_debug(fmt, ...) \ dynamic_pr_debug(fmt, ##__VA_ARGS__) #elif defined(DEBUG) #define pr_debug(fmt, ...) \ printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) #else #define pr_debug(fmt, ...) \ no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) #endif so in the !CONFIG_DYNAMIC_DEBUG case, you want to boot with "ignore_loglevel" and see all those debug statements but that can't work because you have to rebuild and slap a #define DEBUG somewhere *before* all includes. Which is clearly dumb. FWIW, that pr_debug() should have been defined without the defined(DEBUG) conditional in order to be an equivalent conversion like the rest of the pr_* gunk. I propose we add pr_debug_i_mean_it() and use *that* instead. :-) -- Regards/Gruss, Boris. ECO tip #101: Trim your mails when you reply.