linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: Gilles Muller <Gilles.Muller@lip6.fr>,
	Julia Lawall <Julia.Lawall@lip6.fr>,
	Masahiro Yamada <yamada.masahiro@socionext.com>,
	Michal Marek <michal.lkml@markovi.net>,
	Nicolas Palix <nicolas.palix@imag.fr>,
	Wen Yang <wen.yang99@zte.com.cn>
Cc: Coccinelle <cocci@systeme.lip6.fr>,
	LKML <linux-kernel@vger.kernel.org>,
	Yi Wang <wang.yi59@zte.com.cn>
Subject: [PATCH 1/3] Coccinelle: pci_free_consistent: Use formatted strings directly in SmPL rules
Date: Tue, 14 May 2019 18:48:17 +0200	[thread overview]
Message-ID: <a91f9a9b-57be-59a8-1755-37936512ff20@web.de> (raw)
In-Reply-To: <e30b9777-6440-b041-9df9-f1a27ce06c6c@web.de>

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


  reply	other threads:[~2019-05-14 16:48 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-14 16:44 [PATCH 0/3] Coccinelle: pci_free_consistent: Adjustments for a SmPL script Markus Elfring
2019-05-14 16:48 ` Markus Elfring [this message]
2019-05-14 19:50   ` [PATCH 1/3] Coccinelle: pci_free_consistent: Use formatted strings directly in SmPL rules Julia Lawall
2019-05-15  5:27     ` [1/3] " Markus Elfring
2019-05-15  6:10       ` Julia Lawall
2019-05-14 16:50 ` [PATCH 2/3] Coccinelle: pci_free_consistent: Reduce a bit of duplicate SmPL code Markus Elfring
2019-05-14 16:50 ` Markus Elfring
2019-05-14 19:47   ` Julia Lawall
2019-05-15  5:35     ` [2/3] " Markus Elfring
2019-05-15  6:11       ` Julia Lawall
2019-05-15  6:11       ` Julia Lawall
2019-05-15  7:02         ` Markus Elfring
     [not found]           ` <alpine.DEB.2.21.1905150908550.2591@hadrien>
2019-05-15  7:33             ` Coccinelle: Handling of SmPL disjunctions Markus Elfring
     [not found]               ` <alpine.DEB.2.20.1905151120370.3231@hadrien>
2019-05-15  9:55                 ` Markus Elfring
2019-07-09  9:52                   ` Markus Elfring
2019-05-14 16:52 ` [PATCH 3/3] Coccinelle: pci_free_consistent: Extend when constraints for two SmPL ellipses Markus Elfring
2019-05-14 19:50   ` Julia Lawall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a91f9a9b-57be-59a8-1755-37936512ff20@web.de \
    --to=markus.elfring@web.de \
    --cc=Gilles.Muller@lip6.fr \
    --cc=Julia.Lawall@lip6.fr \
    --cc=cocci@systeme.lip6.fr \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.lkml@markovi.net \
    --cc=nicolas.palix@imag.fr \
    --cc=wang.yi59@zte.com.cn \
    --cc=wen.yang99@zte.com.cn \
    --cc=yamada.masahiro@socionext.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).