From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751336AbdLZRwg (ORCPT ); Tue, 26 Dec 2017 12:52:36 -0500 Received: from smtprelay0137.hostedemail.com ([216.40.44.137]:50907 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751107AbdLZRwd (ORCPT ); Tue, 26 Dec 2017 12:52:33 -0500 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 50,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::,RULES_HIT:41:355:379:541:599:960:967:973:982:988:989:1260:1263:1277:1311:1313:1314:1345:1359:1373:1437:1461:1515:1516:1518:1534:1541:1593:1594:1711:1712:1730:1747:1777:1792:2393:2525:2560:2563:2682:2685:2828:2859:2892:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3353:3622:3865:3867:3868:3870:3871:3874:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4321:5007:7904:9025:10004:10400:10848:11232:11658:11914:12296:12740:12760:12895:13069:13311:13357:13439:14096:14097:14181:14659:14721:21080:21324:21451:21627:30029:30054:30075:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:2,LUA_SUMMARY:none X-HE-Tag: error76_6d311761ba649 X-Filterd-Recvd-Size: 2256 Message-ID: <1514310748.3468.3.camel@perches.com> Subject: Re: [PATCH 0/1] Input: inline macros for MODULE_LICENSE, etc From: Joe Perches To: Julia Lawall , Dmitry Torokhov , linux-kernel@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-input@vger.kernel.org, Greg Kroah-Hartman Date: Tue, 26 Dec 2017 09:52:28 -0800 In-Reply-To: <1514307905-3486-1-git-send-email-Julia.Lawall@lip6.fr> References: <1514307905-3486-1-git-send-email-Julia.Lawall@lip6.fr> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.26.1-1 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 On Tue, 2017-12-26 at 18:05 +0100, Julia Lawall wrote: > Inline macro for MODULE_LICENSE to make the license information easy to > find, eg with grep. Inline the other module-related macros at the same > time. > > The complete semantic patch is as follows: (http://coccinelle.lip6.fr/) > > // > @q@ > declarer name MODULE_LICENSE; > identifier i; > constant c; > position p; > @@ > > MODULE_LICENSE(c@i@p); > > @r depends on q@ > declarer name MODULE_AUTHOR, MODULE_DESCRIPTION, MODULE_VERSION; > identifier i; > constant c; > position p; > @@ > > ( > MODULE_AUTHOR(c@i@p); > > > > MODULE_DESCRIPTION(c@i@p); > > > > MODULE_LICENSE(c@i@p); > > > > MODULE_VERSION(c@i@p); > ) > > @other@ > identifier r.i; > position p != r.p; > @@ > > i@p > > @s depends on !other@ > identifier r.i; > expression e; > @@ > > #define i e > > @@ > identifier r.i; > position r.p; > expression s.e; > @@ > > ( > MODULE_AUTHOR( > - i@p > + e > ); > > > > MODULE_DESCRIPTION( > - i@p > + e > ); > > > > MODULE_LICENSE( > - i@p > + e > ); > > > > MODULE_VERSION( > - i@p > + e > ); > ) > > @@ > identifier r.i; > expression s.e; > @@ > > -#define i e > // What assures that the #define is only used by MODULE_ and is not used in any other way?