From mboxrd@z Thu Jan 1 00:00:00 1970 From: SF Markus Elfring Date: Mon, 16 Jul 2018 17:36:33 +0000 Subject: [PATCH v2 7/8] Coccinelle: atomic_as_refcounter: Use string literals directly in two SmPL rules Message-Id: List-Id: References: <6043bdc9-529f-e93f-e509-e2dedd290a10@users.sourceforge.net> <5ca6ab58-e929-8468-74e2-012f987a0773@users.sourceforge.net> In-Reply-To: <5ca6ab58-e929-8468-74e2-012f987a0773@users.sourceforge.net> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit To: kernel-janitors@vger.kernel.org, Elena Reshetova , Julia Lawall , Kees Cook , Masahiro Yamada Cc: LKML , Coccinelle , Gilles Muller , Michal Marek , Nicolas Palix From: Markus Elfring 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 --- 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