Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751063AbbKHSvj (ORCPT ); Sun, 8 Nov 2015 13:51:39 -0500 Received: from smtprelay0078.hostedemail.com ([216.40.44.78]:45890 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750739AbbKHSvi (ORCPT ); Sun, 8 Nov 2015 13:51:38 -0500 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::,RULES_HIT:41:355:379:541:599:968:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2828:3138:3139:3140:3141:3142:3352:3622:3865:3867:3868:3870:3871:3872:3874:4250:4321:4605:5007:6119:6261:7875:7903:7904:10004:10400:10848:11026:11232:11658:11914:12043:12296:12438:12517:12519:12740:13069:13311:13357:13972:14659:21080:30054:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:1,LUA_SUMMARY:none X-HE-Tag: stick80_653e0362f8a1b X-Filterd-Recvd-Size: 2058 Message-ID: <1447008694.2701.28.camel@perches.com> Subject: Re: [PATCH 01/14] tty: Improve tty_debug() macro From: Joe Perches To: Peter Hurley , Greg Kroah-Hartman Cc: Jiri Slaby , linux-kernel@vger.kernel.org Date: Sun, 08 Nov 2015 10:51:34 -0800 In-Reply-To: <1447005681-4912-2-git-send-email-peter@hurleysoftware.com> References: <1447005681-4912-1-git-send-email-peter@hurleysoftware.com> <1447005681-4912-2-git-send-email-peter@hurleysoftware.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.16.5-1ubuntu3 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1348 Lines: 40 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. Given that, I suggest removing __func__ from the output because dynamic debugging can add it. And f is more commonly fmt, so: #define tty_debug(tty, fmt, ...) \ pr_debug("%s: " fmt, tty_name(tty), ##__VA_ARGS__) -- 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/