Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp851503imm; Tue, 3 Jul 2018 00:47:34 -0700 (PDT) X-Google-Smtp-Source: AAOMgpexd9/EAQAfBE/0MGJuzYzR03g/XR/RglRmy0nR74xAXKysaLyWxhQg+cb7CNLtT6g41cNd X-Received: by 2002:a17:902:a981:: with SMTP id bh1-v6mr254770plb.2.1530604054546; Tue, 03 Jul 2018 00:47:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530604054; cv=none; d=google.com; s=arc-20160816; b=AZQ3IrN7WbHo9HmmNYkEZ95Uax1CStM4OtsbdSptraAEdLuDpoPvsYHf8HFwTgB3Qw tbIcs+DBsMxfcrwwmapr5jPgCp/JQ8hBcDttODismyC63ZnjreLZ0sifcZR+A5hhQAuG px+exw+K7LHEDGvRyFwsZpgVORmvi9hGbnsJoA4qGa9t1ka4D20VcwrpzvPo2D4+uf08 cC5/huAh4qI58dq8ifGfH5dtiHTPINnsKF2nzKnccV1oLzXvJi7BHSa59YiCSpor4GG2 elBufkwbxmyWqjp8lAc0Ej61kqw2MWhDVEk8CVChFOp4FFEFElfys/9Jb5Aq6S6LEw0P 6OZA== 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=Zury72kc5L7aAtyav1WfyxX8PMbRuVHNUk6h+IeovNI=; b=DSGqEyKYyqOEmED6j5NgjtK4XAJ6Vm/an0xuqvJXRp1EEkA9JaaT/m+Dnwx1wflir0 XWzM/HzHOEKd8kw1jVs08E3i+ePPfvKTIdxzUbJia5uk3UUE8BVZPib/X4a3GKM+gLrp 7S9JXqR3FpsCj6b8c7T6pEwV5OXvsTZZyx1mMVmt9wy4Uu/IH3fMcyzCkjUdzHqFikNX 7FP7nOg3d1FbkdNjNjr82r8m48pozhe8RhTwUdEM2vkVXLXnu1ecDjOPsucf7hrraba6 AkBQkPCJX8yuQeeEl5GmT4PVJDuuf0LknRLTIstGCoVCWIKqFRNrz0+oEtmKMT3XF+dJ L6Lg== 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 4-v6si527196pgn.90.2018.07.03.00.47.19; Tue, 03 Jul 2018 00:47:34 -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 S932778AbeGCHqR (ORCPT + 99 others); Tue, 3 Jul 2018 03:46:17 -0400 Received: from mout.web.de ([212.227.15.4]:37845 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932126AbeGCHqP (ORCPT ); Tue, 3 Jul 2018 03:46:15 -0400 Received: from [192.168.1.3] ([92.228.103.75]) by smtp.web.de (mrweb002 [213.165.67.108]) with ESMTPSA (Nemesis) id 0M5wkL-1gKOPM2ySn-00xpKH; Tue, 03 Jul 2018 09:46:05 +0200 Subject: [PATCH 5/6] Coccinelle: atomic_as_refcounter: Use nested disjunctions in two SmPL rules 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: <6d70ae28-69c2-4d7a-2151-6df704694d0e@users.sourceforge.net> Date: Tue, 3 Jul 2018 09:45:54 +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: 7bit X-Provags-ID: V03:K1:dJ3Rib+AdbnHZ/0Gi5iH/7NOLh/dlXqfgEUFZlnHEbWq816bKUS dGQLmt6FI7TTozZtWOGvGWEhL+8PpzJQTJi8HaC/1XjBh4CtThpzzqrjwOrKVML5eEIYm1N uIAooe8JCFrN9tmmYoFOW7SGXHTyGrHLqiU2dT73BkvJvsTOUX3p5KSqNUv7/OvVuxPGUdv aRACorTuMDhVGflcG5GUg== X-UI-Out-Filterresults: notjunk:1;V01:K0:vR+gPXfvGag=:XGa/YN197sPXmlLV9oehfy g9rX7HnhAzXWWyzBLuBWsz/xB3WTBTVCcpV0L7qWK5XmBSko9NOtKjWFHJp3yEF5EDo9Jra9G 0cKSYkoMgTN9wUexJGBz1Hrr9C3gRhA8pAAooyIF92iqrhwBrVErWgNkHIsAF2WTqVxjF5/rk u8apKv60qiFtyhU3pYJ90FOaGlvdWWD1dnxgg9JrYJO7Ve5lpGQkAITorBzNXLgjUetlhVuVR AtfpRtSchghKqP/Pw3XiVf3c1pvxAQ2dTqHtIK9+6ojL1GtFxdL8usmzkL5ZKXyJeKojVT0Aa IUO3rbAo2hx666Z3JkzQ21CZnl9CwPxDnEP933nuhv2+C8i9ZO7gRh7z//8ZSs0B9aqkW8atA 9cCvYpIFETJRM55y87edGp8AMuf2urNOYyBwLm5nYmYXCw+8F2E08rKD/yoMrk4i08HoHsZ6G AllE2BA9LGitbJaIulSeWfe+cBNUbo/5uYzsGPUeuoNbRGdljuvgesiZdBeAINK+4zHVNzjBa VLSWglGXz+dLPnL+2hIGlEf5qqDEs29tZubfTttHRpAeTTWbNGR+5Yf2qKYTO/5ozjQJ7k73Q vWZxkpFzTSQvL3vs2sdRtyjYBJer+RpA2glmq0NhS0M8G56wi53mvGEgZabt5qaNAbj+IZ4yQ uYlPjrgLQqhHPBM7xaR4uIugwX2LGGs0jNON6TQnvMDm83USoporLOa9DCNK7Gh1isi1WBEgO axD28UpezhTGidyr3aZxJfJdNqd0imL+IhREiAov4wCFp3zKliLAsb2ATQ5vw4g2yG2kfby2G w3Ar0E7 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 19:21:28 +0200 Six function names were specified for a search of function calls by the means of a disjunction in two rules of a script for the semantic patch language. Refactor them into two groups so that the SmPL code repetition could be reduced a bit. Signed-off-by: Markus Elfring --- .../coccinelle/api/atomic_as_refcounter.cocci | 36 +++++++++---------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/scripts/coccinelle/api/atomic_as_refcounter.cocci b/scripts/coccinelle/api/atomic_as_refcounter.cocci index 372ae99591fd..63cbe866c99f 100644 --- a/scripts/coccinelle/api/atomic_as_refcounter.cocci +++ b/scripts/coccinelle/api/atomic_as_refcounter.cocci @@ -18,17 +18,15 @@ identifier fname2 =~ "(?:call_rcu|de(?:l|stroy)|(?:queue|schedule)_work)"; @@ ( - atomic_dec_and_test@p1(&(a)->x) +(atomic_dec_and_test@p1 +|atomic_long_dec_and_test@p1 +|atomic64_dec_and_test@p1 +|local_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) +(atomic_dec_and_lock@p1 +|atomic_long_dec_and_lock@p1 +) (&(a)->x, ...) ) ... ( @@ -53,17 +51,15 @@ 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) +(atomic_dec_and_test@p1 +|atomic_long_dec_and_test@p1 +|atomic64_dec_and_test@p1 +|local_dec_and_test@p1 +) (&(a)->x) | - local_dec_and_test@p1(&(a)->x) +(atomic_dec_and_lock@p1 +|atomic_long_dec_and_lock@p1 +) (&(a)->x, ...) ) ... y=a -- 2.18.0