Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751615AbbGMDrX (ORCPT ); Sun, 12 Jul 2015 23:47:23 -0400 Received: from smtprelay0064.hostedemail.com ([216.40.44.64]:44585 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751390AbbGMDrV (ORCPT ); Sun, 12 Jul 2015 23:47:21 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::,RULES_HIT:41:355:379:541:599:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1540:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2828:2892:3138:3139:3140:3141:3142:3352:3622:3865:3867:3868:3871:4321:4605:5007:6119:6261:7903:10004:10400:10848:11026:11232:11473:11658:11914:12296:12517:12519:12740:13069:13311:13357:21080:21212,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 X-HE-Tag: glue22_22dd4424eb413 X-Filterd-Recvd-Size: 1860 Message-ID: <1436759238.2711.86.camel@perches.com> Subject: Re: [PATCH 2/7] tty: core: Add tty_debug() for printk(KERN_DEBUG) messages From: Joe Perches To: Peter Hurley Cc: Greg Kroah-Hartman , Jiri Slaby , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Date: Sun, 12 Jul 2015 20:47:18 -0700 In-Reply-To: <1436755753-7746-3-git-send-email-peter@hurleysoftware.com> References: <1436755753-7746-1-git-send-email-peter@hurleysoftware.com> <1436755753-7746-3-git-send-email-peter@hurleysoftware.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.12.11-0ubuntu3 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: 1094 Lines: 35 On Sun, 2015-07-12 at 22:49 -0400, Peter Hurley wrote: > Introduce tty_debug() macro to output uniform debug information for > tty core debug messages (function name and tty name). [] > diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c [] > @@ -768,7 +768,7 @@ static void do_tty_hangup(struct work_struct *work) > void tty_hangup(struct tty_struct *tty) > { > #ifdef TTY_DEBUG_HANGUP > - printk(KERN_DEBUG "%s hangup...\n", tty_name(tty)); > + tty_debug(tty, "\n"); Why drop the "hangup..." ? > diff --git a/include/linux/tty.h b/include/linux/tty.h [] > +#define tty_debug(tty, f, args...) \ > + do { \ > + printk(KERN_DEBUG "%s: %s: " f, __func__, \ > + tty_name(tty), ##args); \ > + } while (0) Single statement macros don't need do {} while (0) #define fmt, ... using fmt, ##__VA_ARGS__ is more common. -- 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/