Thread (6 messages) 6 messages, 2 authors, 2017-12-26

Re: [PATCH 0/1] Input: inline macros for MODULE_LICENSE, etc

From: Joe Perches <joe@perches.com>
Date: 2017-12-26 17:52:36
Also in: kernel-janitors, lkml

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);
quoted
MODULE_DESCRIPTION(c@i@p);
quoted
MODULE_LICENSE(c@i@p);
quoted
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
 );
quoted
MODULE_DESCRIPTION(
- i@p
+ e
 );
quoted
MODULE_LICENSE(
- i@p
+ e
 );
quoted
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?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help