All of lore.kernel.org
 help / color / mirror / Atom feed
From: SF Markus Elfring <elfring@users.sourceforge.net>
To: kernel-janitors@vger.kernel.org,
	Elena Reshetova <elena.reshetova@intel.com>,
	Julia Lawall <julia.lawall@lip6.fr>,
	Kees Cook <keescook@chromium.org>,
	Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Coccinelle <cocci@systeme.lip6.fr>,
	Gilles Muller <Gilles.Muller@lip6.fr>,
	Michal Marek <michal.lkml@markovi.net>,
	Nicolas Palix <nicolas.palix@imag.fr>
Subject: [PATCH v2 1/8] Coccinelle: atomic_as_refcounter: Delete an unnecessary SmPL rule
Date: Mon, 16 Jul 2018 19:24:35 +0200	[thread overview]
Message-ID: <ba3ffd66-7c04-cf3a-6c70-af7ba704b1b5@users.sourceforge.net> (raw)
In-Reply-To: <5ca6ab58-e929-8468-74e2-012f987a0773@users.sourceforge.net>

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 16 Jul 2018 17:15:26 +0200

A search was specified in the rule “r4” for function calls which should be
found by the rule “r1” already in a script for the semantic patch language.
It is useless to repeat a source code search there just to determine
that a variable assignment was performed also for an input parameter
of such a function call (while the same message will be displayed so far).
Thus delete an inappropriate search specification.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 .../coccinelle/api/atomic_as_refcounter.cocci | 33 -------------------
 1 file changed, 33 deletions(-)

diff --git a/scripts/coccinelle/api/atomic_as_refcounter.cocci b/scripts/coccinelle/api/atomic_as_refcounter.cocci
index 988120e0fd67..61fcaf5e45a3 100644
--- a/scripts/coccinelle/api/atomic_as_refcounter.cocci
+++ b/scripts/coccinelle/api/atomic_as_refcounter.cocci
@@ -57,39 +57,6 @@ p2 << r1.p2;
 msg = "atomic_dec_and_test variation before object free at line %s."
 coccilib.report.print_report(p1[0], msg % (p2[0].line))
 
-@r4 exists@
-identifier a, x, y;
-position p1, p2;
-identifier fname =~ ".*free.*";
-
-@@
-
-(
- atomic_dec_and_test@p1(&(a)->x)
-|
- atomic_dec_and_lock@p1(&(a)->x, ...)
-|
- atomic_long_dec_and_lock@p1(&(a)->x, ...)
-|
- atomic_long_dec_and_test@p1(&(a)->x)
-|
- atomic64_dec_and_test@p1(&(a)->x)
-|
- local_dec_and_test@p1(&(a)->x)
-)
-...
-y=a
-...
-fname@p2(y, ...);
-
-
-@script:python depends on report@
-p1 << r4.p1;
-p2 << r4.p2;
-@@
-msg = "atomic_dec_and_test variation before object free at line %s."
-coccilib.report.print_report(p1[0], msg % (p2[0].line))
-
 @r2 exists@
 identifier a, x;
 position p1;
-- 
2.18.0


WARNING: multiple messages have this Message-ID (diff)
From: SF Markus Elfring <elfring@users.sourceforge.net>
To: kernel-janitors@vger.kernel.org,
	Elena Reshetova <elena.reshetova@intel.com>,
	Julia Lawall <julia.lawall@lip6.fr>,
	Kees Cook <keescook@chromium.org>,
	Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Coccinelle <cocci@systeme.lip6.fr>,
	Gilles Muller <Gilles.Muller@lip6.fr>,
	Michal Marek <michal.lkml@markovi.net>,
	Nicolas Palix <nicolas.palix@imag.fr>
