Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4983801yba; Mon, 13 May 2019 03:22:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqwm8fkufaD5R25KBk9mfiA/BnKhhlBtrSA/YJ1ghrY1Jn73Ul5rBVrVh4lXEA2mG2yd8d5M X-Received: by 2002:a17:902:6bc2:: with SMTP id m2mr29064015plt.24.1557742942926; Mon, 13 May 2019 03:22:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557742942; cv=none; d=google.com; s=arc-20160816; b=cyXJkgEN+kn0fJw7SRlkypMRGFsSk49tUv+nDypwlwRO0snp2MN/TOr23xdn/RO3+Y mb+E3e0f7fEtezT3nVkOpReCescacwlV0kW1fmGVrMk0hxXJ4XH266ZIqzOcl+RpOz82 vHaOV7/RZ6KdnVyIuxjP36jfl1syA1rOXF50XvJEkBDCCnrDVbiEpv0+4TqjYJ302rvU Hycjdz5e2kNkapIFyt6zl0tLUZiHN9xKE1urO1bcYeILAeQQEvG7dYZLLv9/dKvSRnQr RSZs7losN+JsbFQSd2fPugyurAorCu0Jmka4DpioLVSKjYvYzvdCavHjXaObg/W1ZTTX jHqw== 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=+hDcDMfzrpu9obTVLDkXKNwiMegPZmMxrkMVUBNP+Ss=; b=Tca0gF8RtSn3LReQ7joiGHGUBJIYqpvbhZCf+BSG1rgmMWSNnwbGxq1dJLQIOWa4/h k3nVI0KSM63Ix1xqhmFEs36V9uSNo1Uj/ACzmgGwuzZHze+5/fWqPS5vwSrUe0cBzWr9 SnWSCQdxb4OZuwN6eNE3RUZsO04JHGQLpINbMW11l6+ij1KjGS/UZmmQLS8JxhoNGB4A ABytjLYwGbl2Bb4l0gRMh1LwaPRbT0L2DBmxOLxqqscWqAkVhffKDqK1+NKsC6R3/ZVY OLTNec/Z5qyycIWy9xyVnR9BLhUSgJME3SWKV0KVo8tncsGqvxAkxdj+I0y5RjB+xpXw Q6Rg== 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 x5si10700837plo.164.2019.05.13.03.22.06; Mon, 13 May 2019 03:22:22 -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 S1728367AbfEMJac (ORCPT + 99 others); Mon, 13 May 2019 05:30:32 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:2642 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726218AbfEMJac (ORCPT ); Mon, 13 May 2019 05:30:32 -0400 X-IronPort-AV: E=Sophos;i="5.60,465,1549926000"; d="scan'208";a="382867335" Received: from vaio-julia.rsr.lip6.fr ([132.227.76.33]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 May 2019 11:30:31 +0200 Date: Mon, 13 May 2019 11:30:27 +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: [PATCH 5/5] Coccinelle: put_device: Merge two SmPL when constraints into one In-Reply-To: Message-ID: References: <1553321671-27749-1-git-send-email-wen.yang99@zte.com.cn> 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 13 May 2019, Markus Elfring wrote: > From: Markus Elfring > Date: Mon, 13 May 2019 09:55:22 +0200 > > A single parameter was repeated for a function call in two SmPL > when constraints. > Combine the exclusion specifications into a disjunction for the semantic > patch language so that this argument is referenced only once there. > > Signed-off-by: Markus Elfring NACK. This hurts readability and gives no practical benefit. julia > --- > scripts/coccinelle/free/put_device.cocci | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/scripts/coccinelle/free/put_device.cocci b/scripts/coccinelle/free/put_device.cocci > index 28b0be53fb3f..975cabb97d01 100644 > --- a/scripts/coccinelle/free/put_device.cocci > +++ b/scripts/coccinelle/free/put_device.cocci > @@ -22,8 +22,7 @@ id = of_find_device_by_node@p1(x) > if (id == NULL || ...) { ... return ...; } > ... when != put_device(&id->dev) > when != id = (T6)(e) > - when != platform_device_put(id) > - when != of_dev_put(id) > + when != \( platform_device_put \| of_dev_put \) (id) > when != if (id) { ... put_device(&id->dev) ... } > when != e1 = \( (T) \( id \| (&id->dev) \) \| get_device(&id->dev) \| (T1)platform_get_drvdata(id) \) > ( > -- > 2.21.0 > >