public inbox for linux-input@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] Input: inline macros for MODULE_LICENSE, etc
@ 2017-12-26 17:05 Julia Lawall
  2017-12-26 17:05 ` [PATCH 1/1] " Julia Lawall
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Julia Lawall @ 2017-12-26 17:05 UTC (permalink / raw)
  To: Dmitry Torokhov, linux-kernel
  Cc: kernel-janitors, linux-input, Greg Kroah-Hartman

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>

---

 drivers/input/misc/keyspan_remote.c |    9 +++------
 drivers/input/tablet/acecad.c       |    9 +++------
 drivers/input/tablet/hanwang.c      |   10 +++-------
 drivers/input/tablet/kbtab.c        |    9 +++------
 4 files changed, 12 insertions(+), 25 deletions(-)

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-12-26 18:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH 0/1] " Joe Perches
2017-12-26 17:56   ` Julia Lawall
2017-12-26 18:04 ` Joe Perches
2017-12-26 18:10   ` Julia Lawall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox