Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4490097ybi; Sat, 6 Jul 2019 06:15:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqxEnm0EnU3zQAEuA76K5LEEWJA+lj+yyTDWIEACLfFU+JfITN/lznr3YpKzUs3GXYkpyVoz X-Received: by 2002:a63:e90b:: with SMTP id i11mr11174414pgh.351.1562418931283; Sat, 06 Jul 2019 06:15:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562418931; cv=none; d=google.com; s=arc-20160816; b=WvYki203ZRaVFulL0wWDX4TurGTHc8cIW6Pf9lrNnkp+xGPkyabswN0fs6FMfdvfw8 AR7yOVoqLivgugvsQrYzW59gmhNDP36nJr5RBikCfoRdG9H/86UHy76K4FFrTyy67lcu UeIizRxhyy9U9Tkza2EraBodvcSH0vH+2UGawL52lXbjisjfEASprtkjDHqVwRqRVhpS /z9TCdDsb7LZ9CPER8XrZe5cg2IB1I2VNH0vLbPSArpAgpvO4IM1RmNx4hvYbF8nh2DS TcAPkbsIeRtxwVb78uYaDBwstIJqtPYdb5cjd4ljeAOVwaE18q8QTQxY8i8F/QWPsSo2 U/8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature:dkim-filter; bh=yR96820x8dCsUN7jsyb8LhZwwDE7H4JmOUSfV5/t9ow=; b=J+Afi/j3U8PC/krdplJGgtQTbcFTPlCzT0UNn+C9gMqI0aBSEilNO22vB8s2JxQsaf DFoyfv0GxTzvdDnpxzS/XJRqzGhZ/lDD5+McGr8Wf4ZNrJY3zxhc8EIIl8cLQ3ArCCM3 jj7y91byG/UTqn+C68bjiy8xiS/c/09V7aWMcmMqLmf7yLZRxEz0vKCFJH+h8qs+rAkd f6IYgGBs9Hm8S6ky+LePBIDvx5fIh+ht/SeNN3mSUkmEryOIQQ/vTOyOqPSOA/fI84PL 7rqNTReCFAtIb411kLl0Un9n5BG/kZCcOQla0bHox8NQ2XS/K0fuAiqRR2cmz/Ktagch a9iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=n0OGt9lY; 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 f4si11837456plb.38.2019.07.06.06.15.16; Sat, 06 Jul 2019 06:15:31 -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; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=n0OGt9lY; 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 S1726628AbfGFNOP (ORCPT + 99 others); Sat, 6 Jul 2019 09:14:15 -0400 Received: from conssluserg-03.nifty.com ([210.131.2.82]:25638 "EHLO conssluserg-03.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726526AbfGFNOO (ORCPT ); Sat, 6 Jul 2019 09:14:14 -0400 Received: from mail-ua1-f45.google.com (mail-ua1-f45.google.com [209.85.222.45]) (authenticated) by conssluserg-03.nifty.com with ESMTP id x66DE1pa022118 for ; Sat, 6 Jul 2019 22:14:01 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-03.nifty.com x66DE1pa022118 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1562418842; bh=yR96820x8dCsUN7jsyb8LhZwwDE7H4JmOUSfV5/t9ow=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=n0OGt9lYpUV3X8BVIBRNfCVFkAbpM8YUX6etjGciXbbg58GpQlVo48ed8yh/e6LOw 4XqaFs4Kancu2+A3eWAoSim/EnGZWAF4kGsGzbbMUd1q9VTOdXS6nquq4u0BFLfPit eS+JYR6h1An/lBqh6PUFd5bUAf3PPnVN4pPQK3kk7K3HXkAT5ktz4LrNi7GAxQ+oab e2aOn1wP3LvmWpWH0+4HnHB92TJl+nqRiahhIYPMoQokotxNhaNccaezg3fp5gM0IC Kmnh5exBPfmxex5/ktMCWk5PWIPpNrx+DG7prpd1OS4Pd0uxyLMPqHj1MUa3c1tV6p yqtl8/cuWBHLA== X-Nifty-SrcIP: [209.85.222.45] Received: by mail-ua1-f45.google.com with SMTP id o2so3175022uae.10 for ; Sat, 06 Jul 2019 06:14:01 -0700 (PDT) X-Gm-Message-State: APjAAAW/g/OU2SEK0Gc9zsCEUCUFK8sdLeaAtJzL/arGyAhrnhYtVTeZ BFOQb2c9VNo6rO4rPL2QmNIV+loGnyakylA5S7M= X-Received: by 2002:a9f:25e9:: with SMTP id 96mr4960816uaf.95.1562418840867; Sat, 06 Jul 2019 06:14:00 -0700 (PDT) MIME-Version: 1.0 References: <1553321671-27749-1-git-send-email-wen.yang99@zte.com.cn> <07e17d87-09ff-311f-015c-d201df053f56@web.de> In-Reply-To: <07e17d87-09ff-311f-015c-d201df053f56@web.de> From: Masahiro Yamada Date: Sat, 6 Jul 2019 22:13:25 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [Cocci] [PATCH 2/5] Coccinelle: put_device: Add a cast to an expression for an assignment To: Markus Elfring Cc: Julia Lawall , Gilles Muller , Michal Marek , Nicolas Palix , Wen Yang , Yi Wang , cocci@systeme.lip6.fr, Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 13, 2019 at 6:02 PM 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. > > 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 > --- Applied to linux-kbuild. > 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 > > _______________________________________________ > Cocci mailing list > Cocci@systeme.lip6.fr > https://systeme.lip6.fr/mailman/listinfo/cocci -- Best Regards Masahiro Yamada