Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp3038692ybe; Sun, 8 Sep 2019 05:58:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqy1kQc1TM7U5h9VxJJlcuZ6J99K1btFxUYAo89XlGWtrxpzdHr1kOsCLWnad5IdkLupycG2 X-Received: by 2002:a62:4d45:: with SMTP id a66mr18731287pfb.24.1567947517283; Sun, 08 Sep 2019 05:58:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567947517; cv=none; d=google.com; s=arc-20160816; b=uhKQz/VrC+gw7DqcM9ERbcrg4wwmvbSf3tBNU7ZPo7LkOMgXy9KTnbIMbHg8Odz5O8 l1ZWTTq2kIapzQboGNeF63xX9DkuMjmms2JJSTWc6Kk0npsT97vvqAUJsqWvhh0FgqEM OkVPptvxXkneTOMhomV6VTOQ8bUxN/PT5bl6CZO8/7lxjijQUOPoMvhnHkkKDrC85Cqf j/n6o2/EDo4MqDJBhmNNEYGij9q+YnTmX6foIE4elQ/R1zo3pn9eXhYMLNDRfwcPk3Bc B/mZ7mMlqAPmO83uyrxELrpZ5x1r9UVgRIcB07hHsp10ss64nTQ32nlgfhp4rLazHXID C/2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=hXMobRkIvMMcVz5VfPckzpxXjsL7ZAqNmpNlZQp1i5k=; b=Fhuk2RkNF9AzxLBDcGTxHS3+94MZI9lF+r1qlYq3XDh6KBlvbJO0fWPGM9yRqM1I/V QwSFOydfmiOIIK+oZMnHcZrluXj0XTvxDfOsQxSod6pUJ4TzVRG6K2jQRO2qwOS/5sh6 Po3teqiBRG/FzWDSBmOhxWk3SKArVLobck42J2CpCk86+MlPRoaE47pQuBgBQZ+7r5zt H4acB+brsOlLw7VgEPMXo0RJSE3PySgmHspWMdaUm5cI8FToIO6kBKbzZTitDGIsbBsn jQG0J3c0MXOM0bQ7dlmxOqVShqSvFHPB1oit+AJtsN+elCcwJ8gwqPA0nfN8XrA6adyd GiJg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w16si5355795plq.259.2019.09.08.05.58.22; Sun, 08 Sep 2019 05:58:37 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726882AbfIHIYB (ORCPT + 99 others); Sun, 8 Sep 2019 04:24:01 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:30645 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726267AbfIHIYB (ORCPT ); Sun, 8 Sep 2019 04:24:01 -0400 X-IronPort-AV: E=Sophos;i="5.64,481,1559512800"; d="scan'208";a="400736864" Received: from abo-12-105-68.mrs.modulonet.fr (HELO hadrien) ([85.68.105.12]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Sep 2019 10:23:58 +0200 Date: Sun, 8 Sep 2019 10:23:58 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: Markus Elfring cc: Coccinelle , Gilles Muller , Masahiro Yamada , Michal Marek , Nicolas Palix , Petr Strnad , Wen Yang , LKML , Allison Randal , Enrico Weigelt , Greg Kroah-Hartman , Kate Stewart , Thomas Gleixner , Yi Wang Subject: Re: Coccinelle: pci_free_consistent: Checking when constraints In-Reply-To: <9666134d-0ff6-81eb-b088-f0086a0e61b1@web.de> Message-ID: References: <9666134d-0ff6-81eb-b088-f0086a0e61b1@web.de> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="8323329-349894428-1567931038=:3340" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-349894428-1567931038=:3340 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT On Sun, 8 Sep 2019, Markus Elfring wrote: > Hello, > > I have taken another look at a known script for the semantic patch language. > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/scripts/coccinelle/free/pci_free_consistent.cocci?id=950b07c14e8c59444e2359f15fd70ed5112e11a0#n2 > > The following SmPL code is used there so far. > > … > ... when != pci_free_consistent(x,y,id,z) > when != if (id) { ... pci_free_consistent(x,y,id,z) ... } > when != if (y) { ... pci_free_consistent(x,y,id,z) ... } > … > > > It is specified that a specific function call should be excluded > in a source code search. > I do not see a need to repeat the specification twice that such a call > could eventually happen also within a branch of another if statement. > How do you think about to omit possibly redundant SmPL code at this place? Have you actually run the rule and checked the impact of your proposed change? The when exists below these lines has an impact. I believe that the rule is ok as is. A single path may have no call to pci_free_consistent, but if it has that call under one of the mentioned ifs, then the path is still ok, and not something that an error should be reported about. julia --8323329-349894428-1567931038=:3340--