linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] Coccinelle: memdup: fix the report mode
@ 2016-12-27 17:39 Nicolas Iooss
  2016-12-27 17:43 ` Julia Lawall
  0 siblings, 1 reply; 2+ messages in thread
From: Nicolas Iooss @ 2016-12-27 17:39 UTC (permalink / raw)
  To: Julia Lawall, Gilles Muller, Nicolas Palix, Michal Marek, cocci
  Cc: linux-kernel, Nicolas Iooss

The pattern which was used in report mode included an annoying kmemdup
call, which has no chance of being there. Remove this stray line.

While at it, the name of function kmemdup was misspelled in the warning
message. Fix this.

Fixes: 29a36d4dec6c ("scripts/coccinelle: improve the coverage of some
semantic patches")
Signed-off-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
---
 scripts/coccinelle/api/memdup.cocci | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/scripts/coccinelle/api/memdup.cocci b/scripts/coccinelle/api/memdup.cocci
index 3d1aa71b7579..8fd6437beda8 100644
--- a/scripts/coccinelle/api/memdup.cocci
+++ b/scripts/coccinelle/api/memdup.cocci
@@ -49,7 +49,6 @@ statement S;
 @@
 
 *  to = \(kmalloc@p\|kzalloc@p\)(size,flag);
-   to = kmemdup(from,size,flag);
    if (to==NULL || ...) S
 *  memcpy(to, from, size);
 
@@ -57,10 +56,10 @@ statement S;
 p << r.p;
 @@
 
-coccilib.org.print_todo(p[0], "WARNING opportunity for kmemdep")
+coccilib.org.print_todo(p[0], "WARNING opportunity for kmemdup")
 
 @script:python depends on report@
 p << r.p;
 @@
 
-coccilib.report.print_report(p[0], "WARNING opportunity for kmemdep")
+coccilib.report.print_report(p[0], "WARNING opportunity for kmemdup")
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1] Coccinelle: memdup: fix the report mode
  2016-12-27 17:39 [PATCH 1/1] Coccinelle: memdup: fix the report mode Nicolas Iooss
@ 2016-12-27 17:43 ` Julia Lawall
  0 siblings, 0 replies; 2+ messages in thread
From: Julia Lawall @ 2016-12-27 17:43 UTC (permalink / raw)
  To: Nicolas Iooss
  Cc: Gilles Muller, Nicolas Palix, Michal Marek, cocci, linux-kernel



On Tue, 27 Dec 2016, Nicolas Iooss wrote:

> The pattern which was used in report mode included an annoying kmemdup
> call, which has no chance of being there. Remove this stray line.
>
> While at it, the name of function kmemdup was misspelled in the warning
> message. Fix this.
>
> Fixes: 29a36d4dec6c ("scripts/coccinelle: improve the coverage of some
> semantic patches")
> Signed-off-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org>

Acked-by: Julia Lawall <julia.lawall@lip6.fr>

Thanks for the fixes.

julia

> ---
>  scripts/coccinelle/api/memdup.cocci | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/scripts/coccinelle/api/memdup.cocci b/scripts/coccinelle/api/memdup.cocci
> index 3d1aa71b7579..8fd6437beda8 100644
> --- a/scripts/coccinelle/api/memdup.cocci
> +++ b/scripts/coccinelle/api/memdup.cocci
> @@ -49,7 +49,6 @@ statement S;
>  @@
>
>  *  to = \(kmalloc@p\|kzalloc@p\)(size,flag);
> -   to = kmemdup(from,size,flag);
>     if (to==NULL || ...) S
>  *  memcpy(to, from, size);
>
> @@ -57,10 +56,10 @@ statement S;
>  p << r.p;
>  @@
>
> -coccilib.org.print_todo(p[0], "WARNING opportunity for kmemdep")
> +coccilib.org.print_todo(p[0], "WARNING opportunity for kmemdup")
>
>  @script:python depends on report@
>  p << r.p;
>  @@
>
> -coccilib.report.print_report(p[0], "WARNING opportunity for kmemdep")
> +coccilib.report.print_report(p[0], "WARNING opportunity for kmemdup")
> --
> 2.11.0
>
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-12-27 17:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-27 17:39 [PATCH 1/1] Coccinelle: memdup: fix the report mode Nicolas Iooss
2016-12-27 17:43 ` Julia Lawall

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).