Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751641AbdHQLua (ORCPT ); Thu, 17 Aug 2017 07:50:30 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:44546 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750812AbdHQLu3 (ORCPT ); Thu, 17 Aug 2017 07:50:29 -0400 X-IronPort-AV: E=Sophos;i="5.41,387,1498514400"; d="scan'208";a="287391697" Date: Thu, 17 Aug 2017 13:50:08 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: Elena Reshetova cc: linux-kernel@vger.kernel.org, cocci@systeme.lip6.fr, Gilles Muller , nicolas.palix@imag.fr, mmarek@suse.com, keescook@chromium.org, ishkamiel@gmail.com Subject: Re: [PATCH] Coccinelle: add atomic_as_refcounter script In-Reply-To: <1502884342-10702-2-git-send-email-elena.reshetova@intel.com> Message-ID: References: <1502884342-10702-1-git-send-email-elena.reshetova@intel.com> <1502884342-10702-2-git-send-email-elena.reshetova@intel.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 979 Lines: 20 > +identifier fname =~ ".*free.*"; > +identifier fname2 =~ ".*destroy.*"; > +identifier fname3 =~ ".*del.*"; > +identifier fname4 =~ ".*queue_work.*"; > +identifier fname5 =~ ".*schedule_work.*"; > +identifier fname6 =~ ".*call_rcu.*"; Personally, I find the above regular expressions much easier to understand than the merged version that Markus proposed. But the performance issue is only on whether to use regular expressions or not. If you use regular expressions, Coccinelle will not do some optimizations. But once you decide to use regular expressions, the performance hit is already taken - for a good cause here, to my understanding. So just put whatever you find convenient, in terms of readability, precision, etc. It seems that del is not very precise, because it is a substring of multiple words with different meanings. Maybe it should be improved, or maybe one can just live with the false positives (eg delay), if they actually are false positives. julia