From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933654AbcCNHf5 (ORCPT ); Mon, 14 Mar 2016 03:35:57 -0400 Received: from smtprelay0088.hostedemail.com ([216.40.44.88]:45648 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933600AbcCNHfq (ORCPT ); Mon, 14 Mar 2016 03:35:46 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::,RULES_HIT:41:355:379:541:599:973:982:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2110:2393:2553:2559:2562:2692:2828:3138:3139:3140:3141:3142:3353:3622:3865:3866:3867:3868:3872:3873:3874:4321:5007:6120:6261:10004:10400:10848:11232:11658:11783:11914:12043:12517:12519:12555:12663:12740:13069:13311:13357:13439:13894:14659:14721:21080:21324:30030:30054: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: soap18_894962182ec53 X-Filterd-Recvd-Size: 2696 Message-ID: <1457940942.11972.69.camel@perches.com> Subject: Re: [RFC PATCH V2] checkpatch: Check output format style of __func__ uses From: Joe Perches To: Julia Lawall Cc: Andrew Morton , Andy Whitcroft , Dan Carpenter , kernel-janitors , linux-kernel@vger.kernel.org Date: Mon, 14 Mar 2016 00:35:42 -0700 In-Reply-To: References: <83a6236111861645daa6dee9ae7f7aeb03cd7b14.1457896085.git.joe@perches.com> <5db4d45c04c506d23ab5b35527e2a544e86c4c6d.1457915615.git.joe@perches.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1-1ubuntu1 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 Mon, 2016-03-14 at 06:19 +0100, Julia Lawall wrote: > On Sun, 13 Mar 2016, Joe Perches wrote: > > Loggng messages that emit function names have many different forms. > > Perhaps it'd be better for logging consistency and grep ease to > > exclusively use "%s:" > >  > > As well, function tracing logging uses are generally unnecessary given > > the kernel's function tracing (ftrace) capability. > >  > > Right now, grep shows these mixtures of forms: > >  > > 13704 "%s:" > > 3839  "%s " > > 2787  "%s()" > >  > > Some of these are macros definitions of various styles. > >  > > Unfortunately, given the complexity of these macro definition styles, > > checkpatch isn't an ideal tool to find these macros. > >  > > Maybe a coccinelle script might be better suited to find and fix all > > the various types of uses. > >  > > Add a --fix option for these logging messages with __func__. > > I'm not good enough at perl to really understand this.  Coudl you give an  > example of what it does, and of what it does not do? For instance, this could do simple conversions like: $ diff --git a/arch/arm/common/mcpm_entry.c b/arch/arm/common/mcpm_entry.c @@ -416 +416 @@ int __init mcpm_loopback(void (*cache_disable)(void)) -               pr_err("%s returned %d\n", __func__, ret); +               pr_err("%s: returned %d\n", __func__, ret); But it couldn't find/convert a string concatenation: #define pch_dbg(adap, fmt, arg...)  \         dev_dbg(adap->pch_adapter.dev.parent, "%s :" fmt, __func__, ##arg) cheers, Joe