Subject: [PATCH v2 1/8] Coccinelle: atomic_as_refcounter: Delete an unnecessary SmPL rule
Date: Mon, 16 Jul 2018 17:24:35 +0000	[thread overview]
Message-ID: <ba3ffd66-7c04-cf3a-6c70-af7ba704b1b5@users.sourceforge.net> (raw)
In-Reply-To: <5ca6ab58-e929-8468-74e2-012f987a0773@users.sourceforge.net>

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 16 Jul 2018 17:15:26 +0200

A search was specified in the rule “r4” for function calls which should be
found by the rule “r1” already in a script for the semantic patch language.
It is useless to repeat a source code search there just to determine
that a variable assignment was performed also for an input parameter
of such a function call (while the same message will be displayed so far).
Thus delete an inappropriate search specification.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 .../coccinelle/api/atomic_as_refcounter.cocci | 33 -------------------
 1 file changed, 33 deletions(-)

diff --git a/scripts/coccinelle/api/atomic_as_refcounter.cocci b/scripts/coccinelle/api/atomic_as_refcounter.cocci
index 988120e0fd67..61fcaf5e45a3 100644
--- a/scripts/coccinelle/api/atomic_as_refcounter.cocci
+++ b/scripts/coccinelle/api/atomic_as_refcounter.cocci
@@ -57,39 +57,6 @@ p2 << r1.p2;
 msg = "atomic_dec_and_test variation before object free at line %s."
 coccilib.report.print_report(p1[0], msg % (p2[0].line))
 
-@r4 exists@
-identifier a, x, y;
-position p1, p2;
-identifier fname =~ ".*free.*";
-
-@@
-
-(
- atomic_dec_and_test@p1(&(a)->x)
-|
- atomic_dec_and_lock@p1(&(a)->x, ...)
-|
- atomic_long_dec_and_lock@p1(&(a)->x, ...)
-|
- atomic_long_dec_and_test@p1(&(a)->x)
-|
- atomic64_dec_and_test@p1(&(a)->x)
-|
- local_dec_and_test@p1(&(a)->x)
-)
-...
-y=a
-...
-fname@p2(y, ...);
-
-
-@script:python depends on report@
-p1 << r4.p1;
-p2 << r4.p2;
-@@
-msg = "atomic_dec_and_test variation before object free at line %s."
-coccilib.report.print_report(p1[0], msg % (p2[0].line))
-
 @r2 exists@
 identifier a, x;
 position p1;
