Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp6028650yba; Mon, 13 May 2019 23:55:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqxw3DaRwDkFKnMsQ/Zcgo2ofdu9JlkSkEw+I8NKegPVQp97fo1mUgh/LJUwUvEDNY3dG8Rp X-Received: by 2002:a65:6490:: with SMTP id e16mr23492053pgv.13.1557816914921; Mon, 13 May 2019 23:55:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557816914; cv=none; d=google.com; s=arc-20160816; b=lp3vY4ghe9zZBH0qZLXPIuj7ozAUkwWYaGFL5eYAxG1a4CZ8Z7owcSeWNfkiKBmq/e RcTG8AapPpbZlQbLYO5hYwty3fGfEzefm7h3cp7lY/bijLyb0HbMKVLaaM+BNxkH+r8w IWjlCkIWq3v+XBGl4DX4JLc3gZXlbsG1qd6SM/vzzoh9qbxWpsqKXOCwNtUkKnbGAo/g 9MNIQGy6G0KP7lRE2y6sSDXmo8lMs+TJLKXOlaRIY83r3jucepF9XVD6uknRcdtW8r5C K4U7tQmLN0ODwJ63anKNW/COcGs3S0aPFLRaS1zv5tTgy4MA/D1Nl5g3Lfq408+FWzDu oLWw== 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=1rj1+RwiYfjVd2306CsDvW5O89FLSbjQKmCBWVlsgEs=; b=LSS6mC4OnbTN2fKp/VUWnMvQOct1eDvgWApB8DNAkg8SWcoBjwF0MdkPUndVMcDrbR E3EJ9nmHTxwOkKCQFbA9YQmxwyMecYS1d4cBOu1DlK6XrhL1To+9YH6RGu8uKxPup3Wc Y51oWNxnBfoRjB61oSEI6ZDYEhMa6VfRHjr7RAHWtWy7PWvwCn+YlL3/IbY4CXcIdkzD liRFqBvINnObWmmdU6/KSMzIga7kfgrRozoBHMtYpol11xcCy0dX0o1eidHd+7nr4VRm NjMziack2VIvIduFcqbZPYEexh8NIiPFNnQkn7dJY4ttMOZX7rUVAi7sLOS4qQJYFCZd 1xVA== 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 x125si19849269pgx.355.2019.05.13.23.54.59; Mon, 13 May 2019 23:55:14 -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 S1726473AbfENGw6 (ORCPT + 99 others); Tue, 14 May 2019 02:52:58 -0400 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:43586 "EHLO mail3-relais-sop.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726238AbfENGw6 (ORCPT ); Tue, 14 May 2019 02:52:58 -0400 X-IronPort-AV: E=Sophos;i="5.60,467,1549926000"; d="scan'208";a="305905534" Received: from abo-218-110-68.mrs.modulonet.fr (HELO hadrien) ([85.68.110.218]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 May 2019 08:52:54 +0200 Date: Tue, 14 May 2019 08:52:54 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: Markus Elfring cc: Gilles Muller , Masahiro Yamada , Michal Marek , Nicolas Palix , Wen Yang , cocci@systeme.lip6.fr, linux-kernel@vger.kernel.org, Yi Wang Subject: Re: [4/5] Coccinelle: put_device: Extend when constraints for two SmPL ellipses In-Reply-To: <4116e083-9e21-62d7-10b7-5cb26594144c@web.de> Message-ID: References: <1553321671-27749-1-git-send-email-wen.yang99@zte.com.cn> <6f08d4d7-5ffc-11c0-8200-cade7d294de6@web.de> <4116e083-9e21-62d7-10b7-5cb26594144c@web.de> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 14 May 2019, Markus Elfring wrote: > >> A SmPL ellipsis was specified for a search approach so that additional > >> source code would be tolerated between an assignment to a local variable > >> and the corresponding null pointer check. > >> > >> But such code should be restricted. > >> * The local variable must not be reassigned there. > >> * It must also not be forwarded to an other assignment target. > >> > >> Take additional casts for these code exclusion specifications into account > >> together with optional parentheses. > > > > NACK. > > Can you agree to any information which I presented in the commit message? > > > > You don't need so many type metavariables. > > It seems that the Coccinelle software can cope also with my SmPL code addition. > You might feel uncomfortable with the suggested changes for a while. It's ugly. Much more ugly than msg = > > > > Type metavariables in the same ... can be the same. > > Such information is good to know for the proper usage of specifications > after a SmPL ellipsis. > > * Can it become required to identify involved source code placeholders > by extra metavariables? I don't understand the question. > * Would you like to clarify the probability any more how often the shown > type casts will be identical? No idea about this one either. Basically, if you have T && T, the two T's have to be the same, and T is not pure. If you have T || T, then only one will be matched and T remains pure. If you have T on two separate ...s then you are in the && case. If you have T in two branches of a disjunction or in two whens on the same ... you are in the || case. Just as you can use the variable e1 over and over on the same when, you can use the same T. julia