Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751528AbbKHTaa (ORCPT ); Sun, 8 Nov 2015 14:30:30 -0500 Received: from mail-ig0-f180.google.com ([209.85.213.180]:37757 "EHLO mail-ig0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750876AbbKHTa1 (ORCPT ); Sun, 8 Nov 2015 14:30:27 -0500 Subject: Re: [PATCH 01/14] tty: Improve tty_debug() macro To: Joe Perches , Greg Kroah-Hartman References: <1447005681-4912-1-git-send-email-peter@hurleysoftware.com> <1447005681-4912-2-git-send-email-peter@hurleysoftware.com> <1447008694.2701.28.camel@perches.com> Cc: Jiri Slaby , linux-kernel@vger.kernel.org From: Peter Hurley Message-ID: <563FA2D1.5000504@hurleysoftware.com> Date: Sun, 8 Nov 2015 14:30:25 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <1447008694.2701.28.camel@perches.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1542 Lines: 49 Hi Joe, On 11/08/2015 01:51 PM, Joe Perches wrote: > On Sun, 2015-11-08 at 13:01 -0500, Peter Hurley wrote: >> Incorporate suggestions for tty core debug macro improvements >> - printk(KERN_DEBUG) => pr_debug() >> - ##args => ##__VA_ARGS__ >> - remove do {} while() >> - output tty_name() first > [] >> diff --git a/include/linux/tty.h b/include/linux/tty.h > [] >> @@ -667,10 +667,7 @@ static inline void proc_tty_register_driver(struct tty_driver *d) {} >> static inline void proc_tty_unregister_driver(struct tty_driver *d) {} >> #endif >> >> -#define tty_debug(tty, f, args...) \ >> - do { \ >> - printk(KERN_DEBUG "%s: %s: " f, __func__, \ >> - tty_name(tty), ##args); \ >> - } while (0) >> +#define tty_debug(tty, f, ...) \ >> + pr_debug("%s: %s: " f, tty_name(tty), __func__, ##__VA_ARGS__) >> >> #endif > > Unless there's a #define DEBUG in the path, this now > basically requires dynamic debugging to output anything. It's what Greg wanted. > Given that, I suggest removing __func__ from the output > because dynamic debugging can add it. Done in a follow-on patch in the series because the messages needed some (minor) context if the function name is not output. > And f is more commonly fmt, so: I have a terse style :) Regards, Peter Hurley -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/