[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3d4a4864-3b48-94a7-39c3-0f0e3018f9d5@users.sourceforge.net>
Date: Tue, 3 Jul 2018 09:48:33 +0200
From: SF Markus Elfring <elfring@...rs.sourceforge.net>
To: Elena Reshetova <elena.reshetova@...el.com>,
Julia Lawall <julia.lawall@...6.fr>,
Kees Cook <keescook@...omium.org>,
Masahiro Yamada <yamada.masahiro@...ionext.com>,
kernel-janitors@...r.kernel.org
Cc: LKML <linux-kernel@...r.kernel.org>,
Coccinelle <cocci@...teme.lip6.fr>
Subject: [PATCH 6/6] Coccinelle: atomic_as_refcounter: Use format strings
directly in SmPL rules
From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Mon, 2 Jul 2018 19:46:45 +0200
Format strings were always assigned to the Python variable “msg”
before they were used in four rules of a script for the semantic
patch language.
Delete these extra variables so that the specified string objects
are directly used for the desired data output.
Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
.../coccinelle/api/atomic_as_refcounter.cocci | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/scripts/coccinelle/api/atomic_as_refcounter.cocci b/scripts/coccinelle/api/atomic_as_refcounter.cocci
index 63cbe866c99f..1e2278ff3261 100644
--- a/scripts/coccinelle/api/atomic_as_refcounter.cocci
+++ b/scripts/coccinelle/api/atomic_as_refcounter.cocci
@@ -40,8 +40,9 @@ identifier fname2 =~ "(?:call_rcu|de(?:l|stroy)|(?:queue|schedule)_work)";
p1 << r1.p1;
p2 << r1.p2;
@@
-msg = "atomic_dec_and_test variation before object free at line %s."
-coccilib.report.print_report(p1[0], msg % (p2[0].line))
+coccilib.report.print_report(p1[0],
+ "atomic_dec_and_test variation before object free at line %s."
+ % (p2[0].line))
@r4 exists@
expression a;
@@ -71,8 +72,9 @@ fname@p2(y, ...);
p1 << r4.p1;
p2 << r4.p2;
@@
-msg = "atomic_dec_and_test variation before object free at line %s."
-coccilib.report.print_report(p1[0], msg % (p2[0].line))
+coccilib.report.print_report(p1[0],
+ "atomic_dec_and_test variation before object free at line %s."
+ % (p2[0].line))
@r2 exists@
expression a;
@@ -85,8 +87,7 @@ position p1;
@script:python depends on report@
p1 << r2.p1;
@@
-msg = "atomic_add_unless"
-coccilib.report.print_report(p1[0], msg)
+coccilib.report.print_report(p1[0], "atomic_add_unless")
@r3 exists@
expression E;
@@ -99,5 +100,4 @@ position p1;
@script:python depends on report@
p1 << r3.p1;
@@
-msg = "x = atomic_add_return(-1, ...)"
-coccilib.report.print_report(p1[0], msg)
+coccilib.report.print_report(p1[0], "x = atomic_add_return(-1, ...)")
--
2.18.0
Powered by blists - more mailing lists