[PATCH v2 8/8] Coccinelle: atomic_as_refcounter: Use format string directly in the first SmPL rule
From: SF Markus Elfring
Date: Mon Jul 16 2018 - 13:39:23 EST
From: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 16 Jul 2018 18:45:55 +0200
A format string was assigned to the Python variable âmsgâ before it was
used in a rule of a script for the semantic patch language.
Delete this extra variable so that the specified string object
is directly used for the desired data output.
Signed-off-by: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
---
scripts/coccinelle/api/atomic_as_refcounter.cocci | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/scripts/coccinelle/api/atomic_as_refcounter.cocci b/scripts/coccinelle/api/atomic_as_refcounter.cocci
index c9b838941024..c2b55a5babb0 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))
@r2 exists@
expression a;
--
2.18.0