From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756927AbcG1SbE (ORCPT ); Thu, 28 Jul 2016 14:31:04 -0400 Received: from smtprelay0008.hostedemail.com ([216.40.44.8]:41149 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756835AbcG1SbD (ORCPT ); Thu, 28 Jul 2016 14:31:03 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::,RULES_HIT:41:355:379:541:599:800:960: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:3866:3868:3870:3872:4321:5007:10004:10400:10848:11026:11232:11658:11783:11914:12043:12296:12438:12517:12519:12555:12740:13069:13311:13357:13439:13894:14181:14659:14721: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:3,LUA_SUMMARY:none X-HE-Tag: bead91_5fce81fd9902a X-Filterd-Recvd-Size: 2149 Message-ID: <1469730656.3998.63.camel@perches.com> Subject: Re: [PATCH] Input - elantech: fix debug dump of the current packet From: Joe Perches To: Benjamin Tissoires , Dmitry Torokhov Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Date: Thu, 28 Jul 2016 11:30:56 -0700 In-Reply-To: <1469699935-23056-1-git-send-email-benjamin.tissoires@redhat.com> References: <1469699935-23056-1-git-send-email-benjamin.tissoires@redhat.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.2-0ubuntu3 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2016-07-28 at 11:58 +0200, Benjamin Tissoires wrote: > The use of mixed psmouse_printk() and printk creates 2 lines in the log, > while the use of %*ph solves everything. > > Signed-off-by: Benjamin Tissoires > --- >  drivers/input/mouse/elantech.c | 8 ++------ >  1 file changed, 2 insertions(+), 6 deletions(-) > > diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c > index 615d23e..3461d04 100644 > --- a/drivers/input/mouse/elantech.c > +++ b/drivers/input/mouse/elantech.c > @@ -222,12 +222,8 @@ static int elantech_write_reg(struct psmouse *psmouse, unsigned char reg, >   */ >  static void elantech_packet_dump(struct psmouse *psmouse) >  { > - int i; > - > - psmouse_printk(KERN_DEBUG, psmouse, "PS/2 packet ["); > - for (i = 0; i < psmouse->pktsize; i++) > - printk("%s0x%02x ", i ? ", " : " ", psmouse->packet[i]); > - printk("]\n"); > + psmouse_printk(KERN_DEBUG, psmouse, "PS/2 packet [%*ph]", > +        psmouse->pktsize, psmouse->packet); >  } >   >  /* This should add a newline "\n" format termination but how does the original produce multiple lines of output? It looks more like psmouse_printk should be removed altogether and dev_debug should be used instead.