All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH 1/3] scripts/coccinelle: Add headers to lib checks and fix macro fix
@ 2021-06-21 11:38 Richard Palethorpe
  2021-06-21 11:38 ` [LTP] [PATCH 2/3] API: Remove TEST macro usage from library headers Richard Palethorpe
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Richard Palethorpe @ 2021-06-21 11:38 UTC (permalink / raw)
  To: ltp

We have to explicitly add the header directory.

Also allow the TEST macro fix to replace multiple variables.

Signed-off-by: Richard Palethorpe <rpalethorpe@suse.com>
---
 scripts/coccinelle/libltp-test-macro.cocci |  4 +++-
 scripts/coccinelle/run-spatch.sh           | 10 ++++++++++
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/scripts/coccinelle/libltp-test-macro.cocci b/scripts/coccinelle/libltp-test-macro.cocci
index 7563d23aa..937d6c94f 100644
--- a/scripts/coccinelle/libltp-test-macro.cocci
+++ b/scripts/coccinelle/libltp-test-macro.cocci
@@ -24,7 +24,7 @@ virtual fix
 
  TEST(...)
 
- ...
+ <...
 
 (
 - TST_RET
@@ -37,6 +37,8 @@ virtual fix
 + TERRNO
 )
 
+ ...>
+
 // Replace TEST in all functions where it occurs only at the start. It
 // is slightly complicated by adding a newline if a statement appears
 // on the line after TEST(). It is not clear to me what the rules are
diff --git a/scripts/coccinelle/run-spatch.sh b/scripts/coccinelle/run-spatch.sh
index e8e6f47d8..978998cd1 100755
--- a/scripts/coccinelle/run-spatch.sh
+++ b/scripts/coccinelle/run-spatch.sh
@@ -25,6 +25,12 @@ libltp_spatch() {
 	       -D fix \
 	       --include-headers \
 	       $*
+	spatch --dir include \
+	       --use-gitgrep \
+	       --in-place \
+	       -D fix \
+	       --include-headers \
+	       $*
     else
 	spatch --dir lib \
 	       --ignore lib/parse_opts.c \
@@ -33,6 +39,10 @@ libltp_spatch() {
 	       --use-gitgrep \
 	       --include-headers \
 	       $*
+	spatch --dir include \
+	       --use-gitgrep \
+	       --include-headers \
+	       $*
     fi
 }
 
-- 
2.31.1


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

end of thread, other threads:[~2021-08-10 15:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-21 11:38 [LTP] [PATCH 1/3] scripts/coccinelle: Add headers to lib checks and fix macro fix Richard Palethorpe
2021-06-21 11:38 ` [LTP] [PATCH 2/3] API: Remove TEST macro usage from library headers Richard Palethorpe
2021-06-21 11:38 ` [LTP] [PATCH 3/3] API: Cause GCC/Clang to blow up when TEST is used in the library Richard Palethorpe
2021-06-28 14:52   ` Petr Vorel
2021-06-29  7:15     ` Richard Palethorpe
2021-08-10 15:17 ` [LTP] [PATCH 1/3] scripts/coccinelle: Add headers to lib checks and fix macro fix Cyril Hrubis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.