[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.21.1905142148460.2612@hadrien>
Date: Tue, 14 May 2019 21:50:04 +0200 (CEST)
From: Julia Lawall <julia.lawall@...6.fr>
To: Markus Elfring <Markus.Elfring@....de>
cc: Gilles Muller <Gilles.Muller@...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>,
Coccinelle <cocci@...teme.lip6.fr>,
LKML <linux-kernel@...r.kernel.org>,
Yi Wang <wang.yi59@....com.cn>
Subject: Re: [PATCH 1/3] Coccinelle: pci_free_consistent: Use formatted
strings directly in SmPL rules
On Tue, 14 May 2019, Markus Elfring wrote:
> 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>
NACK. If the code is going to change, I would rather it come closer to
staying within 80 characters.
julia
> ---
> 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