Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2600314imm; Mon, 16 Jul 2018 10:40:49 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcN8uIC/dNQJAvp5PmTdjWz/JuC+rmmNHMRxqFyZaWQ/bgDDi8eebFvzjMl7m63LdonQnNt X-Received: by 2002:a62:4dc5:: with SMTP id a188-v6mr19125570pfb.217.1531762849576; Mon, 16 Jul 2018 10:40:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531762849; cv=none; d=google.com; s=arc-20160816; b=Q0zoV9OGU6KVmY6gGvkTbZ+qlLGGOryOmQTZ3pCjOxjBMrfLRz6yurJ3yL+WAJigQF eeFtgNzudWXwKsp3sJALjrmPYE/SuQb+D2V/xA4FKrLrrHsSnMk6eZLJcE12cXwiiHTn Te2nGSGk8D9NCtJsJbrQ9e3lgcxTPIVOlNHqd1zpq2M3uHkeoqB7l+L6VrAFZepglLAc Gj0VPzrsyi+MG76t+MEUkcMqPUgQVDP7qnoze2Tn9w6whRLi/e/mMRd7w9CwH/u4S1hi 48RCizdRxEcFd41vUWw1cJ7WlRZaN5J4jLJnQVZnW0Z0MRMEiJ6AYL+lRc5ZskaBMiUv hl/w== 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=XzqTjLiJjfhquNCNQLEZTd7tLcCq5q4YMCaq8EAIjtw=; b=Hxo1dDzOXischbPDiKIvNG7s7tzcuQJskNulZ+ZD5myObQ6rD1Xfi+cu6Yhs1rYFHY e0HyE1toLNTaFJ4L9a3/PBhk8vRLeDstbhlT8bZfIOSCSMyfFDD0a+3eR7P50JCQxYSB QdGVDFFk9yeVUeCqWuZHKjAwR0iOZcMO8TVzLLroBi0Rt9yxBA7DivHaNsnzEkGQA52D Kmb54YwMPYo3tSllFOTkeXF3s7T+B5KH3wuGB+yB1rzRg5Sb93eRzcaOozzdP+IPJ//h 8fQe5I6BxYVbth2cyrj8IPPK5VNWko9gkK2jpPYbdLuO4+RnROv5HYBxYfp2P2yUb+bB K46g== 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 k4-v6si22803940pfc.328.2018.07.16.10.40.34; Mon, 16 Jul 2018 10:40:49 -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 S1728522AbeGPSIT (ORCPT + 99 others); Mon, 16 Jul 2018 14:08:19 -0400 Received: from mout.web.de ([212.227.17.12]:45187 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727618AbeGPSIT (ORCPT ); Mon, 16 Jul 2018 14:08:19 -0400 Received: from [192.168.1.3] ([77.191.164.6]) by smtp.web.de (mrweb102 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MQ6LH-1fkK3r3yDL-005GbU; Mon, 16 Jul 2018 19:34:37 +0200 Subject: [PATCH v2 6/8] Coccinelle: atomic_as_refcounter: Use nested disjunctions in the first 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: <15372138-088d-81ce-3d3e-0b95f5d91ce9@users.sourceforge.net> Date: Mon, 16 Jul 2018 19:34: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: 7bit X-Provags-ID: V03:K1:fjCgl41eUfHtlnROsoSyP7cFAFiYnDim7VIrp0gfN0cl86pSiTV sNyDjsnmwSTli69qrTQO1NPp0y6Vc/7VRFB/dNqo0JtRAwoD+qTtHJMgs0847IbZsATx/// A7OYdan/AFAJCyFnLIjqrNQkgm2+e0v7jJAi/vyEukuSYS94sgBYbL5ZzzZf7lIdn85a7re BLgW7SFl0Y7oEUZdokpCQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:8HRv+vg3Afs=:EynoDwGQHxJ0WfMDSs00fa lNC3i5b8S1TIfbX/Tqw9VGPnfWGD6lMCurkvoDgBXyjWbJVV06tMsBaR45tApxGulwoLp4rpQ Gr9qxTEEnbf1Q0arllRUFTH5LGjol7K516yW1cKKSHVnGScGobLIJ6uSWp86oP+KkwKDfUiUI /NXVXSQ3GwcXFf/YEAzoLopFhrJh6dnMnesFFF4qN7zZV48DPTwMqb/JbJtMemTEyCmo/n0q+ i948U1cFPvslGmt1xiH/Ur2l0xB9A1ExTNuCpH/nT+fpKf73Q4uXo8r05h0IRqv/ZPm5BLy2E x8dqeDU9CELX4Xxw5v41LSF2teVC/ZAQzTsXDR/c5q9YY2nFDPFKnd/YFP5riGtEEg4AerROO TtVhmApAW49I5YHy3JedezFX2P+qs/9mdpvFmBQLTR9BtROocSPizLvV38JEfy0/lEdE7t/XR zszbNM2vFuw+5RcZ9kv/zYqnWb825ej62Iu52YBFzE5/tl7ysaeYFwKYFHJ1YUu9ZP3MCt/aD Sl+KiPlx4JPKX4Qcov2OsroFj2CqabYEJ8RhMNrXmlBP3YL04IV0jnA/K1hRWhrLY6uI9NgFV pmCxhURwdu3m/VQ9+dEDVp6PgLeUQuCOwmGsm5/v6xHKGEjS3JEf3aHOt1biCXqUJeQ/cU72+ qoByDcX8azPCvXPVN8IdSKepNSAfhw6Uk/YBnxvLsi0Bkedz3Qzd/Ljf/5VgdHm0uYWWqg4+2 tn0myj4SLttm1Ovy3H71aS6ynwIRrODcaRXbOwtFBNfkdlspNQyUGEB30CPPGoOVyBhhuxGmc CHFUjgk 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:22:53 +0200 Six function names were specified for a search of function calls by the means of a disjunction in the rule 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 | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/scripts/coccinelle/api/atomic_as_refcounter.cocci b/scripts/coccinelle/api/atomic_as_refcounter.cocci index 4484bea6c9d8..7eae23dc9ea8 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, ...) ) ... ( -- 2.18.0