From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751420AbcGTEaK (ORCPT ); Wed, 20 Jul 2016 00:30:10 -0400 Received: from smtprelay0068.hostedemail.com ([216.40.44.68]:38538 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750884AbcGTEaH (ORCPT ); Wed, 20 Jul 2016 00:30:07 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::,RULES_HIT:41:355:379:541:599:800: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:2553:2559:2562:2828:3138:3139:3140:3141:3142:3352:3622:3865:3868:4250:4321:5007:6119:7875:10004:10400:10848:11026:11658:11783:11914:12043:12296:12438:12517:12519:12740:13069:13255:13311:13357:13439:13894:14181:14659:14721:21063:21080:21325:21433:30054:30056:30070:30090: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: wing15_4643715a93e X-Filterd-Recvd-Size: 2672 Message-ID: <1468989000.1900.94.camel@perches.com> Subject: Re: [PATCH v3 02/12] binfmt_flat: convert printk invocations to their modern form From: Joe Perches To: Nicolas Pitre , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Alexander Viro , David Howells , Greg Ungerer Date: Tue, 19 Jul 2016 21:30:00 -0700 In-Reply-To: <1468988424-32671-3-git-send-email-nicolas.pitre@linaro.org> References: <1468988424-32671-1-git-send-email-nicolas.pitre@linaro.org> <1468988424-32671-3-git-send-email-nicolas.pitre@linaro.org> 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 Wed, 2016-07-20 at 00:20 -0400, Nicolas Pitre wrote: > diff --git a/fs/binfmt_flat.c b/fs/binfmt_flat.c [] > @@ -15,6 +15,8 @@ >   * JAN/99 -- coded full program relocation (gerg@snapgear.com) >   */ >   > +#define pr_fmt(fmt) "BINFMT_FLAT: : " fmt Why the double colon? Much more common would be #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt > @@ -106,8 +98,8 @@ static struct linux_binfmt flat_format = { >   >  static int flat_core_dump(struct coredump_params *cprm) >  { > - printk("Process %s:%d received signr %d and should have core dumped\n", > - current->comm, current->pid, cprm->siginfo->si_signo); > + pr_warning("Process %s:%d received signr %d and should have core dumped\n", > +    current->comm, current->pid, cprm->siginfo->si_signo); Prefer pr_warn >   return(1); >  } >   > @@ -190,17 +182,17 @@ static int decompress_exec( >   loff_t fpos; >   int ret, retval; >   > - DBG_FLT("decompress_exec(offset=%lx,buf=%p,len=%lx)\n",offset, dst, len); > + pr_debug("decompress_exec(offset=%lx,buf=%p,len=%lx)\n",offset, dst, len); Generally unnecessary as the function tracer works well >   >   memset(&strm, 0, sizeof(strm)); >   strm.workspace = kmalloc(zlib_inflate_workspacesize(), GFP_KERNEL); >   if (strm.workspace == NULL) { > - DBG_FLT("binfmt_flat: no memory for decompress workspace\n"); > + pr_debug("no memory for decompress workspace\n"); >   return -ENOMEM; >   } >   buf = kmalloc(LBUFSIZE, GFP_KERNEL); >   if (buf == NULL) { > - DBG_FLT("binfmt_flat: no memory for read buffer\n"); > + pr_debug("no memory for read buffer\n"); Unnecessary OOM messages as allocs do a stack dump