From: Joe Perches <joe@perches.com>
To: Julia Lawall <Julia.Lawall@lip6.fr>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
linux-kernel@vger.kernel.org
Cc: kernel-janitors@vger.kernel.org, linux-input@vger.kernel.org,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [PATCH 0/1] Input: inline macros for MODULE_LICENSE, etc
Date: Tue, 26 Dec 2017 09:52:28 -0800 [thread overview]
Message-ID: <1514310748.3468.3.camel@perches.com> (raw)
In-Reply-To: <1514307905-3486-1-git-send-email-Julia.Lawall@lip6.fr>
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/)
>
> // <smpl>
> @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
> // </smpl>
What assures that the #define is only used by
MODULE_<FOO> and is not used in any other way?
next prev parent reply other threads:[~2017-12-26 17:52 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-26 17:05 [PATCH 0/1] Input: inline macros for MODULE_LICENSE, etc Julia Lawall
2017-12-26 17:05 ` [PATCH 1/1] " Julia Lawall
2017-12-26 17:52 ` Joe Perches [this message]
2017-12-26 17:56 ` [PATCH 0/1] " Julia Lawall
2017-12-26 18:04 ` Joe Perches
2017-12-26 18:10 ` Julia Lawall
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1514310748.3468.3.camel@perches.com \
--to=joe@perches.com \
--cc=Julia.Lawall@lip6.fr \
--cc=dmitry.torokhov@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox