lkml.org 
[lkml]   [2019]   [May]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH 1/3] Coccinelle: pci_free_consistent: Use formatted strings directly in SmPL rules
From
Date
From: Markus Elfring <elfring@users.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@users.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
\
 
 \ /
  Last update: 2019-05-14 18:48    [W:1.049 / U:0.380 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site