Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2586608imm; Mon, 16 Jul 2018 10:25:47 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcSSh840z8gPsyCNltObeeC0bNaoUK1QNaGx4qTPGZjWZYMaj6N8Iau9Hb1FBiagoHy4AH0 X-Received: by 2002:a17:902:43a4:: with SMTP id j33-v6mr17516349pld.118.1531761947029; Mon, 16 Jul 2018 10:25:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531761946; cv=none; d=google.com; s=arc-20160816; b=yUmsPVEdh0WSjmDdxeb1Aizpjnz97/ucYhvibhLkL/OVr3SjyOmv1tAO4T1KWwZKpG 0tkfzNswtcedQQem7Gz0L+OBkR2x8SE7EDv6ln56bpJwZD1OQJb742BNg0JgMIKHfgkt 6FMIrvtUkX7c1P+5DG2fr7A6MEiRBFswRxbzadrkVxLLcMB1pOTdpFTK5RG9bVjIcW4j v1W8qVw8RZK4C7IuH7mR04LLni4sSL/5xyf2qDglpHvwaky2UdgCIPju/crBgMmyzX5/ rvpfEuIrvLQgeqt9gxHwtVEBCsV+mwne+eMButksYVDICguDA6DG7j6dRsgsz5uwQiJe 74Yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:openpgp:references:cc:to:from:subject :arc-authentication-results; bh=UwRszDvE8qrOGE3eXVFRS9zXOwVWhHVxOsxzQ/4Z7uk=; b=V90oVfWH0UjfXMvsjYhLG0Dqrx6vNIPY8cq3s4teLoH6hgci8kGv7R/z/LIthawjif YQ2r5N4OvQSgQEbxIs8Sc/8QVQiRni+GUS0OSnjrJOuA6ASLI4kRFlnHN21zb8KoaM8p m821wtGKgxoBPdnjp0IPtF/nN5ljVeOKYwAPxzttv8sOSqDKvY7IauRvXGB58Ki1NdRk f1jCkQjt9yDFiYY3NSxyPfVG1MXx0IuftrV7q1IIdXlfOP1W2latKLBOCupxWuAv4JuJ 1Ig32bwYT9Z4DYPgDImgrETrasRwqEQn5i/+/Fcpbp6ip8x7OUrH94E6VeJioL3+D/Kn usoA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=sourceforge.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r7-v6si20757506pgn.491.2018.07.16.10.25.31; Mon, 16 Jul 2018 10:25:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=sourceforge.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729552AbeGPRxS (ORCPT + 99 others); Mon, 16 Jul 2018 13:53:18 -0400 Received: from mout.web.de ([217.72.192.78]:58265 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727866AbeGPRxR (ORCPT ); Mon, 16 Jul 2018 13:53:17 -0400 Received: from [192.168.1.3] ([77.191.164.6]) by smtp.web.de (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MJkt6-1fe0m240bk-001BFl; Mon, 16 Jul 2018 19:24:39 +0200 Subject: [PATCH v2 1/8] Coccinelle: atomic_as_refcounter: Delete an unnecessary SmPL rule From: SF Markus Elfring To: kernel-janitors@vger.kernel.org, Elena Reshetova , Julia Lawall , Kees Cook , Masahiro Yamada Cc: LKML , Coccinelle , Gilles Muller , Michal Marek , Nicolas Palix References: <6043bdc9-529f-e93f-e509-e2dedd290a10@users.sourceforge.net> <5ca6ab58-e929-8468-74e2-012f987a0773@users.sourceforge.net> Openpgp: preference=signencrypt Message-ID: Date: Mon, 16 Jul 2018 19:24:35 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <5ca6ab58-e929-8468-74e2-012f987a0773@users.sourceforge.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K1:Ojc3ObnvaJd3sm/GGkF4B5rXssatoHQHLAJT2WifsLlezNRTFuh Ic4gT/9r0X33s09P0DwTH2eCu0R1rjy0IoSvqDqzgi229j3MFq9/rZbsd9wmFDlOQQ4eaRM ZXxe+9EUllJnzGv4IRHrShi21WOyxEqF69Q/OAlCHpfBK1IpjBXRhMVOK5M0/fz7LMg+Wxj uSvmnz6tFbw7rfV/onyEg== X-UI-Out-Filterresults: notjunk:1;V01:K0:NSL4GdE2vyg=:03FNK6GidgOMmmjIlw5zLo VQLAd5xA3Gwj72k2YisENvCgiLJCF9J9vsrkZr4CWzwV1NupP/qLFU6PJU7UiI0H9J6BqlqFo 4Fi1yo1wwCbFtWoHprG1kLuEacLRqhCJLPzrcFthr75p9Jd7owBrCsmtEpVIrJm48p4U8+awD lK9b5PqWMWuEDn+Y9G97ABNYWN58SYHgkv8F4IgOMhgk3F1BIH1CSPDHSmjj27H5TRUEqx+RS epQg+eTDjV3HQqQiUpDuMimjylyydj7hXGxJjSE12k2NRIxmHUJY/hIM7H2mr6mRDMr+y9+Er XbsNyLhC61F9EfI/dzRAvzwoZ0NkwKVrs40UQRzMmL7lLtltZzvCZ7N9vHp8OJmQIXxEpqnQj eNl4/lF5d5/7GxGsTOyw0G0xOWMuTiNyutaS6UlpyARKXmzhZZ4ttwEugFu2v3FyDndzbr4GZ WjEQfziweTNAiZj3RW6qOxDYQL7RippJNPiBIpMC5ndJU2vnSrhYmtrWVf4gQfOYbS68QBAhe WVyJu811D9SsoOLiNiA2x8zpd1pmmPkbr2r1zh6JAJyf6iHGzJ5MCtV1l6V9OB+co+vzr9heh Mx+GSEVBxVBLxutZ1DWfN43Si1yr17WJT2lKfX6uJrj32aGnAWfn8EYxarr3Lf8N0KGTgIZrY wrKbfh6FkE4PdL1W8AeuaGwfUr11++6Mr6hbeqbvcu2R1zbwyCTi66Rr4hrwLhodt67ehziUh x03rZO/JJv4asx91xbXuZo1lkeDaa/zv1p1Fh/YApWvA/Tio8LG3j70gZxPbPacdokXGuWaQZ Xt43gN8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Markus Elfring 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 --- .../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