[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a91f9a9b-57be-59a8-1755-37936512ff20@web.de>
Date: Tue, 14 May 2019 18:48:17 +0200
From: Markus Elfring <Markus.Elfring@....de>
To: Gilles Muller <Gilles.Muller@...6.fr>,
Julia Lawall <Julia.Lawall@...6.fr>,
Masahiro Yamada <yamada.masahiro@...ionext.com>,
Michal Marek <michal.lkml@...kovi.net>,
Nicolas Palix <nicolas.palix@...g.fr>,
Wen Yang <wen.yang99@....com.cn>
Cc: Coccinelle <cocci@...teme.lip6.fr>,
LKML <linux-kernel@...r.kernel.org>,
Yi Wang <wang.yi59@....com.cn>
Subject: [PATCH 1/3] Coccinelle: pci_free_consistent: Use formatted strings
directly in SmPL rules
From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Tue, 14 May 2019 16:54:40 +0200
Formatted strings 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@...rs.sourceforge.net>
---
scripts/coccinelle/free/pci_free_consistent.cocci | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/scripts/coccinelle/free/pci_free_consistent.cocci b/scripts/coccinelle/free/pci_free_consistent.cocci
index 43600ccb62a8..2056d6680cb8 100644
--- a/scripts/coccinelle/free/pci_free_consistent.cocci
+++ b/scripts/coccinelle/free/pci_free_consistent.cocci
@@ -38,15 +38,15 @@ return@p2 ...;
p1 << search.p1;
p2 << search.p2;
@@
-
-msg = "ERROR: missing pci_free_consistent; pci_alloc_consistent on line %s and return without freeing on line %s" % (p1[0].line,p2[0].line)
-coccilib.report.print_report(p2[0],msg)
+coccilib.report.print_report(p2[0],
+ "ERROR: missing pci_free_consistent; pci_alloc_consistent on line %s and return without freeing on line %s"
+ % (p1[0].line,p2[0].line))
@script:python depends on org@
p1 << search.p1;
p2 << search.p2;
@@
-
-msg = "ERROR: missing pci_free_consistent; pci_alloc_consistent on line %s and return without freeing on line %s" % (p1[0].line,p2[0].line)
-cocci.print_main(msg,p1)
+cocci.print_main("ERROR: missing pci_free_consistent; pci_alloc_consistent on line %s and return without freeing on line %s"
+ % (p1[0].line,p2[0].line),
+ p1)
cocci.print_secs("",p2)
--
2.21.0
Powered by blists - more mailing lists