Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4983800yba; Mon, 13 May 2019 03:22:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqxNQYQcBfJg6OSlYlXI3/+TAOpCdk6y7S3GPBg0+4Err5ggy2oLe4TGhrQJSJ745zbWxFXF X-Received: by 2002:a17:902:da4:: with SMTP id 33mr29329366plv.20.1557742942861; 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=vF0PLRVqATlcGWpnJEtw9vtOujNxfSVdQoaVV9Z3sUtMcOR4cVLhMdimn3A/wJm0Lh fmI39JRwIFevF2hD5/e9i2ep1f280ASl/1xIy7J2r78nEOmyEFTOFURSoszBx0dDaVoe YaVZqBuzzSmX6lnKC/6DoDfLHHlr1KZ9gST1K2MlSRv0q7b/v1nNIj+i7W+Nz++cv1Si 578/hW69z3K/s8ZjTr6rNaWOMklImY0M6KDiWglAt6rZXIBmtQEFWEP1kV/7TB6lAcRS vEmSrEjLhA8vhySBP3w9BfYNQtUi+8+E4pa9+GVcKNYwxmPiRp/7JNtWJwcviPHvZXxT EIIw== 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=WWqleVxoY/12N90uGRItblENnyHjQECGV8VwGMo0YrM=; b=HMYstoNcmu3J021VkFLJXinWaGFFSqwSv1isA2u0DVFMia/KSb9+XJAqrbm0GxjOq/ 9fKaJVj27XfOo9jr7YG1boO6PYHIxej713gJb1IY52pmSfKo4QnZrcF8KAE0GEk4+ejE w8oR0wwqUL+oBSoJ4oiF8wieiBC77rALy0cYZ+VXTMHXploKII994J/USc3OdtbnF6Sl +z2XgUsoO4onobG9LuhMfk59k7gIzakPlVyR9sp7+KfDByZ5tGyytIzwrcAfIrhyuXzg aGNbKPHM27sr/bfyGa9TCq3ocgTpKe/VF5iAQNwKgbMXiKVSOnof0U5umkzvmCN2ctSz moDg== 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 k7si15710970pgm.302.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 S1728492AbfEMJdd (ORCPT + 99 others); Mon, 13 May 2019 05:33:33 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:3026 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726218AbfEMJdd (ORCPT ); Mon, 13 May 2019 05:33:33 -0400 X-IronPort-AV: E=Sophos;i="5.60,465,1549926000"; d="scan'208";a="382867991" 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:33:32 +0200 Date: Mon, 13 May 2019 11:33:28 +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 2/5] Coccinelle: put_device: Add a cast to an expression for an assignment In-Reply-To: <07e17d87-09ff-311f-015c-d201df053f56@web.de> Message-ID: References: <1553321671-27749-1-git-send-email-wen.yang99@zte.com.cn> <07e17d87-09ff-311f-015c-d201df053f56@web.de> 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: Wed, 8 May 2019 13:50:49 +0200 > > Extend a when constraint in a SmPL rule so that an additional cast > is optionally excluded from source code searches for an expression > in assignments. Acked-by: Julia Lawall > > Signed-off-by: Markus Elfring > Suggested-by: Julia Lawall > Link: https://lore.kernel.org/lkml/alpine.DEB.2.21.1902160934400.3212@hadrien/ > Link: https://systeme.lip6.fr/pipermail/cocci/2019-February/005592.html > --- > scripts/coccinelle/free/put_device.cocci | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/scripts/coccinelle/free/put_device.cocci b/scripts/coccinelle/free/put_device.cocci > index 3ebebc064f10..120921366e84 100644 > --- a/scripts/coccinelle/free/put_device.cocci > +++ b/scripts/coccinelle/free/put_device.cocci > @@ -24,7 +24,7 @@ if (id == NULL || ...) { ... return ...; } > when != of_dev_put(id) > when != if (id) { ... put_device(&id->dev) ... } > when != e1 = (T)id > - when != e1 = &id->dev > + when != e1 = (T)(&id->dev) > when != e1 = get_device(&id->dev) > when != e1 = (T1)platform_get_drvdata(id) > ( > -- > 2.21.0 > >