Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp847311imm; Tue, 3 Jul 2018 00:41:54 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJRXoinDSPRgDJeMpaxRqmQc4IJwAuL4Kp6wwIooJaHOYUR6+jSqqSg0flZsEyryw+ueOjM X-Received: by 2002:a17:902:e209:: with SMTP id ce9-v6mr28770808plb.233.1530603714250; Tue, 03 Jul 2018 00:41:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530603714; cv=none; d=google.com; s=arc-20160816; b=EV9MhLlQAnSzhjnpKf0YQhETC4doAO6XNfg88wjUYANwkbotFn+h8Kghio+5AYTr/J XNvSZOh7DZgskEx696xupStTghp3dLM6rq5mDfsqJnSsJinHcDSp2HnEb31iqdwlrrhw bXEto69nUcu8TyxKwBoDVCrl1U+udSjGxePWyspdN1o6yZ6aYuloKV0p31JNgCROgMmM i6T0ogjfm7ZNJY2+pB+do1+q2wE1qIvHAYvZ1XXBxk4Z4c+3EhTQuQt51nRCZEtfgiJB 2Gv1mxc0th1ClcJHv3IeBnto1Z7XpEI0w/NxYf2mQkVd8GtlHOPIwCWTEdjDoKwUipBM 1+bA== 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=TGJul1Ws8kKN2pwiUXOCgP3AsG/AUPtEXnCFDTM//9M=; b=Yu/fcU8dTyQhkIEaXMkfjn1+SeQXUGneCrJSBgunR6o7kdcMfwmaSf1qZ7vMTdfwE5 HXDp71H+KWjGQHTgGvbfxFyeUzGTIp05T3z7tEuwOVy49uoIBEDqFvcOL2jYYL7jERkB GzA55uilNn5UOfwDMymIvFXeEWkWABDmSa6t77FpDENR1G9w+esMx55ovBaYPAMenP4j y4Qrx6Ge68VjdR0lyJhzKlDCeJhuYsMdd3SNYfS84sFHN2W7vRmcIzbyOckl80431GhG WqKTEJ/Wa3AHjVDzm6jY+tqyvFJn2GbmmIBBswi4nvP/puiuRBG2m3JowJugs6jtN8w1 oAFQ== 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 c6-v6si509720pgn.143.2018.07.03.00.41.39; Tue, 03 Jul 2018 00:41:54 -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 S1754566AbeGCHk4 (ORCPT + 99 others); Tue, 3 Jul 2018 03:40:56 -0400 Received: from mout.web.de ([212.227.15.14]:58937 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753834AbeGCHkz (ORCPT ); Tue, 3 Jul 2018 03:40:55 -0400 Received: from [192.168.1.3] ([92.228.103.75]) by smtp.web.de (mrweb001 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MVtmK-1fcUx13eKO-00X2jn; Tue, 03 Jul 2018 09:40:43 +0200 Subject: =?UTF-8?Q?[PATCH_3/6]_Coccinelle:_atomic=5fas=5frefcounter:_Use_typ?= =?UTF-8?Q?e_=e2=80=9cexpression=e2=80=9d_for_another_metavariable?= From: SF Markus Elfring To: Elena Reshetova , Julia Lawall , Kees Cook , Masahiro Yamada , kernel-janitors@vger.kernel.org Cc: LKML , Coccinelle References: <6043bdc9-529f-e93f-e509-e2dedd290a10@users.sourceforge.net> Openpgp: preference=signencrypt Message-ID: Date: Tue, 3 Jul 2018 09:40:30 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <6043bdc9-529f-e93f-e509-e2dedd290a10@users.sourceforge.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K1:H7JSWUn6ue7iVEYOKeYIGvStTFLnps9gF8G3kKfgEC9egZE76KU znnVNLOWRI55XHT6rvxCWe0/mn77zh3/bThdD4+QBCVgVAxpbSzmFQiRTE2uOLVz6VITMti DhLVH1WAcnq9q9aQviVBWoJWy+C7nWwaF+bNfQp9cllPJUtvtwCq55ewES88WvKpyeeWotv zydi/VcRZYeuv/2VLeP1Q== X-UI-Out-Filterresults: notjunk:1;V01:K0:okEbuJBz/Bg=:Ff5QRBwnb9CG6vqkyX5g9K wsN5blu+7Tea/m9Korms+SL2+PfEomDwZ4V/2OX8/oFPjSbgV7z1Qz68cMEVTZ/Sbs0pexgwl UzvLZiyQvDg3pjIdMYhauOxxNimlnrdZukEKeD9R2oioRvLzolPdbETSFgcToefKX5P3Y3eD/ hWbt6AfeH8irQvsGXhJvmy15RHpRgnaPEKLTW42y+qM4kv8jboV7ZSAox/FQ7sGyHMnIcfPBA vewnZA0EhH3HLcvxdSb4itmjfF5SbXUF54Q/Y7taiN6kkZpaUA6zAT0NT7FacN6bdzjT5TdLh YW0WKp0MweFWLez6xoTJANFFxWpoqxEzMypi+erm6blfkQeNc519qRYEeX8I5/epMrDJTZZiF 9a950Tz4WGGlSy/Kxh4sC9h5bbIx353q+TNrtS23xJAvVbdkw6b3Hf424JnvQh9rphPgBxHEE haZtCpVdveIfuorYTpQ2VlBF9WQL3HkDa0Pl/PVznwHAEdje49xSl3TwoYtt/yXiP8pGV3sw+ KnsDnX2Ofj/HPgSCzpQcTUz4yglL0+VF2REQ0wKZg/VoQBeiqtf/2i7jwvrKkfvh2iGei+QqH VEq9xf9jPOlbW9WoavFAEjy6B+dPeJaDtAfv7iLONwOzm8/2hHBAH4cA0IabE6uT2DdmZDKe2 SDtQBtSoQ/UZZUUPYkEnAzcJW+UKowHXK/o3itsHCRMMB+YRTylT1+BjL4AYTxscDtf1sKdPy 9R5Bnstnhf5IigyzLH3VvEcPP18sQ0Jn0TJ6rbufO0091I+54A6h7oWMbF7spAnHRTrs+Kkru 8pwodhR Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Markus Elfring Date: Mon, 2 Jul 2018 17:55:27 +0200 The metavariable “a” is enclosed by parentheses in three 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 | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/coccinelle/api/atomic_as_refcounter.cocci b/scripts/coccinelle/api/atomic_as_refcounter.cocci index 5571eea04c7b..57af2db9463e 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)) @r4 exists@ -identifier a, x, y; +expression a; +identifier x, y; position p1, p2; identifier fname =~ "free"; @@ @@ -77,7 +79,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