Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2596797imm; Mon, 16 Jul 2018 10:36:42 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd4+63RHIsTBn1Hip6+MtDJGDt13tZ0hj8MOyrLlLwucPHNDVTIYNSlOFuqxGtuyE2DtfGx X-Received: by 2002:a62:4c0f:: with SMTP id z15-v6mr18702682pfa.110.1531762602115; Mon, 16 Jul 2018 10:36:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531762602; cv=none; d=google.com; s=arc-20160816; b=WBj4uJ+3xKP0MiILBGH3eOAq7Y7Q5mKEpuK7Bb9LVdzWvqdJeIPS0+MgYd1x2fa8g9 QaF06awZX5f/Cw5oMPp7pUlVS5c3GeUjw8CqgunSta+50iM3Go5VeehZaE6avAIyJZRn 4dUC0N60oW6xXOG+yZMc4lYOsuNF114N+4NsllJv34PZcbBnRPhOBoGcmvrjLvcUGYlI s10G6pgY+n1qqwWHh+tgKP7R1hTNZ/Lc4hrk7EH/xP6LlS5fIN1kR1lsPg4QZ/mpbuV4 PiwnFYeg9YVq9wsGvp0S7148JdPG/D1FGpmiRe5PRANogGY6JokS5M1KlhiHMbtSHznD zIqQ== 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=GQLV/Ts/nj9A/q9YXot9TBbz5FURanJcswScMiSnmD4=; b=AjjgpdcWDFr11MnSHlfpLF5oxdDiMfaxVlFf+BrYl1bdTI4uZjSYEz2+ifq6AjNk94 YbAM6q/4ogxiYpcWxTBtdaTjwn2ZkcxizcuzxRX2NMuPKT41AdgheVjKp8Otpkr4sNpn yvdt+SpNOPMOyIwUtKy5V5hEM3WczjmG1lJSGbh34ehgGa/TDO5T7m1AUKDzzMKs9XiH pOerRoBmBN3hBI8EvCYEemUoWGHVU4t4IwIOR7UCpwQfuvFwHuzhBhvqVb0Gda0JZW8A CNgZw50jJElExQ7zcOX7LVJDql+UOMSRyX0onqv5jPtf08ySb1ST5C+ZHJpOUaw7A8Ud TlrA== 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 u8-v6si30268151plh.492.2018.07.16.10.36.27; Mon, 16 Jul 2018 10:36:42 -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 S1728442AbeGPSEL (ORCPT + 99 others); Mon, 16 Jul 2018 14:04:11 -0400 Received: from mout.web.de ([212.227.17.11]:49553 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727797AbeGPSEL (ORCPT ); Mon, 16 Jul 2018 14:04:11 -0400 X-Greylist: delayed 307 seconds by postgrey-1.27 at vger.kernel.org; Mon, 16 Jul 2018 14:04:10 EDT Received: from [192.168.1.3] ([77.191.164.6]) by smtp.web.de (mrweb103 [213.165.67.124]) with ESMTPSA (Nemesis) id 0LdmyV-1gNprh21Vj-00j1vC; Mon, 16 Jul 2018 19:30:30 +0200 Subject: =?UTF-8?Q?[PATCH_v2_4/8]_Coccinelle:_atomic=5fas=5frefcounter:_Use_?= =?UTF-8?Q?type_=e2=80=9cexpression=e2=80=9d_for_another_metavariable?= 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:30:27 +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:7lxRFp9yoiRPkmRz691KFqcvidMEO9oyKP8Lkt1SJIuI8ff5LRh PnF/Y1kat0v6luR7XU9OfYUytbZt9tfkCaj938qge/uKvxXqU7ZJ9QnRBsmRrbNW3BweNtr TVfJozw+BbRcFqR5u7v+MXhZbt52ayfjs2yCLcjy6KnhbpD2JQjcA/8jArBbpMGgJirpTmt xLsvdFy826DLlgXLMPzeQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:RlOhJkGDV2Q=:DR6JeESAO5s/7nOqvGQH5W sZejivGkaj8RTaStRROdx3annpmYrRQqVVYYfmg/SyU0Vel+YyFQNloGtwC4erCNFvO0pFM2l ynvr8so8VUEL5J2AMk8mSc1LDrssSNSRtUBILgZJPSM4TivS2T0d/GROTn0zOs54F/79tLACl qLi7ZZDcgRhoOWyaYfRXemj2WJr/J4TI7uIlvKegB7ASNe+XZtGrSP9H5YntEaArEHdAC0Wms S0i/L88xsSUeyShf6vEMw2SWcVgflpUW0vJWAGr9FSbiI9Z039GaFfK/lBRKoHPJY02TNCAeD 4bl/5ICn7l2DTNq9AQxNlHlFD2PbeKtG2PqqLCWVR0pRQpdQ46SHxoqSN8NL/FCa8YuBBxqvU xl3ww8J8PvBlxtCLSsPQceodMwnnYpKNjGqVRewLses4MyjHPfaFvlVwIInzrNqMuFNaV8MP6 TbGB7Ce/JKHUX6Ae2cAiFPXtSlmLuwPWDxLRQWy0Iz9kgDf6aEZPp+NadEof6LldJ4BeiD3RE VodKj22Uuz2OT9S3JsdUSjyTCeOlo8inTKl3jpbQDLrcRqFLG0LuxG4gR8TDwWkDj8Zs7lllx SK/cUKqtM1OV5M0xGxiCzQow4Jvlh6hKit8J9pZfZmgCWXdwFePaxaga3l2u4JyzaKMtIPJMj A4ZUO7yXPg6NsDHKRqRURYn1W11rcsOSF5aBT/Qx8GSger6IiEmB9qehLhTHIOLkQt0H51vFx vtPx+9a4uzBNIpwdbGJKirHzQu2mt8OjQBsmMqMzidXx9+JNzqiuEan4etFb76X2H2Z+Ih5Hs 4j+hYhx 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 18:00:54 +0200 The metavariable “a” is enclosed by parentheses in two rules of a script for the semantic patch language. Replace its type by “expression” so that the corresponding source code search becomes more powerful. Signed-off-by: Markus Elfring --- scripts/coccinelle/api/atomic_as_refcounter.cocci | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/coccinelle/api/atomic_as_refcounter.cocci b/scripts/coccinelle/api/atomic_as_refcounter.cocci index 4da83ccfa6f6..62b0132d65fc 100644 --- a/scripts/coccinelle/api/atomic_as_refcounter.cocci +++ b/scripts/coccinelle/api/atomic_as_refcounter.cocci @@ -10,7 +10,8 @@ virtual report @r1 exists@ -identifier a, x; +expression a; +identifier x; position p1, p2; identifier fname =~ "free"; identifier fname2 =~ "(?:call_rcu|de(?:l|stroy)|(?:queue|schedule)_work)"; @@ -45,7 +46,8 @@ 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; +expression a; +identifier x; position p1; @@ -- 2.18.0