-- 
2.18.0


  reply	other threads:[~2018-07-16 17:24 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-01  9:40 [PATCH] Coccinelle: add atomic_as_refcounter script Elena Reshetova
2017-09-01  9:40 ` [Cocci] " Elena Reshetova
2018-06-14 23:58 ` Kees Cook
2018-06-14 23:58   ` [Cocci] " Kees Cook
2018-06-15  5:06   ` Julia Lawall
2018-06-15  5:06     ` [Cocci] " Julia Lawall
2018-06-18 13:47     ` Masahiro Yamada
2018-06-18 13:47       ` [Cocci] " Masahiro Yamada
2018-07-03  7:30       ` [PATCH 0/6] Coccinelle: atomic_as_refcounter: Improvements for source code search specifications SF Markus Elfring
2018-07-03  7:30         ` SF Markus Elfring
2018-07-03  7:35         ` [PATCH 1/6] Coccinelle: atomic_as_refcounter: Omit placeholder specifications from two SmPL constraints SF Markus Elfring
2018-07-03  7:35           ` [PATCH 1/6] Coccinelle: atomic_as_refcounter: Omit placeholder specifications from two SmPL constrai SF Markus Elfring
2018-07-03  7:37         ` [PATCH 2/6] Coccinelle: atomic_as_refcounter: Optimise a disjunction in the first SmPL rule SF Markus Elfring
2018-07-03  7:37           ` SF Markus Elfring
2018-07-03  7:40         ` [PATCH 3/6] Coccinelle: atomic_as_refcounter: Use type “expression” for another metavariable SF Markus Elfring
2018-07-03  7:40           ` [PATCH 3/6] Coccinelle: atomic_as_refcounter: Use typ =?UTF-8?Q?e_=e2=80=9cexpressio SF Markus Elfring
2018-07-03  7:42         ` [PATCH 4/6] Coccinelle: atomic_as_refcounter: Replace disjunction by a constraint in two SmPL rules SF Markus Elfring
2018-07-03  7:42           ` SF Markus Elfring
2018-07-03  7:45         ` [PATCH 5/6] Coccinelle: atomic_as_refcounter: Use nested disjunctions " SF Markus Elfring
2018-07-03  7:45           ` SF Markus Elfring
2018-07-03  7:48         ` [PATCH 6/6] Coccinelle: atomic_as_refcounter: Use format strings directly in " SF Markus Elfring
2018-07-03  7:48           ` SF Markus Elfring
2018-08-01 12:30           ` [PATCH] Coccinelle: atomic_as_refcounter: Merge two " SF Markus Elfring
2018-08-01 12:30             ` SF Markus Elfring
2018-07-16 17:21         ` [PATCH v2 0/8] Coccinelle: atomic_as_refcounter: Adjustments for source code search specifications SF Markus Elfring
2018-07-16 17:21           ` SF Markus Elfring
2018-07-16 17:24           ` SF Markus Elfring [this message]
2018-07-16 17:24             ` [PATCH v2 1/8] Coccinelle: atomic_as_refcounter: Delete an unnecessary SmPL rule SF Markus Elfring
2018-07-16 17:26           ` [PATCH v2 2/8] Coccinelle: atomic_as_refcounter: Omit placeholder specifications from a SmPL constraint SF Markus Elfring
2018-07-16 17:26             ` [PATCH v2 2/8] Coccinelle: atomic_as_refcounter: Omit placeholder specifications from a SmPL constra SF Markus Elfring
2018-07-16 17:28           ` [PATCH v2 3/8] Coccinelle: atomic_as_refcounter: Optimise a disjunction in the first SmPL rule SF Markus Elfring
2018-07-16 17:28             ` SF Markus Elfring
2018-07-16 17:30           ` [PATCH v2 4/8] Coccinelle: atomic_as_refcounter: Use type “expression” for another metavariable SF Markus Elfring
2018-07-16 17:30             ` [PATCH v2 4/8] Coccinelle: atomic_as_refcounter: Use =?UTF-8?Q?type_=e2=80=9cexpres SF Markus Elfring
2018-07-16 17:32           ` [PATCH v2 5/8] Coccinelle: atomic_as_refcounter: Replace disjunction by a constraint in two SmPL rules SF Markus Elfring
2018-07-16 17:32             ` [PATCH v2 5/8] Coccinelle: atomic_as_refcounter: Replace disjunction by a constraint in two SmPL rul SF Markus Elfring
2018-07-16 17:34           ` [PATCH v2 6/8] Coccinelle: atomic_as_refcounter: Use nested disjunctions in the first SmPL rule SF Markus Elfring
2018-07-16 17:34             ` SF Markus Elfring
2018-07-16 17:36           ` [PATCH v2 7/8] Coccinelle: atomic_as_refcounter: Use string literals directly in two SmPL rules SF Markus Elfring
2018-07-16 17:36             ` SF Markus Elfring
2018-07-16 17:39           ` [PATCH v2 8/8] Coccinelle: atomic_as_refcounter: Use format string directly in the first SmPL rule SF Markus Elfring
2018-07-16 17:39             ` SF Markus Elfring

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=ba3ffd66-7c04-cf3a-6c70-af7ba704b1b5@users.sourceforge.net \
    --to=elfring@users.sourceforge.net \
    --cc=Gilles.Muller@lip6.fr \
    --cc=cocci@systeme.lip6.fr \
    --cc=elena.reshetova@intel.com \
    --cc=julia.lawall@lip6.fr \
    --cc=keescook@chromium.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.lkml@markovi.net \
    --cc=nicolas.palix@imag.fr \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.