lkml.org 
[lkml]   [2018]   [Jul]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH v2 7/8] Coccinelle: atomic_as_refcounter: Use string literals directly in two SmPL rules
From
Date
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 16 Jul 2018 18:36:41 +0200

String literals were always assigned to the Python variable “msg”
before they were used in two 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@users.sourceforge.net>
---
scripts/coccinelle/api/atomic_as_refcounter.cocci | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/scripts/coccinelle/api/atomic_as_refcounter.cocci b/scripts/coccinelle/api/atomic_as_refcounter.cocci
index 7eae23dc9ea8..c9b838941024 100644
--- a/scripts/coccinelle/api/atomic_as_refcounter.cocci
+++ b/scripts/coccinelle/api/atomic_as_refcounter.cocci
@@ -53,8 +53,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;
@@ -66,5 +65,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
\
 
 \ /
  Last update: 2018-07-16 19:37    [W:0.278 / U:0.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site