From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755202AbcCNI3y (ORCPT ); Mon, 14 Mar 2016 04:29:54 -0400 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:12019 "EHLO mail3-relais-sop.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755024AbcCNI3q (ORCPT ); Mon, 14 Mar 2016 04:29:46 -0400 X-IronPort-AV: E=Sophos;i="5.24,334,1454972400"; d="scan'208";a="168506523" Date: Mon, 14 Mar 2016 09:29:43 +0100 (CET) From: Julia Lawall X-X-Sender: jll@hadrien To: Joe Perches cc: Julia Lawall , Andrew Morton , Andy Whitcroft , Dan Carpenter , kernel-janitors , linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH V2] checkpatch: Check output format style of __func__ uses In-Reply-To: <1457940942.11972.69.camel@perches.com> Message-ID: References: <83a6236111861645daa6dee9ae7f7aeb03cd7b14.1457896085.git.joe@perches.com> <5db4d45c04c506d23ab5b35527e2a544e86c4c6d.1457915615.git.joe@perches.com> <1457940942.11972.69.camel@perches.com> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="8323329-1209541255-1457944183=:2688" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-1209541255-1457944183=:2688 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT On Mon, 14 Mar 2016, Joe Perches wrote: > 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) OK, are there any thoughts about what to do when __func__ is not in the first position? julia --8323329-1209541255-1457944183=:2688--